github remix-run/remix fetch-router@0.7.0
fetch-router v0.7.0

20 hours ago
  • BREAKING CHANGE: Move @remix-run/form-data-parser, @remix-run/headers, and @remix-run/route-pattern to peerDependencies.

  • BREAKING CHANGE: Rename InferRouteHandler => BuildRouteHandler and add a Method generic parameter to build a RouteHandler type from a string, route pattern, or route.

  • BREAKING CHANGE: Removed support for passing a Route object to redirect() response helper. Use redirect(routes.home.href()) instead.

  • BREAKING CHANGE: Move html(), json(), and redirect() response helpers to @remix-run/fetch-router/response-helpers export

  • Always run global middleware, even when no route matches

  • More precise type inference for router.get(), router.post(), etc. route handlers.

  • Add support for nesting route maps via object spread syntax

    import { route, resources } from '@remix-run/fetch-router'
    
    let routes = route({
      brands: {
        ...resources('brands', { only: ['index', 'show'] }),
        products: resources('brands/:brandId/products', { only: ['index', 'show'] }),
      },
    })
    
    routes.brands.index // Route<'GET', '/brands'>
    routes.brands.show // Route<'GET', '/brands/:id'>
    routes.brands.products.index // Route<'GET', '/brands/:brandId/products'>
    routes.brands.products.show // Route<'GET', '/brands/:brandId/products/:id'>
  • Add support for URL objects in redirect() response helper

  • Add support for request.signal abort, which now short-circuits the middleware chain. router.fetch() will now throw DOMException with error.name === 'AbortError' when a request is aborted

  • Fix an issue where Router's fetch wasn't spec-compliant

  • Provide empty context.formData to POST/PUT/etc handlers when parseFormData: false

Don't miss a new remix release

NewReleases is sending notifications on new releases.