route-pattern@0.12.0
Breaking Changes📦 remixView on GitHub →
⚠ 2 breaking✨ 5 features🔧 6 symbols
Summary
This release introduces a new RouteMap system via 'createRoutes' for named route management and adds utility methods like 'href' and 'join' to RoutePattern, while removing enum pattern support and the options argument from 'createHrefBuilder'.
⚠️ Breaking Changes
- Removed the 'options' argument from 'createHrefBuilder'. Update calls to 'createHrefBuilder' to remove the second argument.
- Removed support for enum patterns. Ensure all patterns are defined as strings or objects as per the new API.
Migration Steps
- Remove the second 'options' argument from any 'createHrefBuilder' calls.
- Refactor any code relying on enum patterns to use the new string-based or RouteMap patterns.
- Optionally wrap route definitions in 'createRoutes' to take advantage of the new named route access and type safety.
✨ New Features
- Added 'pattern.href(...args)' method for generating URLs directly from RoutePattern instances.
- Added 'createRoutes' function to generate a 'RouteMap' for named route management and human-friendly pattern access.
- Added 'pattern.join(input, options)' to allow building patterns relative to a base pattern.
- Exported 'RouteMatch' type as part of the public API.
- Added support for 'null' and 'undefined' values in optional parameters.
🔧 Affected Symbols
createHrefBuilderRoutePatterncreateRoutesRouteMatchpattern.hrefpattern.join