-
Notifications
You must be signed in to change notification settings - Fork 1.3k
chore: Dependency management RFC #8797
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
Conversation
My understanding is that for at least some of these (looking at react-stately in particular), version duplication wouldn't be a problem. For everything else, I think we could see even less duplication by declaring them as peers with pinned versions. If they are regular dependencies, then a consumer depending on both |
@devongovett With this change, we'll no longer need to add alpha/beta components as a dependency, right? Direct path should work as long as we have the correct monopackage dependency? |
@vezaynk Yeah peer dependencies are a possibility, but it would add a bit of friction to the installation process at least with certain package managers. You'd need to manually install react-aria and react-stately into your project in addition to react-aria-components, even if you weren't using them directly. Also adding peer dependencies is generally a breaking change, so it would be harder to keep backward compatible. Another possibility I mentioned in the RFC is merging all of those into a single mega-package, which would make using the hooks and components together easier as well. But this is a bit bigger of a change that perhaps we'd consider separately in the future. @snow893 Correct, the alpha/beta components would be included in the mono-package with the |
Love the proposal 🎉 Was never a fan of the individual packages approach - this makes a lot more sense to me. Hope to see it implemented. |
@devongovett One downside of this will be harder visibility of cross dependencies being introduced, as they will no longer appear in package.json diff. Do you plan to maintain equal strictness on dependencies between sub-exports? FYI, we have most of what this RFC proposes implemented in our fork, and it definitely delivered an improvement for bundle size of downstream applications 👍 |
@nwidynski what do you mean by cross-dependencies? |
@devongovett I know some work has gone into containing features to specific packages (e.g. collection ids), so im basically wondering whether that will be maintained or dropped. In some cases this isolation would be great to get rid of, but im afraid this could negatively affect bundle size. |
@nwidynski the cross-package dependencies are more problematic because they can break due to multiple versions being installed, or breaking changes between versions. With everything in the same package that risk will become zero. As for bundle size, it should be reduced by usage of sub-path exports which are more reliable than tree shaking. The imports could even be more granular than the current package boundaries for example. |
Thanks for the feedback everyone! We're going to move forward with this approach. We'll start implementation soon and provide early builds that you can test in your projects as we go. Feel free to continue the discussion here if there is additional feedback. |
View Rendered RFC
Related discussions:
@react-aria/utils
3.30.0 introduced breaking change #8635