Skip to content
This repository has been archived by the owner on May 10, 2021. It is now read-only.

revert route/redirect sorting logic to static then dynamic #145

Merged
merged 2 commits into from
Jan 18, 2021

Conversation

lindsaylevine
Copy link
Contributor

this one absolutely needs to be reviewed by finn. the old logic to which we're reverting did not seem to sort static routes, but i think we can sort them as well? separately from the dynamic ones obv - i'm not too sure why we wouldn't.

Fixes #76

@lindsaylevine lindsaylevine added the type: bug code to address defects in shipped code label Jan 17, 2021
@FinnWoelm
Copy link
Collaborator

FinnWoelm commented Jan 17, 2021

If anyone stumbles upon this, Node.js changed the argument order in .sort() from version 10 to version: nodejs/node#24294

This was intentional, to stabilize the sort order, so that the array wouldn't change at all, if the compareFunction in sort() always returned 0. However, this causes issues with our tests, of course, where some are using the old argument order and some the new one. We will have to make sure that our sorts always return a positive or negative value, and not a 0, I guess 😊

@lindsaylevine lindsaylevine merged commit 3a3ccc7 into main Jan 18, 2021
@lindsaylevine lindsaylevine deleted the ll/revert-sorting-logic branch January 18, 2021 05:30
lindsaylevine added a commit that referenced this pull request Jan 18, 2021
- Revert next/image support until jimp module issue is resolved ([#149](#149))
- Revert route/redirect sorting logic to static then dynamic ([#145](#145))
- Fix: incorrect headers syntax & broken local cypress ([#144](#144))
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

You cannot define a route with the same specificity as a optional catch-all route
2 participants