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
Support extensions from globally activated pub packages #7594
Comments
@sigurdm 😄 |
We have You probably want a way to find the .dart_tool/package_config.json for each of these to detect extensions - right? @jonasfj should we extend the list command with more info? Any other ideas? |
I'm not sure globally activated packages should be used for this. Global package activation is a mechanism for installing a package onto your system. That said, a somewhat ludicrous idea would be for devtools to discover system-level extensions by searching Imagine that devtools discovers system-level extensions by:
If you are authoring a global devtools extension, you don't have to ship it as a pub package to be globally activate. You can ship as a globally activated package, because you can use the I suppose it would also be possible for devtools to try and guess the location of the global With this approach system-level devtools extensions could also be installed using system package manager like Maybe, it's a bit crazy, but:
It might just work :D |
@sigurdm
For a globally activated package, we would really just need to look at its contents for the
@jonasfj Since DevTools extensions are shipped as part of the pub ecosystem, I actually think this is a reason we need to support this use case. As a user, I would expect that if I install a package onto my system, that I can use anything that package provides, including executables, extensions, etc.
While this could work, my concern is that this is one more thing that extension authors have to manually set up, and they have to know when they need this and when they do not. I don't expect extension authors to have as much familiarity with what it means to be a "static" extension vs. a "runtime" extension and "global" vs "non-global". We want to make it as simple as possible for authors to build a tool, and know that no matter how users install their package (as a global or as a project dependency), that their users will be able to discover the tool they have built and use it.
I don't think we want to diverge the extension distribution (and enablement) mechanism, since this will be less discoverable for users and will make the development process more difficult for extension authors. Having one way to ship and install an extension (via pub) is ideal. Shipping / installing with pub is straight forward and keeps DevTools extensions in alignment with the Dart ecosystem standards. |
An example of an extension that fits this use case would be an arbitrary development tool package (like an AI-assisted development experience extension or a tool that interacts with the Dart analysis server). These extensions may be runtime or static extensions.
It would be a bit awkward to require a user to add a dev_dependency to every Dart project where they want to use this DevTools extension, since tools like these are not specific to a Dart / Flutter project, but rather to the general Dart / Flutter development experience. The workflow for an end user would be:
dart pub global activate some_pkg
some_pkg
provides a DevTools extension, we should be able to load this in DevTools (and also embedded in the IDE).@jonasfj @sigmundch is there a way to tell from the pub cache what the globally activated pub packages are?
The text was updated successfully, but these errors were encountered: