-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
feat: mutable route tree #9996
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
feat: mutable route tree #9996
Conversation
🦋 Changeset detectedLatest commit: cf9637c The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 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 |
13165e7
to
dad82b1
Compare
a2d13aa
to
1337089
Compare
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.
LGTM! Let's add some edge case unit tests? We have the "removed a loader during HMR", but probably want "added a loader" as well as a few around revalidation being interrupted by a navigation + fetch
@@ -1108,14 +1123,15 @@ export function createRouter(init: RouterInit): Router { | |||
saveScrollPosition(state.location, state.matches); | |||
pendingPreventScrollReset = (opts && opts.preventScrollReset) === true; | |||
|
|||
let routesToUse = inFlightDataRoutes || dataRoutes; |
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 feels sufficient for now since it's only needed in a few spots. But I am wondering if this feels like a hard-to-detect footgun down the road if we add some new code and just reach for dataRoutes
. One thought was a quick getter function like getCurrentDataRoutes()
but maybe even something like renaming dataRoutes -> comittedRoutes
would help add some explicit semantics too. I think it's probably best to table the decision until we tackle the follow ups for fog of war and MFE though
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.
Yea let's tackle this for sure when we got to the granular route updates API
test: cover navigation interruption
No description provided.