Change8

fetch-router@0.11.0

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

Summary

This release introduces a breaking change by replacing the Router class with a createRouter factory function and makes the middleware property optional in route mappings.

⚠️ Breaking Changes

  • The Router class is no longer exported. You must now use the createRouter() factory function to instantiate a router.

Migration Steps

  1. Replace 'new Router()' with 'createRouter()'.
  2. Update imports to use 'createRouter' for instantiation and 'type Router' for TypeScript type annotations.
  3. Optional: Remove empty middleware arrays from router.map() calls to simplify code.

✨ New Features

  • The middleware property in route handler objects passed to router.map() is now optional.

🔧 Affected Symbols

RoutercreateRouterrouter.map