Change8

fetch-router@0.13.0

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

Summary

This release renames the 'route handlers' terminology to 'controllers/actions', updates route helper naming, and introduces method-specific route aliases like get() and post().

⚠️ Breaking Changes

  • Renamed 'route handlers' terminology to 'controller/action'. This affects types and property names used in router mapping.
  • Renamed 'formAction' route helper to 'form' and moved route helpers to 'lib/route-helpers/' subdirectory.
  • The 'middleware' property is now mandatory when using the object-style controller/action format ({ middleware, actions } or { middleware, action }).

Migration Steps

  1. Replace 'RouteHandlers' type with 'Controller', 'RouteHandler' with 'Action', and 'BuildRouteHandler' with 'BuildAction'.
  2. Rename 'handlers' property to 'actions' and 'handler' property to 'action' in your controller objects.
  3. Update 'formAction' imports and calls to 'form'.
  4. If using object-style handlers without middleware, either add an empty middleware array or refactor to use plain request handler functions/objects.
  5. Update import paths for route helpers if importing from subdirectories.

✨ New Features

  • Added functional aliases (get, post, put, patch, del) for creating routes that respond to specific HTTP methods.

🔧 Affected Symbols

RouteHandlersRouteHandlerBuildRouteHandlerformActionFormActionOptionsControllerActionBuildActionformFormOptionsgetpostpatchdelrouter.maprouter.any