-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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: rest matcher skipped if optional is empty #10020
Conversation
🦋 Changeset detectedLatest commit: 72e580a 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 |
Pretty sure this more comprehensive PR fixes this issue as well: #9987 |
Hmm, maybe not -- not sure -- either way, let's not add integration tests for this. There's a |
e1471d1
to
81af6ba
Compare
Changed integration test to unit test. I'm pretty sure that #9987 does not fix that case. |
@pzerelles would you mind addressing the merge conflict that's shown up? It's a result of me merging #9987 |
56841d2
to
ac2b2bd
Compare
The unit test here fails without the change that's here, so I'm going to say this change is still necessary and go ahead and merge it. I cut a release with #9987 in it so that the two PRs will be in separate releases. That way if anyone encounters any regressions related to routing changes it will be easier to tell which PR affected it |
I found that since version 1.3.6 a matcher on a rest parameter is not called anymore if an optional parameter before it is empty. I'm using the optional for localization and the following rest parameter has a matcher.
Example route:
[[locale=locale]]/[...rest=page]
For
/en/test
, thepage
matcher will be called with paramtest
.For
/test
, thepage
matcher was not called since version 1.3.6.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.