Minor Changes
- Deprecated
limits.maxMatchWorkinMatcherOptions(MatcherLimits.maxMatchWork). Match work budgeting is an internal safeguard whose unit count depends on matcher implementation details; rely on the built-in default instead of configuringmaxMatchWork. Passinglimits.maxMatchWorkcontinues to work in1.xand will be removed in a future major release. (#12467)
Patch Changes
-
createMatcher(),createMultiMatcher(), andcreateHref()are significantly faster and use less memory, especially with large route tables. In our benchmarks, matching against 1,000 to 5,000 patterns is 20 to 60 times faster, building a matcher is 5 to 9 times faster,createHref()is 1.2 to 1.9 times faster, and patterns with many optional segments, wildcards, ormatchAll()candidates no longer slow down sharply. Match results, specificity, and generated hrefs are unchanged. (#12427) -
createHref()now throws aCreateHrefErrorwithdetails.typeofinvalid-pathname-variablewhen a pathname variable produces a standalone.or..segment, such ascreateHref('/posts/:id', { id: '..' }). URL parsers remove these segments, so the generated href could resolve to a different route. This also applies to thehref()method of routes created withroute()fromremix/routes. (#12424)