| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Ensure that an extension's name in config.yaml matches the package name in pubspec.yaml
There was a problem hiding this comment.
This pull request introduces validation during DevTools extension discovery and validation to ensure that an extension's declared name in config.yaml matches its containing package name. If there is a mismatch, the extension is ignored (with a warning) or validation fails. This is implemented across devtools_shared and devtools_extensions, with corresponding tests added.
Feedback on the changes highlights two potential runtime issues:
Sorry, something went wrong.
There was a problem hiding this comment.
The actually breaks an intentional feature of DevTools extensions that allows you to develop your extension in a different package than the one where you ship it. See https://github.com/rrousselGit/provider/tree/master/packages for an example. This is necessary because many package authors want to decouple their Flutter Web project (DevTools extension) from their package that users import as a direct dependency. Developing the devtools extension in another package allows the Flutter web code and deps to be kept separate from the package users depend on.
Sorry, something went wrong.
|
I didn't realize that was the intended behavior. I'm not sure how exactly to proceed. Here here are some alternatives we could consider:
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This ensures that packages can't provide extensions for package with a different name.
To test this behavior, create a new package under packages/devtools_extensions/example/test_validation_pkg:
devtools/config.yaml:
pubspec.yaml:
Run the validator: