feat!: support mixed params in same path segment #52
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #11
Resolves #42
This feature allows to combine more advanced URL patterns such as
/files/:category/:id,name:name.txt
to be able to mix and match multiple static and dynamic params in same segment (/files/test/123,name=foobar.txt"
should match to{ category: "test", id: "123", name: "foobar" }
).The breaking change is that param name should be strict
a-zA-Z0-9_
only not accepting.
in it and:
in between anymore.Also since we introduced new
MIXED
type, it should be applied if any library like nuxt and nitro was translating patterns to other platforms, to have it in mind that a mixed segment not essentially starting with:
but can have it in between.Implementation also requires
String.prototype.matchAll
support compatibility. (i am open to adding polyfill in later releases if there was a platform absolutely cannot have it now.