feat(routing)!: upgrade React Router to v8 - #412
Open
IzumiSy wants to merge 5 commits into
Open
Conversation
IzumiSy
marked this pull request as ready for review
July 31, 2026 03:31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
AppShell owns the router instance internally and re-exports routing primitives for consumers.
That setup works cleanly as long as the package and the consuming app stay on the same React Router major version, but it can fail at runtime when they drift apart.
This change upgrades AppShell itself to React Router v8, raises the supported React baseline to match React Router's requirements, and updates the docs to reinforce that consumers should import routing primitives from
@tailor-platform/app-shellso everything stays on the same router context.Design Decision
Chosen approach
Keep the upgrade narrow:
react-routerinpackages/core19.2.7RouterProviderto the DOM-specific import used by React Router v8Why this upgrade was smooth in AppShell
React Router v8 is a major release, but most of the breaking surface is in baseline/runtime support and in cleanup of compatibility layers that had already been deprecated or gated behind future flags in v7.
AppShell does not rely on most of those areas. Its router usage is mostly limited to stable APIs such as
Link,useNavigate,useParams,useSearchParams,useRouteError, and the data-router constructors. Because of that, the AppShell-specific work stayed small: dependency bumps, theRouterProviderimport adjustment, and test fixes for v8's ESM-only exports.Test strategy under ESM-only exports
React Router v8's ESM-only exports made the existing
vi.spyOn(react-router, "createMemoryRouter")assertions invalid.Instead of rewriting the router lifecycle tests completely, this PR adds a tiny local
routerFactoriesindirection so the tests can keep asserting when the router is or is not recreated.Alternatives considered
A larger rewrite of the routing layer was skipped because the current AppShell usage only needs a dependency/baseline upgrade plus a small import adjustment.
Summary
@tailor-platform/app-shellto React Router v8reactandreact-domversion to19.2.7