-
Notifications
You must be signed in to change notification settings - Fork 377
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
refactor: guard react router consistency #3724
Conversation
🦋 Changeset detectedLatest commit: 1c05a80 The changes in this PR will be included in the next version bump. This PR includes changesets to release 207 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## main #3724 +/- ##
==========================================
+ Coverage 57.59% 58.13% +0.54%
==========================================
Files 672 643 -29
Lines 17794 17183 -611
Branches 3876 3752 -124
==========================================
- Hits 10249 9990 -259
+ Misses 6934 6592 -342
+ Partials 611 601 -10 ☔ View full report in Codecov by Sentry. |
Summary
The versions of
react-router-dom
and@remix-run/router
must match exactly.@modern-js/plugin-data-loader
has a direct dependency on@remix-run/router
, while@modern-js/runtime
depends on it transitively throughreact-router-dom
. To ensure version consistency, we have moved packages related to react-router to@modern-js/utils
. Packages in modernjs now import router-related APIs from@modern-js/utils
.Additionally, due to a change in the DeferredData check logic in react-router (see remix-run/react-router#10247), we can now directly export APIs such as
defer
fromreact-router-dom
instead of from@remix-run/router
.Details
🤖 Generated by Copilot at 0e09080
@modern-js/utils
package and its consumers to use more specific and modular submodules (link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link)@modern-js/utils/runtime/remix-router
that contains the types and functions related to the@remix-run/router
package, such asUNSAFE_DeferredData
,defer
, andredirect
(link,link,link,link,link)@modern-js/utils/runtime/nested-routes
that contains the functions related to the nested routes feature, such astransformNestedRoutes
andrenderNestedRoute
(link,link,link,link)@modern-js/utils/runtime-node/router
that re-exports some of the types and functions fromreact-router-dom/server
and adds some custom ones, such ascreateStaticHandler
andStaticHandlerContext
(link,link,link,link,link)react-router-dom
to use the re-exported versions from@modern-js/utils/runtime/router
, which ensures consistency and avoids multiple versions ofreact-router-dom
(link,link,link,link,link,link,link,link,link,link)@modern-js/utils
package to remove the@remix-run/router
dependency, update thereact-router-dom
dependency to the exact version6.11.2
, and remove thereact-router-dom
peer dependency (link)react-router-dom
dependency from the@modern-js/runtime
package, since it is not directly used by the package, but only re-exported from the@modern-js/utils/runtime/router
module (link)@modern-js/plugin-data-loader
,@modern-js/runtime
, and@modern-js/utils
, and includes the commit message in both English and Chinese (link)Related Issue
Checklist
pnpm run change
.