github remix-run/remix cli@1.0.1
cli v1.0.1

latest releases: ui@0.13.0, remix@3.1.0, static-middleware@1.0.1...
3 hours ago

Patch Changes

  • New apps now derive AppContext from the router with RouterContext<typeof router> instead of declaring it up front and passing it to createRouter<AppContext>(). The explicit type argument turned off middleware inference, so middleware added to the router later (such as formData()) did not show up on context in controllers. This also matches the setup shown in the Remix guides. (#11999)

    Existing generated apps can apply the same setup in app/router.ts:

    -import { createRouter, type MiddlewareContext } from 'remix/router'
    +import { createRouter, type RouterContext } from 'remix/router'
    
    -const renderMiddleware = render({ assets })
    -type AppContext = MiddlewareContext<[typeof renderMiddleware]>
    +export const router = createRouter({
    +  middleware: [staticFiles('./public', { index: false }), render({ assets })],
    +})
    +
    +export type AppContext = RouterContext<typeof router>
    
     declare module 'remix' {
       interface RouterTypes {
         context: AppContext
       }
     }
    
    -export const router = createRouter<AppContext>({
    -  middleware: [staticFiles('./public', { index: false }), renderMiddleware],
    -})
  • Bumped @remix-run/* dependencies:

Don't miss a new remix release

NewReleases is sending notifications on new releases.