-
Notifications
You must be signed in to change notification settings - Fork 0
Fix/peer deps singleton 8777 #1
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
base: main
Are you sure you want to change the base?
Conversation
Addresses issue adobe#8777 by converting key singleton packages to peer dependencies, preventing duplicate package installations in consumer projects. This change ensures that packages like @react-types/shared, @react-aria/utils, @react-stately/utils, and the @internationalized/* packages are treated as true singletons across the dependency tree. Changes: - Moved 343 internal dependencies to peerDependencies across 185 packages - Updated aggregator packages (react-aria, react-stately) to declare all required singleton peer dependencies - Ensures singleton behavior for: * @react-types/shared * @react-aria/utils * @react-aria/ssr * @react-stately/utils * @react-stately/flags * @internationalized/string * @internationalized/date * @internationalized/number * @internationalized/message Benefits: - Prevents duplicate installations when version ranges overlap - Ensures type overrides work correctly in consumer projects - Maintains true singleton behavior for RouterProvider and other context-based features - Allows consumers to explicitly control singleton versions Breaking Changes: - Consumers now need to explicitly declare singleton peer dependencies - Package managers (npm/pnpm) will auto-install these by default - Yarn users may need to declare these dependencies explicitly Fixes adobe#8777
Co-authored-by: diaz9797 <[email protected]>
Co-authored-by: diaz9797 <[email protected]>
|
@cursor review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is being reviewed by Cursor Bugbot
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| "@internationalized/string": "^3.2.7", | ||
| "@react-stately/flags": "^3.1.2", | ||
| "@react-stately/utils": "^3.10.8", | ||
| "@react-types/shared": "^3.32.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Missing peer dependency in react-stately aggregator
The react-stately aggregator package is missing @internationalized/date in its peerDependencies, even though it depends on @react-stately/calendar and @react-stately/datepicker which both declare @internationalized/date as a peer dependency. This creates an incomplete transitive peer dependency declaration, potentially causing installation issues for consumers who don't have @internationalized/date installed, especially when using Yarn which doesn't auto-install peer dependencies.
Add all required singleton peer dependencies (@internationalized/date, @internationalized/message, @internationalized/number, @react-stately/flags, @react-stately/utils) to ensure proper transitive peer dependency resolution.
| "@react-aria/ssr": "^3.9.10", | ||
| "@react-aria/utils": "^3.31.0", | ||
| "@react-stately/utils": "^3.10.8", | ||
| "@react-types/shared": "^3.32.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Missing peer dependencies in react-aria-components
The react-aria-components package depends on react-aria which requires @internationalized/message, @internationalized/number, and @react-stately/flags as peer dependencies, but react-aria-components doesn't declare these in its own peerDependencies. This creates incomplete transitive peer dependency declarations, potentially causing missing dependency errors for consumers.
| "@internationalized/number": "^3.6.5", | ||
| "@react-aria/utils": "^3.31.0", | ||
| "@react-stately/utils": "^3.10.8", | ||
| "@react-types/shared": "^3.32.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Missing peer dependencies in @react-spectrum/s2
The @react-spectrum/s2 package depends on react-aria and react-stately but is missing several required transitive peer dependencies: @internationalized/message, @internationalized/string, @react-aria/ssr, and @react-stately/flags. These are all required by the aggregator packages it depends on, and their absence will cause peer dependency warnings or errors for consumers.
This PR addresses issue adobe#8777 by converting key singleton packages to peer dependencies, preventing duplicate package installations in consumer projects.
Problem
Internal packages like `@react-types/shared`, `@react-aria/utils`, and `@react-stately/utils` are declared as regular dependencies with version ranges. This causes duplicate installations when consumers pin specific versions, breaking type overrides and singleton behavior.
Solution
Implements Solution B from issue adobe#8777: converting internal singleton packages to peer dependencies.
Changes
Testing
Breaking Changes
npm & pnpm: Auto-install peer dependencies by default (no action needed)
Yarn: May require explicit declaration of singleton packages
Related
Fixes adobe#8777" --base main --head fix/peer-deps-singleton-8777
Note
Converts internal singleton packages to peerDependencies across the monorepo and updates aggregator packages to declare required peers, preventing duplicate installs.
peerDependenciesacross packages:@react-types/shared,@react-aria/utils,@react-aria/ssr,@react-stately/utils,@react-stately/flags, and@internationalized/{date,number,string,message}.react-aria,react-stately,react-aria-components,@adobe/react-spectrum) to declare required transitive peers.dependenciesand adjustpeerDependenciesin affected@react-aria/*,@react-spectrum/*,@react-stately/*, and@react-types/*packages.Written by Cursor Bugbot for commit 189f5c1. This will update automatically on new commits. Configure here.