-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Unmanageable dependency versions - Proposal: make react-aria and react-stately truly monolith. #7946
Comments
Wouldn't that result in the same problem described in #6326 (comment)? Then if you mixed the I'd say if we did this we'd need to do it in a major version, and deprecate the individual packages at the same time. |
Linking in another related discussion #7909 (comment) |
@devongovett true, the interoperability of libraries that use the monolith package and the ones that use the individual packages will be affected by such a change. Maybe I'm biased based on the use cases I've seen but it's weighed less in my head, compared to the issues mentioned above. A constraint that disallows a mix of react-aria and @react-aria/* packages would be less limiting in practice than the current state which:
You could also just deprecate the individual packages as you said and go for a single package. I'd be happy to contribute by a migration codemod for projects that use the individual packages. The current structure (/interactions, /selection, /focus, etc.) is indeed a nice modular structure, but maybe it doesn't mean those should be versioned separately. With package.json |
Yeah, I agree with you in theory. That's why we went to a single package for react-aria-components. We could probably move more in that direction, but it would need to be done in a major version I think. One downside is that lots of other libraries use just one small part of React Aria. For example, Tailwind's Headless UI project uses |
Provide your feedback here.
We have implemented our design system based on @react-aria/* @react-stately/* packages, and it's been great how we can delegate the heavy lifting of accessibility and functionality of components to these packages, focusing on our design. What has not been working great for us though is the complicated interdependencies of packages and how little control we have over what we depend on.
Several cases of past releases broke our library, and the worst part is there is no way for us to ensure we get a chance to fix potential issues before they hit our users. That's because even if we set the dependency version of @react-aria/* packages to exact versions, the interdependencies of @react-aria/* and @react-stately/* packages still request a wide range (using
^
). E.g.my-lib
->@react-aria/[email protected]
->@react-aria/interactions@^x.y.z
will bring in the latest version of@react-aria/interactions
in a new installation of my-lib. Using thereact-aria
monolith package also doesn't change anything.See also:
#7675 #2195
Proposal
I'm aware of your motivations for having a granular packaging for react-spectrum, and I understand you don't want to pin the version of interdependencies to a single version to make the shared dependencies dedupe-able. But for react-aria and react-stately monolith packages, would you consider eliminating the dependencies and exporting everything from source? That would greatly reduce the entropy and give more control to component libraries. That way:
I know it's not as simple as changing react-aria's index.ts to export from source, but how about changing the build configuration for react-aria and react-stately monolith packages to inline and emit the dependencies rather than externalizing them?
🔦 Context
We have hundreds of frontend apps depending on our design system library that's implemented using @react-aria and @react-stately packages and with most of the past react-spectrum releases there has been something that broke our components. With the way those dependencies depend on each other, our end users are directly affected by react spectrum releases, rather than us being able to upgrade, test and release new versions.
💻 Code Sample
No response
Version
No response
What browsers are you seeing the problem on?
No response
If other, please specify
No response
What operating system are you using?
No response
The text was updated successfully, but these errors were encountered: