Minor Changes
-
BREAKING CHANGE: Action objects now use
handlerinstead ofaction.This applies to the object form accepted by
router.get(...),router.post(...), androuter.map(...), and toBuildActionobject definitions. -
BREAKING CHANGE: Remove
context.storage,context.session,context.sessionStarted,context.formData, andcontext.filesfrom@remix-run/fetch-router, and renamecreateStorageKey(...)tocreateContextKey(...).RequestContextnow provides request-scoped context methods directly (context.get(key),context.set(key, value), andcontext.has(key)), using keys created withcreateContextKey(...)or constructors likeSessionandFormData.Session middleware now stores the request session with
context.set(Session, session), and form-data middleware now stores parsed form data withcontext.set(FormData, formData). Uploaded files are read fromcontext.get(FormData)usingget(...)/getAll(...).RequestContextis now generic over route params and typed context entries (RequestContext<{ id: string }, entries>), and no longer accepts a request-method generic (RequestContext<'GET', ...>). -
BREAKING CHANGE:
router.map()controllers for route maps now require a single shape: an object with anactionsproperty and optionalmiddleware.Migration: Wrap existing controller objects in
actions. Nested route maps must also use nested controllers with{ actions, middleware? }. -
fetch-routernow threads request context types throughRouter,Controller, andBuildAction, and exports helpers likeMiddlewareContext,WithParams,MergeContext, andAnyParamsso apps can derive context contracts from installed middleware.
Patch Changes
-
The
Action/BuildActionobject form accepted byrouter.get(...),router.post(...), androuter.map(...)now uses{ handler, middleware? }, so you can omitmiddlewareentirely instead of writingmiddleware: []when you do not need route middleware. -
Bumped
@remix-run/*dependencies: