Change8

fetch-router@0.14.0

Breaking Changes
📦 remixView on GitHub →
2 breaking1 features🔧 3 symbols

Summary

This release simplifies the API by consolidating request handler types and removing generics from RequestHandler, while exposing MatchData for custom routing logic.

⚠️ Breaking Changes

  • The `BuildRequestHandler` type has been removed. Replace all instances with the `RequestHandler` type.
  • The `T` generic parameter has been removed from the `RequestHandler` type. Request handlers are now restricted to returning a `Response` object.

Migration Steps

  1. Replace `BuildRequestHandler` with `RequestHandler` in your type definitions.
  2. Remove generic type arguments from `RequestHandler` (e.g., change `RequestHandler<MyType>` to `RequestHandler`).
  3. Ensure all request handlers return a standard `Response` object.

✨ New Features

  • Exported the `MatchData` type to the public API, enabling the creation of custom matchers for the router's `matcher` option.

🔧 Affected Symbols

BuildRequestHandlerRequestHandlerMatchData