Minor Changes
-
Customize frame fetching and rendering with
defaultResolveFramefromremix/component. Its{ fetch, commit }overrides let apps manage cached responses and animate navigations, including followed redirects. Resolvers receive the originalnavigationTypeandfromhistory entry;commitreceives the resolved destination, andcommitFrame()waits for rendering and navigation completion. See the bookstore demo for traversal caching and shared cover/title animations. (#12249) -
Follow frame navigations with
rmx:navigationfromremix/component: listen on a source link or form for contextual pending UI, or onwindowin capture mode for links, forms, programmatic navigation, and Back/Forward. The event exposes the initiatingelement(null without a source), optional submission details, initial browser destinationto, requestedframeSrc, and namedframeTarget, and one completion promise through redirects, scroll, and focus. (#12183) -
Load below-the-fold content as it approaches the viewport with
<Frame loading="lazy" fallback={<p>Loading…</p>} />fromremix/component. Lazy loading observes elements rendered by the fallback. Lazy frames render their fallback on the server and load in the browser, while eager loading remains the default. (#12229) -
Follow frame reloads with
FrameReloadStartEventfromremix/component, carrying request and origin details aligned withframe.reload(). Itselementis anHTMLAnchorElement,HTMLAreaElement,SVGAElement,HTMLFormElement, ornull. Itsfinishedpromise follows thePromise<AbortSignal>contract offrame.reload(), and descendant frames track their own completion. (#12183) -
Multiple selects in
remix/componentaccept arrays invalueanddefaultValue. Usevalue={[]}to clear the current selection, ordefaultValue={[]}to start with nothing selected. (#12338) -
Pass anchors to
prefetch()fromremix/componentto use their navigation destinations and cancel stale prefetches when links change or disconnect. See Prefetching for usage. (#12277) -
Customize prefetching with
defaultPrefetchfromremix/component, including nested frame selection by loading mode. See Prefetching for usage. (#12277) -
Reflect locally rendered state in the URL with
updateUrl()fromremix/component, without fetching, rendering, or changing scroll and focus. Replace the current entry or push a new one. (#12110) -
remix/data-tablequery builder rows now have the same JavaScript shape on every adapter:json()columns are serialized on write and parsed on read,boolean()columns read astrueorfalse, andtimestamp()columns read asDateobjects. Arrays interpolated intosqlexpand intoinlists. See thedata-tablechangelog for details. (#12337) -
remix/data-table/sql-helpersnow includes shared SQL clause compilers, such ascompilePredicate()andcompileWhereClause(), for building customdata-tableadapters. See thedata-tablechangelog for details. (#12276) -
t.useFakeTimers()fromremix/testnow also fakesDate,performance.now(),setImmediate(), andAbortSignal.timeout(), starting at the Unix epoch unless you pass anowoption, so wall-clock code can be tested by advancing the fake clock. (#12203) -
Added mocking support for data properties, getters, and setters in
remix/test(t.mock.property(),t.mock.getter(), andt.mock.setter()), with automatic restoration after test cleanup. ExportedMockTrackeras the shared type for standalone and test-context mocks. (#12225) -
Added
TestFnandTestMetaexports fromremix/testfor reusable test callbacks and metadata. (#12226) -
Add new
t.waitFor()API to wait for asynchronous state in tests usingremix/test. (#12224)
Patch Changes
-
Fix
remix/assetsCSS@importresolution failing with a rawENOTDIRerror when an import path passes through a file, such as@import "./theme.css/dark.css". These imports now reportIMPORT_RESOLUTION_FAILED, matching script imports and other missing CSS imports. (#12282) -
Apps created with
remix newon Windows can runnpm run devandnpm startagain. The generated scripts usedcross-env-shell, which failed withERR_INVALID_MODULE_SPECIFIERon Windows. See the@remix-run/clichangelog to update the scripts in an existing app. (#12338) -
Fixes for frames and client navigation in
remix/component: (#12274)- A client-rendered
<Frame>keeps showing its current content when itssrcchanges while nested frames or client entries are still loading. Previously it could remount and flash itsfallbackbefore the new source resolved. reloadStartandreloadCompleteframe events fire as one pair per reload. Re-enteringframe.reload(), or a reload that took over one inherited from an ancestor frame, previously dispatched unmatched or early events.- Safari restores the saved scroll position on back and forward navigations when the destination's frames render immediately, instead of keeping the position of the page being left.
- Server-rendered frames keep multibyte characters intact when
resolveFramereturns a stream that splits a UTF-8 character across chunks. Previously those characters were replaced withU+FFFD.
See the
@remix-run/componentchangelog for details. - A client-rendered
-
Form controls in
remix/componentkeep what visitors do before they hydrate. Text typed and checkboxes or radios toggled before a control's client entry hydrates are no longer overwritten by the server-renderedvalueorchecked. Instead, the edit is replayed asinputandchangeevents once the handlers attach. Replayed events haveevent.isTrustedset tofalseand run at hydration time, so a handler that submits a form, saves a draft, or starts a request does so as soon as the control hydrates. Values the browser restores into a form, such as on reload or a Back/Forward navigation not served from the back/forward cache, count as edits too. Addautocomplete="off"to a control to opt it out of browser form restoration. (#12338)<select>initialization now follows the same precedence on the server, on client mount, and during hydration:value, then the initialdefaultValue, then optionselected.See the
@remix-run/componentchangelog for details. -
Navigation, focus, and prefetching fixes in
remix/component: (#12338)- A link click, form submission, or
navigate()call that interrupts a navigation before its page renders now replaces that navigation's history entry, so Back returns to the page the visitor saw. Links and GET forms withdata-rmx-history="replace"also replace the entry before their navigation commits in browsers that support it. - Focus stays where it was when a frame navigation fails, such as a form submission whose response is a 5xx page. Previously focus moved to
<body>. - Viewport prefetching waits 150ms after scrolling stops and pauses while the document is hidden. Links that are visible without a scroll, such as on page load, still prefetch right away. Default prefetching also waits for idle time before parsing downloaded HTML.
See the
@remix-run/componentchangelog for details. - A link click, form submission, or
-
createScheduler()fromremix/componentno longer accepts its unused thirdstylesargument. Passing it had no effect, so runtime behavior is unchanged, but TypeScript calls with three arguments now fail to type-check. CallcreateScheduler(document, errorTarget)instead. See the@remix-run/componentchangelog for details. (#12310) -
Rendering fixes and improvements in
remix/component: (#12338)- List updates no longer put DOM in the wrong place, remove siblings, or throw
NotFoundErrorwhen a keyed<Fragment>gains children, a component switches fromnullto DOM while siblings move, or a trailing<Fragment>loses its children. New keyed children are inserted once at their final position, so custom elements no longer runconnectedCallbacktwice. - Mixins that listen for
beforeUpdateorcommit, such asanimateLayout()from@remix-run/ui, now scale linearly with the number of mounted elements instead of quadratically. - The browser runtime loads fewer modules: pages that hydrate with
run()load 23 component modules instead of 35, andupdateUrl()andspaResponseload only in apps that import them. clientEntry()no longer fails with "Type instantiation is excessively deep and possibly infinite" for props that mixSerializableObjectwith other serializable values, such as aFormSubmission.
See the
@remix-run/componentchangelog for details. - List updates no longer put DOM in the wrong place, remove siblings, or throw
-
Fix
remix/data-table/mysqlupserts with a separateupdateobject writing values into the wrong columns. (#12276) -
remix/data-table/sqlitebindsDateparameters as UTC strings in SQLite'scurrent_timestampformat. Previously, writing atimestamp()column, including the defaultcreated_atandupdated_atvalues, could fail or shift the remaining parameters in Node.js. See thedata-table-sqlitechangelog for details. (#12338) -
Every
remix/data-tableadapter now binds each query parameter as exactly one value. In raw SQL, serialize JSON withJSON.stringify()and write one placeholder perINlist item; the query builder serializesjson()column values for you. See thedata-table,data-table-mysql, anddata-table-sqlitechangelogs for adapter-specific changes. (#12335) -
Nested
sqlcomposition inremix/data-tablenow requires fragments created bysqlorrawSqlfrom the same loaded copy of the package. Other statement objects are passed as parameter values. See thedata-tablechangelog for migration examples. (#12332) -
Development fixes: (#12338)
- Barrel file import optimization in
remix/assetsno longer downloads unused modules in nested import graphs. - HMR with
remix/component-hmrno longer throws aReferenceErrorwhen a component's setup creates a callback that uses a setup variable declared after it. - Under
t.useFakeTimers()inremix/test,clearTimeout()andclearInterval()cancel real timers created before fake timers were enabled, timer callbacks receive extra arguments, timer handles in Node supportunref()andrefresh(), and test and hook timeouts no longer stall.
- Barrel file import optimization in
-
Fix
remix/headersAccept,Accept-EncodingandAccept-Languageweights when several header entries match a value.getWeight(),accepts()andgetPreferred()now prefer an exact entry, then the most specific matching range, as RFC 9110 requires. Previously the highest-weighted match won, soAccept-Encoding: gzip;q=0, *reportedgzipas acceptable andAccept-Language: en;q=0, en-USreportedenas acceptable. (#12297)Accept-Languageranges now match by full subtag prefix, sozh-Hant-TWno longer matcheszh-Hant-CN.AcceptEncoding#accepts('identity')now returnsfalsewhen the header refusesidentitywithidentity;q=0, or with*;q=0and noidentityentry. It still returnstruewhenidentityis not mentioned. -
Varyfromremix/headerskeeps header names as they were first given, socompression()andcors()no longer rewriteVary: CookietoVary: cookie. Safari only varies its cache on cookies when the name is spelledCookie, so the lowercased value could let it reuse a private response for a different session.Vary: *is also preserved instead of becoming an invalid value likeVary: *, Accept-Encoding, andCacheControl.from()no longer drops directives whose names aren't lowercase, such asNo-Store. (#12338) -
The rendering, interactivity, and animation guides keep single-use
css()styles beside their elements and explain when to name shared styles or variant maps. (#12193) -
remix/node-fetch-servernow validates the request host for every handler. Hosts with a path, query, fragment, userinfo, whitespace, or control characters, from thehostoption, a trusted forwarding header, HTTP/2:authority, orHost, makecreateRequest()throw and makecreateRequestListener()respond with400 Bad RequestunlessonErrorreturns a response. An invalid trustedX-Forwarded-Hostis now rejected instead of falling back toHost. See the@remix-run/node-fetch-serverchangelog for details. (#12338) -
Fixes for dev servers using
remix/node-hmr: (#12198)- Requests no longer hang and file changes are no longer missed after some hot updates and restarts, and file watcher errors are logged instead of crashing the server.
- Changing files while the previous server process is still shutting down no longer starts an extra server process that keeps running in the background.
See the
@remix-run/node-hmrchangelog for the specific cases. -
Validate native form submissions with
remix/data-schema/experimental/form, including restorable values and grouped errors on failure while omitting sensitive values and files. Inspect schemas and reuse typed fields throughgetSchemaMetadata()fromremix/data-schema/experimental. These experimental exports may change or be removed in patch releases. (#12206) -
context.render()fromremix/middleware/renderno longer responds with200when a component throws while rendering the page shell. The middleware now waits for the first chunk of HTML, so shell errors rejectrouter.fetch()forGETandHEADrequests and the server can respond with a500. (#12338) -
Fix
remix/response/compresscompressResponse()returning406 Not Acceptablewhen the client lists only encodings the server does not support, such asAccept-Encoding: gzipwithencodings: ['br']. An unlistedidentityencoding is acceptable, so the response is now sent uncompressed. Responses are still rejected when the client refusesidentitywithidentity;q=0or*;q=0. (#12297) -
Fixes for
remix/router: (#12338)- Responses that resolve after their request was aborted have their bodies cancelled, so streaming work behind them, such as rendering a frame, stops.
- Router middleware sees the full
GETresponse when aGETroute serves aHEADrequest. The body is now stripped after middleware runs. - Inline
{ middleware, handler }controller actions type their handler with their own action middleware. RouterContextandMiddlewareContextkeep the types of the other middleware when the array contains a conditional entry like...(isDev ? [logger()] : []).
See the
@remix-run/fetch-routerchangelog for details. -
Bumped
@remix-run/*dependencies:assets@1.0.3async-context-middleware@1.0.1auth@1.0.2auth-middleware@1.0.2cli@1.0.3component@1.3.0component-hmr@1.0.2compression-middleware@1.0.3cookie@1.0.3cop-middleware@1.0.1cors-middleware@1.0.3csp-middleware@1.0.1csrf-middleware@1.0.2data-schema@1.0.1data-table@1.1.0data-table-mysql@1.1.0data-table-postgres@1.0.1data-table-sqlite@1.1.0fetch-proxy@1.0.3fetch-router@1.0.1form-data-middleware@1.1.2form-data-parser@1.1.2headers@1.1.1logger-middleware@1.0.1method-override-middleware@1.0.1multipart-parser@1.1.2multiple-import-maps-polyfill@1.0.2node-fetch-server@1.0.1node-hmr@1.0.1render-middleware@1.1.1response@1.0.3session-middleware@1.0.3spa@1.0.3static-middleware@1.0.3test@1.2.0