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
fix(utils): respect patterns within paths when sorting routes #20669
Conversation
Β Open in CodeSandbox Web Editor | VS Code | VS Code Insiders |
# Conflicts: # packages/utils/test/__snapshots__/route.test.js.snap # yarn.lock
Make the / optional and match : or * anywhere in the string. This ensures that special routes will be below normal routes. Also ensures that route / will be sorted before the special routes.
@danielroe can we run the actions on this PR ? |
@danielroe we got an error on the windows audit, how can we fix that ? It's a timeout error. |
β¦change the priority of param route
fb07d51
to
bce4af8
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.
I've tested this on a couple of projects that (admittedly) only have a single *
route but I haven't noticed any issues.
One thing that happens consistently is that the root route (/
) changes position to after all other dynamic routes (ones that use :
). So in theory that could result in slightly slower resolving of that particular route but not sure if it's something to be concerned about.
So thumbs up from me.
Co-authored-by: RafaΕ ChΕodnicki <rchl2k@gmail.com>
π Linked issue
Fixes #10630
β Type of change
π Description
Update sortRoutes to handle routes with letters and * (test*)
Resolves #10630
π Checklist