-
Notifications
You must be signed in to change notification settings - Fork 232
Support peer dependencies #1837
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
Comments
Yes, please! |
Hey, I'm developing nock package. Is there any plans to implement peer dependencies support? |
... looking through old issues. A peer_dependency is a constraint on another package but doesn't require that other package to be included in the resolution? Am I understanding this right? What happens if you just make a regular dependency? Don't you always need json_serializable when you use json_annotation? |
Peer dependency is a dependency that a user should explicitly specify in a pubspec. A good article about the corresponding npm feature here. |
@sigurdm – you are correct. If you have a dependency on |
Sorry I don't get this (might need more coffee). Can you spell out a scenario where a peer dependency solves a problem that a regular dependency wont (in the pub model where all dependencies are shared in a resolution). |
@matanlurey was the original idea maker here. I may have lost the thread.... |
It would be nice to have implementation of peer dependencies in flutter pubspec |
@uvlek can you explain some scenarios where you would use them? I'm still unsure about what they exactly can help us with. |
Without additional information we're not able to resolve this issue, so it will be closed at this time. You're still free to add more info and respond to any questions above, though. We'll reopen the issue if you do. Thanks for your contribution! |
One way that I can think, working on a large project, having the project's features in there own packages to make the app more modular but 2 packages might depend on each other. This will cause a cyclic dependency which could be fixed by having the 2 features in the same package but then the issue is that both features need to be stable before release a new version of the package. Peer packages will allow the features to be in its own packages and allow for stability in the app. |
Uh oh!
There was an error while loading. Please reload this page.
From NPM: https://nodejs.org/en/blog/npm/peer-dependencies/
There is an increasing number of packages (
built_*
,json_*
,angular
, so others for Flutter) that require a specificdev_dependency
range for compatible tooling/code generation. For example, thejson_annotation
package is platform agnostic, but requires thejson_serializable
package for code generation.It would be nice to be able to write, in
pubspec.yaml
:... so that,
dev_dependencies
onjson_serializable
are validated against this range./cc @kevmoo @mit-mit
The text was updated successfully, but these errors were encountered: