Skip to content

Switch to using "dart create" instead of stagehand for newer SDK versions #3179

Closed

Description

@RandalSchwartz

Describe the bug
Stagehand is deprecated. The new thing is dart pub create

To Reproduce
Steps to reproduce the behavior:

  1. uninstall the broken stagehand (broken now because pub no longer exists):
    dart pub global deactivate stagehand # buh bye broken tool
  2. command-window Dart: create project
  3. Fails, wanting the now-broken stagehand to be reinstalled. No way, jose.

Expected behavior
dart pub create gets run with the proper args

Screenshots

Versions (please complete the following information):

  • VS Code version: 1.54.1
  • Dart extension version: 3.20.1
  • Dart/Flutter SDK version: 2.0+dev

Activity

  1. DanTup commented on Mar 7, 2021

    @DanTup
    Member

    uninstall the broken stagehand (broken now because pub no longer exists):

    Can you clarify what you're seeing here? I deactivated stagehand and ran Dart: New Project but it re-activated and worked as expected. I don't think it's intended that it should have stopped working yet. Are you seeing errors?

  2. added
    awaiting infoRequires more information from the customer to progress
    on Mar 7, 2021
  3. RandalSchwartz commented on Mar 7, 2021

    @RandalSchwartz
    Author

    Yes there is a package named stagehand that is now legacy and won't be maintained by the home team, and installs broken because it depends on "pub" existing, which is going away. "dart pub create" has replaced it, and already diverges on the kinds of templates to use. stagehand works for you because you still have a legacy "pub" command installed. I don't, deliberately for testing, although I can symlink it back in when I'm desperate.

  4. DanTup commented on Mar 8, 2021

    @DanTup
    Member

    and installs broken because it depends on "pub" existing, which is going away

    I'm a little confused - are you saying that this will break, or it is broken?

    My understanding is that the pub command is not going to disappear anytime soon (that would be quite breaking). The goal is to move to dart xxx commands, but that's not something that needs to happen urgently. However if something is broken today then that very much needs fixing right away.

    Thanks!

  5. RandalSchwartz commented on Mar 12, 2021

    @RandalSchwartz
    Author

    If today, you install the Flutter distro, and add its one bin to your PATH ($SDK_PATH/bin), you will get the flutter and dart commands, and the fully functional dart SDK, but no pub command. This is by design. stagehand has gone away, pub has gone away, and even "dart global activate" is broken because it writes a bin that includes "pub" instead of "dart pub". (I haven't tested flutter global activate, because it's broken by installing in a separate directory that's not ~/.pub-cache, but that's a separate issue.)

    So, even today, if you start from scratch, and then use pub global, that will fail, and if you use dart pub global, that seems to fail as well. You should try "dart create" first.

  6. DanTup commented on Mar 12, 2021

    @DanTup
    Member

    I'm still a little confused about whether there's a bug here, or this is a request to change something for the future.

    Dart-Code should never calls pub from Flutter's bin folder, nor directly from PATH. It should always use the Dart SDK's bin folder.

    If you can reproduce an error or something broken, please provide exact steps as that's much more urgent to fix than moving over to new commands/templates. Thanks!

  7. changed the title [-]Internal stagehand access should be replaced with new "dart pub create" call.[/-] [+]Switch to using "dart create" instead of stagehand for newer SDK versions[/+] on Mar 29, 2021
  8. added
    in commandsRelates to commands (usually invoked from the command Palette)
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    and removed
    awaiting infoRequires more information from the customer to progress
    on Mar 29, 2021
  9. added this to the v3.22.0 milestone on Mar 29, 2021
  10. DanTup commented on Mar 29, 2021

    @DanTup
    Member

    I've renamed this as a general issue to support dart create for newer SDKs since I don't think there's anything wrong with the existing code, it should just be migrated for the future (see dart-archive/stagehand#671).

  11. added a commit that references this issue on Mar 29, 2021
    0473ba4
  12. modified the milestones: v3.22.0, v3.21.0 on Mar 29, 2021
  13. added a commit that references this issue on Mar 29, 2021
    ee2af62
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in commandsRelates to commands (usually invoked from the command Palette)is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions