Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[shared_preferences] Add shared preferences devtool #8322

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

adsonpleal
Copy link
Contributor

This PR adds the shared_preferences_tool package. This package uses the devtools_extension tooling to create a tool for shared preferences. The idea of this PR came from @kenzieschmoll on this issue. Initially I've published this tool as a separate package, but this PR aims to bring the functionality to the main shared_preferences package. Once this PR gets merged I'll archive the shared_preferences_tools package.

shared_preferences_tools.mp4

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@adsonpleal
Copy link
Contributor Author

@kenzieschmoll and @stuartmorgan reopening the PR for the reverted changes.

@kenzieschmoll now I'm getting an error on Linux analyze stable step:

image

Also, I don't know why the changes are different, checked every file, but this PR seems to have +7,851 additions and the old one had +5,156. I guess github is counting it wrong 🤷 .

@adsonpleal
Copy link
Contributor Author

adsonpleal commented Dec 17, 2024

Never mind the additions issue! I actually found the offending file. [shared_preferences_tool_eval_test.mocks.dart](https://github.com/flutter/packages/pull/8322/files#diff-569dab15b9971e9d7447872f2ff00405e9c4374ae84a0e3b47a368c085e8c778) is way bigger, since EvalOnDartLibrary and VmService APIs have changed!

I'll remove mockito for this file, 3k+ changes just for the mocks is not reasonable.

@adsonpleal
Copy link
Contributor Author

adsonpleal commented Dec 18, 2024

@kenzieschmoll about the SDK constraint required by the CI, should we reduce the min version on devtools_entensions(by releasing a new version)? Or should I just downgrade it to 0.2.2? The 0.2.2 version was working fine on the CI.

EDIT:

Unfortunately I can't downgrade it either:
image

@kenzieschmoll
Copy link
Member

I think if you upgrade the devtools_app_shared dependency to ^0.3.0 in shared_preferences_tool that should fix your version solving issue.

@adsonpleal
Copy link
Contributor Author

I think if you upgrade the devtools_app_shared dependency to ^0.3.0 in shared_preferences_tool that should fix your version solving issue.

That is the issue, it is already on ^0.3.0, as you can see here. But the CI is failing failing with this error:

============================================================
|| Running for packages/shared_preferences/shared_preferences_tool [@3:06]
============================================================

Running command: "flutter pub get" in /b/s/w/ir/x/w/packages/packages/shared_preferences/shared_preferences_tool
Resolving dependencies...
The current Flutter SDK version is 3.27.0.

Because shared_preferences_tool depends on devtools_extensions >=0.3.0 which requires Flutter SDK version >=3.27.1, version solving failed.


You can try the following suggestion to make the pubspec resolve:
* Try using the Flutter SDK version: 3.27.1. 
Failed to update packages.

[packages/shared_preferences/shared_preferences_tool completed in 0m 2s]

The Linux analyze stable is running flutter 3.27.0 🤔 .

@stuartmorgan do you know if the Linux analyze stable will (or already is) be updated to 3.27.1? This should fix the problem.

@kenzieschmoll
Copy link
Member

@stuartmorgan do you know if the Linux analyze stable will (or already is) be updated to 3.27.1? This should fix the problem.

Agreed this should be our target solution. If this is not possible, I can downgrade the min version to 3.27.0 and do a patch release of devtools_app_shared and devtools_extensions. Will wait for @stuartmorgan to comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants