Releases: remix-run/remix
session v0.4.1
- Always delete the original session ID when it is regenerated with the
deleteOldSessionoption. Intermediate IDs are never saved to storage, so they can't be deleted.
session-middleware v0.1.1
- Use
response.headers.append('Set-Cookie', ...)instead ofresponse.headers.set('Set-Cookie', ...)to not overwrite cookies set by other middleware/handlers
form-data-middleware v0.1.1
- Explicitly set
context.formDatain allPOSTcases, even when the request body is invalid
fetch-router v0.13.0
-
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:
RouteHandlerstype =>ControllerRouteHandlertype =>ActionBuildRouteHandlertype =>BuildActionhandlersproperty =>actionshandlerproperty =>action
-
BREAKING CHANGE: Renamed
formActionroute helper toformand moved route helpers tolib/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
FormActionOptionstype has also been renamed toFormOptions. -
BREAKING CHANGE: The
middlewareproperty 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 likeactioncollide with theactionproperty 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
- Move
@remix-run/headerstopeerDependencies
lazy-file v4.2.0
- Move
@remix-run/mimetopeerDependencies
fs v0.3.0
- Move
@remix-run/lazy-fileand@remix-run/mimetopeerDependencies
static-middleware v0.4.0
-
BREAKING CHANGE: Replace
mrmimedependency with@remix-run/mimefor MIME type detection which is now a peer dependency. -
Add support for
acceptRangesfunction 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
-
BREAKING CHANGE: Now uses
@remix-run/responsefor file and HTML responses instead of@remix-run/fetch-router/response-helpers. The@remix-run/responsepackage is now a peer dependency. -
Add
listFilesoption to generate a directory listing when a directory is requested.staticFiles('./public', { listFiles: true })
session v0.4.0
-
Add
Sessionclass. ThecreateSessionfunction now returns an instance of theSessionclass.// 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
createFileSessionStoragetocreateFsSessionStorageand 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')