-
Notifications
You must be signed in to change notification settings - Fork 300
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
Don't rely on .packages
to detect if dependencies needs to be fetched
#3813
Comments
Thanks for the heads up! We do already handle Dart-Code/src/extension/pub/pub.ts Lines 22 to 24 in 03c6662
I'll go through everywhere and fix them up.
I'll update to do this too. Currently we're only doing |
Can we instead surface an api in |
That could be nice - although we may do this check for many folders are once (eg. you open a monorepo) so if we did it by calling pub/dart it would be good to be able to ask for them all in one go to avoid spawning many processes. Slightly related, there are some other small things we have some logic in the editor for - like "run pub get on pubspec save" that presumably need the same google3/google SDK exclusions. We also have to debounce it in case it's saved multiple times. IIRC it's done with file watchers, so perhaps there's value in some mini-daemon for Pub that can handle requests both for checking if the dependencies need fetching, and handling watching/fetching (reporting progress to the editor)? (although, perhaps that wouldn't play nice with Flutter projects since they currently want |
I've updated to use package_config for now. Even if we do the above, we'll need to support the SDKs between now and then.
I left this as it was ( |
@DanTup, if you have So I would suggest checking the file modification time, if it exists.. But yes, in many cases it won't matter too much.. As for making a daemon that would be cool, and fast as we could cache a lot of state in memory (rather than loading from PUB_CACHE). But it's probably also a lot of work to build it, and make it useful. For now I think we should just keep it simple :) |
1 similar comment
@DanTup, if you have So I would suggest checking the file modification time, if it exists.. But yes, in many cases it won't matter too much.. As for making a daemon that would be cool, and fast as we could cache a lot of state in memory (rather than loading from PUB_CACHE). But it's probably also a lot of work to build it, and make it useful. For now I think we should just keep it simple :) |
Good point. Though I think I'll have to assume if that file is missing that's not an indicator that it needs to be run (given the SDK example). |
Starting Dart 2.17 (as of current planning),
dart pub get
won't generate.packages
anymore. I noticed a few places in Dart-Code that looks for.packages
files, for example to determine ifdart pub get
needs to be run.Maybe there are other places where
.packages
is used in Dart-Code?See: dart-lang/sdk#48272
Side note: The best was to determine if
dart pub get
needs to run is probably to check that the modification time ofpubspec.yaml < pubspec.lock < .dart_tool/package_config.json
.The text was updated successfully, but these errors were encountered: