Skip to content

Upgrading to 0.22.1 ​

Breaking changes ​

Greedy params ​

Path params now match one path segment by default. Add * after the name when a param must continue matching across / separators.

ts
// Before: captures nested file paths
const path = '/files/[path]'

// After
const path = '/files/[path*]'

Use [?path*] for an optional greedy param. See Greedy Params.

Route URL methods ​

Created routes now expose the URL API: stringify, parse, and tryParse. The separate host, path, query, and hash template objects are no longer properties on the created route. Replace code assembling those pieces with route.stringify(params), or use router.resolve(name, params).href.

Explicit Route generic arguments also change to use a combined Url type. Prefer typeof yourRoute for annotations. The new Url object type is distinct from the UrlString type renamed in 0.22.0.

URL parts type ​

UrlParts is no longer exported. Prefer the browser's URL API for generic URL inspection, and createUrl or a route's URL methods for param-aware parsing.

Full release notes.