Skip to content

Releases: remix-run/remix

session v0.4.1

06 Dec 20:36

Choose a tag to compare

  • Always delete the original session ID when it is regenerated with the deleteOldSession option. Intermediate IDs are never saved to storage, so they can't be deleted.

session-middleware v0.1.1

06 Dec 20:37

Choose a tag to compare

  • Use response.headers.append('Set-Cookie', ...) instead of response.headers.set('Set-Cookie', ...) to not overwrite cookies set by other middleware/handlers

form-data-middleware v0.1.1

06 Dec 20:36

Choose a tag to compare

  • Explicitly set context.formData in all POST cases, even when the request body is invalid

fetch-router v0.13.0

01 Dec 19:09

Choose a tag to compare

  • BREAKING CHANGE: Renamed "route handlers" terminology to "controller/action" throughout the package. This is a breaking change for anyone using the types or properties from this package. Update your code:

    // Before
    import type { RouteHandlers } from '@remix-run/fetch-router'
    
    let routeHandlers = {
      middleware: [auth()],
      handlers: {
        home() {
          return new Response('Home')
        },
        admin: {
          middleware: [requireAdmin()],
          handler() {
            return new Response('Admin')
          },
        },
      },
    } satisfies RouteHandlers<typeof routes>
    
    router.map(routes, routeHandlers)
    
    // After
    import type { Controller } from '@remix-run/fetch-router'
    
    let controller = {
      middleware: [auth()],
      actions: {
        home() {
          return new Response('Home')
        },
        admin: {
          middleware: [requireAdmin()],
          action() {
            return new Response('Admin')
          },
        },
      },
    } satisfies Controller<typeof routes>
    
    router.map(routes, controller)

    Summary of changes:

    • RouteHandlers type => Controller
    • RouteHandler type => Action
    • BuildRouteHandler type => BuildAction
    • handlers property => actions
    • handler property => action
  • BREAKING CHANGE: Renamed formAction route helper to form and moved route helpers to lib/route-helpers/ subdirectory. Update your imports:

    // Before
    import { route, formAction } from '@remix-run/fetch-router'
    
    let routes = route({
      login: formAction('/login'),
    })
    
    // After
    import { route, form } from '@remix-run/fetch-router'
    
    let routes = route({
      login: form('/login'),
    })

    The FormActionOptions type has also been renamed to FormOptions.

  • BREAKING CHANGE: The middleware property is now required (not optional) in controller and action objects that use the { middleware, actions } or { middleware, action } format. This eliminates ambiguity when route names like action collide with the action property name.

    // Before: { action } without middleware was allowed
    router.any(routes.home, {
      action() {
        return new Response('Home')
      },
    })
    
    // After: just use a plain request handler function instead
    router.any(routes.home, () => {
      return new Response('Home')
    })
    
    // Before: { actions } without middleware was allowed
    router.map(routes, {
      actions: {
        home() {
          return new Response('Home')
        },
      },
    })
    
    // After: just use a plain controller object instead
    router.map(routes, {
      home() {
        return new Response('Home')
      },
    })
    
    // With middleware, the syntax remains the same (but middleware is now required)
    router.map(routes, {
      middleware: [auth()],
      actions: {
        home() {
          return new Response('Home')
        },
      },
    })
  • Add functional aliases for creating routes that respond to a single request method

    import { del, get, patch, post } from '@remix-run/fetch-router'
    
    let routes = route({
      home: get('/'),
      login: post('/login'),
      logout: post('/logout'),
      profile: {
        show: get('/profile'),
        edit: get('/profile/edit'),
        update: patch('/profile'),
        destroy: del('/profile'),
      },
    })

multipart-parser v0.14.0

26 Nov 00:05

Choose a tag to compare

  • Move @remix-run/headers to peerDependencies

lazy-file v4.2.0

26 Nov 00:05

Choose a tag to compare

  • Move @remix-run/mime to peerDependencies

fs v0.3.0

26 Nov 00:06

Choose a tag to compare

  • Move @remix-run/lazy-file and @remix-run/mime to peerDependencies

static-middleware v0.4.0

25 Nov 23:20

Choose a tag to compare

  • BREAKING CHANGE: Replace mrmime dependency with @remix-run/mime for MIME type detection which is now a peer dependency.

  • Add support for acceptRanges function to conditionally enable HTTP Range requests based on the file being served:

    // Enable ranges only for large files
    staticFiles('./public', {
      acceptRanges: (file) => file.size > 10 * 1024 * 1024,
    })
    
    // Enable ranges only for videos
    staticFiles('./public', {
      acceptRanges: (file) => file.type.startsWith('video/'),
    })

static-middleware v0.3.0

25 Nov 04:36

Choose a tag to compare

  • BREAKING CHANGE: Now uses @remix-run/response for file and HTML responses instead of @remix-run/fetch-router/response-helpers. The @remix-run/response package is now a peer dependency.

  • Add listFiles option to generate a directory listing when a directory is requested.

    staticFiles('./public', { listFiles: true })

session v0.4.0

25 Nov 04:27

Choose a tag to compare

  • Add Session class. The createSession function now returns an instance of the Session class.

    // You can now create sessions using either approach:
    import { createSession, Session } from '@remix-run/session'
    
    // Factory function
    let session = createSession()
    
    // Or use the class directly
    let session = new Session()
  • BREAKING CHANGE: Rename createFileSessionStorage to createFsSessionStorage and export from @remix-run/session/fs-storage

    // before
    import { createFileSessionStorage } from '@remix-run/session/file-storage'
    let storage = createFileSessionStorage('/tmp/sessions')
    
    // after
    import { createFsSessionStorage } from '@remix-run/session/fs-storage'
    let storage = createFsSessionStorage('/tmp/sessions')