feat(history-sync): add priority option to routes#536
feat(history-sync): add priority option to routes#536XiNiHa wants to merge 1 commit intodaangn:mainfrom
priority option to routes#536Conversation
🦋 Changeset detectedLatest commit: 916185d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Our team has been thinking about this issue before, and we thought of several candidates for the acceptable priority rule.
Which method do you think is the best? |
|
Although I also believe that the score calculation should be the default behavior in most cases, I found that it sometimes makes sense to override this and therefore made this PR, which works as a hybrid of 1 and 3. I prefer my solution the most since it provides both a good default and an escape hatch that can be utilized in advanced use cases. |
Oh, I see. Is there an example that requires an escape hatch against score rule? |
|
My use case was dynamically matching splat routes in runtime and falling back to the default route-matching algorithm when no match was found. It was for keeping the URLs simple while using https://github.com/contentstech-com/stackflow-plugin-omniflow and also utilized #535 to appropriately transform activity params to a URL. I can also share a code snippet for dynamic route matching if you need to see that. |
Please check the added test suite to see the expected behavior!