Minor Changes
-
BREAKING CHANGE: Route matching now uses delimiter-bounded params and a bounded state compiler (see #11651). Pathname params possessively capture through hyphens but stop at raw
/or., so UUIDs remain intact andcreateHref()percent-encodes dots in param values for round-tripping. Patterns such as/:year-:monthmust migrate to one inseparable param such as/:date, or place captures in separate delimiter-bounded segments.Patterns may contain any number of separated wildcards and optional groups without eagerly expanding variants or using backtracking regular expressions. Adjacent wildcards, empty optionals, params followed by non-delimiter text, and ambiguous adjacent optional capture schemas now throw
ParseError. Repeated capture names remain valid: the last participating capture wins inparams, whileparamsMetaretains every capture in source order.Static pattern text is decoded during matching, while raw and percent-encoded
/and.retain distinct structural meaning. Matchers also accept configurable pattern-size, matcher-size, and match-work limits throughMatcherOptions.limits; exceeding a limit throwsMatcherResourceErrorwith structured details. -
BREAKING CHANGE:
createHref(pattern, params, searchParams)now accepts an options object as its third argument. Move existing search parameters tocreateHref(pattern, params, { searchParams }).Matchers now accept relative URL strings when an absolute
baseURLis provided tomatch()ormatchAll().createHref()accepts the samebaseURLoption and returns path-relative references for same-origin targets while leaving cross-origin targets absolute. ThesearchParamsoption accepts both typed plain objects andURLSearchParams; repeatedURLSearchParamsentries retain their order.