Skip to content
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

POC optimization for matchRoutes #12169

Merged
merged 4 commits into from
Jan 21, 2025
Merged

Conversation

brophdawg11
Copy link
Contributor

No description provided.

Copy link

changeset-bot bot commented Oct 21, 2024

🦋 Changeset detected

Latest commit: dd53c69

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
react-router Patch
@remix-run/router Patch
react-router-dom Patch
react-router-dom-v5-compat Patch
react-router-native Patch

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

@brophdawg11 brophdawg11 force-pushed the brophdawg11/matchroute-optimization branch from 1116190 to 119d5d8 Compare January 13, 2025 16:42
Copy link

@mattkubej mattkubej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, tested locally and observed total time improvements to matchRoutes/matchRoutesImpl by about 40% on navigation

@brophdawg11 brophdawg11 marked this pull request as ready for review January 21, 2025 16:37
@brophdawg11 brophdawg11 merged commit 5112743 into v6 Jan 21, 2025
3 checks passed
@brophdawg11 brophdawg11 deleted the brophdawg11/matchroute-optimization branch January 21, 2025 16:37
Copy link
Contributor

🤖 Hello there,

We just published version 6.28.3-pre-v6.0 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@jwallet
Copy link

jwallet commented Feb 5, 2025

well looks like this fix broke all navigation on initial load :/

@DiRover
Copy link

DiRover commented Feb 6, 2025

I have a problem with navigation now, when login and logout in my app

@brophdawg11
Copy link
Contributor Author

Could you elaborate? Please open a github issue with a reproduction so we can look into it

@jwallet
Copy link

jwallet commented Feb 6, 2025

search params are ignored now?, actually I think it comes from this MR #12899 using diff between @[email protected]

https://github.com/remix-run/react-router/blame/cc8b8cebe241c1464424e1a66d1f3e3bfa5bdd4d/packages/router/__tests__/lazy-discovery-test.ts#L2439

so the navigation works inside the app, but if i copy paste an url to another tab the router does not find the valid path/route and shows our default 404, some of these route use queryparams, my-page?view=tab1

@brophdawg11
Copy link
Contributor Author

Can you provide a reproduction? Route matching only considers the pathname so I'm unsure what issue you would be running into not exposing search params to patchRoutesOnNavigation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants