You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The top-level pub command is scheduled for deprecation in favor of dart pub.
We added dart pub in version 2.10.0, so it might still be necessary to call pub get for some older versions of the Dart SDK.
However, we plan to insert a deprecation warning in the top-level pub command, in Dart 2.12.0 (next stable release of the Dart SDK). Hence, to avoid users experiencing a deprecation warning in pub get output, it would be preferable to migrate to dart pub get now.
@jonasfj will do! I presume it's fine to use "dart pub get" for both Flutter and non-Flutter projects? (right now we have to pick between pub get and flutter pub get to avoid an error when fetching for Flutter projects).
Currently we're running tests by running dart [pub snapshot path]. This is to get the same pause-on-start behaviour as when running non-tests on the VM (so we don't need to have separate code to handle this). This isn't ideal, but it seemed better than having to maintain separate code to handle this.
We used to set DART_VM_OPTIONS=--pause_isolates_on_start=true but that had the issue of cascading to child processes too, which can mess up user tests that spawn Dart instances. There's a little discussion about that in dart-lang/pub#1018.
So for now, unless you think there will be breakage, I'll leave the tests as-is but fix up the rest.
Activity
DanTup commentedon Nov 9, 2020
@jonasfj will do! I presume it's fine to use "dart pub get" for both Flutter and non-Flutter projects? (right now we have to pick between
pub getandflutter pub getto avoid an error when fetching for Flutter projects).jonasfj commentedon Nov 9, 2020
@DanTup I think it's best to use
flutter pub getfor flutter projects... It does some setup steps required for plugins and other things.DanTup commentedon Nov 9, 2020
Got it - thanks! I wasn't sure if the reason for this change was to consolidate them both.
BTW, I presume this applies to all
pubcommands (we also callpub upgrade,pub outdated,pub global list,pub global run)?jonasfj commentedon Nov 9, 2020
Yes, all
pubcommands should usedart pub:)There is also
dart testnow, for running tests.DanTup commentedon Nov 10, 2020
Currently we're running tests by running
dart [pub snapshot path]. This is to get the same pause-on-start behaviour as when running non-tests on the VM (so we don't need to have separate code to handle this). This isn't ideal, but it seemed better than having to maintain separate code to handle this.We used to set
DART_VM_OPTIONS=--pause_isolates_on_start=truebut that had the issue of cascading to child processes too, which can mess up user tests that spawn Dart instances. There's a little discussion about that in dart-lang/pub#1018.So for now, unless you think there will be breakage, I'll leave the tests as-is but fix up the rest.
Use "dart pub" when SDK supports it