remix-run/remix
 Watch   
 Star   
 Fork   
5 days ago
remix

node-fetch-server v1.0.1

Patch Changes

  • createRequest() and createRequestListener() now validate the request host for every handler, including handlers that take no arguments. The effective host, whether it comes from the host option, a trusted Forwarded or X-Forwarded-Host header, HTTP/2 :authority, or Host, must be a hostname or bracketed IPv6 address with an optional port. Values with a path, query, fragment, userinfo, whitespace, or control characters, such as example.com/../admin or user@example.com, make createRequest() throw. createRequestListener() passes the error to onError and responds with 400 Bad Request unless onError returns a response. An invalid trusted X-Forwarded-Host is rejected instead of falling back to Host. (#12331)
5 days ago
remix

response v1.0.3

Patch Changes

  • Fix compressResponse() returning 406 Not Acceptable when the client lists only encodings the server does not support, such as Accept-Encoding: gzip with encodings: ['br']. An unlisted identity encoding is acceptable, so the response is now sent uncompressed. Responses are still rejected when the client refuses identity with identity;q=0 or *;q=0. (#12297)

  • Bumped @remix-run/* dependencies:

5 days ago
remix

render-middleware v1.1.1

Patch Changes

5 days ago
remix

ui v0.14.0

Minor Changes

  • BREAKING CHANGE: The animateExit() mixin now starts animations synchronously in beforeRemove instead of deferring them to a microtask. This allows animateLayout() to measure the updated layout when exiting elements are taken out of normal flow. (#12220)

    This is unlikely to be a breaking change for most consumers. Custom mixins used alongside animateExit() may be affected if they inspect computed styles or call getAnimations() in beforeRemove and rely on the exit animation starting later.

  • animateEntrance() and animateExit() mixins now support per-property timing and compositing overrides via the transition option. (#12220)

  • Validate native controls with a shared form schema using @remix-run/ui/form. form.Context supplies field bindings, and root, control, label, and error mixins provide native constraints, validation feedback, and accessible associations. Failed submissions restore values and display errors. Applications own the markup, and forms work with or without JavaScript. These experimental APIs may change or be removed in patch releases. (#11630)

  • Added @remix-run/ui/toast for accessible toast notifications. A shared manager retains notifications in the browser, with providers and mixins connecting them to your own markup after mounting. (#12084)

Patch Changes

5 days ago
remix

remix v3.3.0

Minor Changes

  • Customize frame fetching and rendering with defaultResolveFrame from remix/component. Its { fetch, commit } overrides let apps manage cached responses and animate navigations, including followed redirects. Resolvers receive the original navigationType and from history entry; commit receives the resolved destination, and commitFrame() waits for rendering and navigation completion. See the bookstore demo for traversal caching and shared cover/title animations. (#12249)

  • Follow frame navigations with rmx:navigation from remix/component: listen on a source link or form for contextual pending UI, or on window in capture mode for links, forms, programmatic navigation, and Back/Forward. The event exposes the initiating element (null without a source), optional submission details, initial browser destination to, requested frameSrc, and named frameTarget, 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>} /> from remix/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 FrameReloadStartEvent from remix/component, carrying request and origin details aligned with frame.reload(). Its element is an HTMLAnchorElement, HTMLAreaElement, SVGAElement, HTMLFormElement, or null. Its finished promise follows the Promise<AbortSignal> contract of frame.reload(), and descendant frames track their own completion. (#12183)

  • Multiple selects in remix/component accept arrays in value and defaultValue. Use value={[]} to clear the current selection, or defaultValue={[]} to start with nothing selected. (#12338)

  • Pass anchors to prefetch() from remix/component to use their navigation destinations and cancel stale prefetches when links change or disconnect. See Prefetching for usage. (#12277)

  • Customize prefetching with defaultPrefetch from remix/component, including nested frame selection by loading mode. See Prefetching for usage. (#12277)

  • Reflect locally rendered state in the URL with updateUrl() from remix/component, without fetching, rendering, or changing scroll and focus. Replace the current entry or push a new one. (#12110)

  • remix/data-table query builder rows now have the same JavaScript shape on every adapter: json() columns are serialized on write and parsed on read, boolean() columns read as true or false, and timestamp() columns read as Date objects. Arrays interpolated into sql expand into in lists. See the data-table changelog for details. (#12337)

  • remix/data-table/sql-helpers now includes shared SQL clause compilers, such as compilePredicate() and compileWhereClause(), for building custom data-table adapters. See the data-table changelog for details. (#12276)

  • t.useFakeTimers() from remix/test now also fakes Date, performance.now(), setImmediate(), and AbortSignal.timeout(), starting at the Unix epoch unless you pass a now option, 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(), and t.mock.setter()), with automatic restoration after test cleanup. Exported MockTracker as the shared type for standalone and test-context mocks. (#12225)

  • Added TestFn and TestMeta exports from remix/test for reusable test callbacks and metadata. (#12226)

  • Add new t.waitFor() API to wait for asynchronous state in tests using remix/test. (#12224)

Patch Changes

  • Fix remix/assets CSS @import resolution failing with a raw ENOTDIR error when an import path passes through a file, such as @import "./theme.css/dark.css". These imports now report IMPORT_RESOLUTION_FAILED, matching script imports and other missing CSS imports. (#12282)

  • Apps created with remix new on Windows can run npm run dev and npm start again. The generated scripts used cross-env-shell, which failed with ERR_INVALID_MODULE_SPECIFIER on Windows. See the @remix-run/cli changelog 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 its src changes while nested frames or client entries are still loading. Previously it could remount and flash its fallback before the new source resolved.
    • reloadStart and reloadComplete frame events fire as one pair per reload. Re-entering frame.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 resolveFrame returns a stream that splits a UTF-8 character across chunks. Previously those characters were replaced with U+FFFD.

    See the @remix-run/component changelog for details.

  • Form controls in remix/component keep 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-rendered value or checked. Instead, the edit is replayed as input and change events once the handlers attach. Replayed events have event.isTrusted set to false and 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. Add autocomplete="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 initial defaultValue, then option selected.

    See the @remix-run/component changelog 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 with data-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/component changelog for details.

  • createScheduler() from remix/component no longer accepts its unused third styles argument. Passing it had no effect, so runtime behavior is unchanged, but TypeScript calls with three arguments now fail to type-check. Call createScheduler(document, errorTarget) instead. See the @remix-run/component changelog 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 NotFoundError when a keyed <Fragment> gains children, a component switches from null to 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 run connectedCallback twice.
    • Mixins that listen for beforeUpdate or commit, such as animateLayout() 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, and updateUrl() and spaResponse load only in apps that import them.
    • clientEntry() no longer fails with "Type instantiation is excessively deep and possibly infinite" for props that mix SerializableObject with other serializable values, such as a FormSubmission.

    See the @remix-run/component changelog for details.

  • Fix remix/data-table/mysql upserts with a separate update object writing values into the wrong columns. (#12276)

  • remix/data-table/sqlite binds Date parameters as UTC strings in SQLite's current_timestamp format. Previously, writing a timestamp() column, including the default created_at and updated_at values, could fail or shift the remaining parameters in Node.js. See the data-table-sqlite changelog for details. (#12338)

  • Every remix/data-table adapter now binds each query parameter as exactly one value. In raw SQL, serialize JSON with JSON.stringify() and write one placeholder per IN list item; the query builder serializes json() column values for you. See the data-table, data-table-mysql, and data-table-sqlite changelogs for adapter-specific changes. (#12335)

  • Nested sql composition in remix/data-table now requires fragments created by sql or rawSql from the same loaded copy of the package. Other statement objects are passed as parameter values. See the data-table changelog for migration examples. (#12332)

  • Development fixes: (#12338)

    • Barrel file import optimization in remix/assets no longer downloads unused modules in nested import graphs.
    • HMR with remix/component-hmr no longer throws a ReferenceError when a component's setup creates a callback that uses a setup variable declared after it.
    • Under t.useFakeTimers() in remix/test, clearTimeout() and clearInterval() cancel real timers created before fake timers were enabled, timer callbacks receive extra arguments, timer handles in Node support unref() and refresh(), and test and hook timeouts no longer stall.
  • Fix remix/headers Accept, Accept-Encoding and Accept-Language weights when several header entries match a value. getWeight(), accepts() and getPreferred() now prefer an exact entry, then the most specific matching range, as RFC 9110 requires. Previously the highest-weighted match won, so Accept-Encoding: gzip;q=0, * reported gzip as acceptable and Accept-Language: en;q=0, en-US reported en as acceptable. (#12297)

    Accept-Language ranges now match by full subtag prefix, so zh-Hant-TW no longer matches zh-Hant-CN.

    AcceptEncoding#accepts('identity') now returns false when the header refuses identity with identity;q=0, or with *;q=0 and no identity entry. It still returns true when identity is not mentioned.

  • Vary from remix/headers keeps header names as they were first given, so compression() and cors() no longer rewrite Vary: Cookie to Vary: cookie. Safari only varies its cache on cookies when the name is spelled Cookie, 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 like Vary: *, Accept-Encoding, and CacheControl.from() no longer drops directives whose names aren't lowercase, such as No-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-server now validates the request host for every handler. Hosts with a path, query, fragment, userinfo, whitespace, or control characters, from the host option, a trusted forwarding header, HTTP/2 :authority, or Host, make createRequest() throw and make createRequestListener() respond with 400 Bad Request unless onError returns a response. An invalid trusted X-Forwarded-Host is now rejected instead of falling back to Host. See the @remix-run/node-fetch-server changelog 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-hmr changelog 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 through getSchemaMetadata() from remix/data-schema/experimental. These experimental exports may change or be removed in patch releases. (#12206)

  • context.render() from remix/middleware/render no longer responds with 200 when a component throws while rendering the page shell. The middleware now waits for the first chunk of HTML, so shell errors reject router.fetch() for GET and HEAD requests and the server can respond with a 500. (#12338)

  • Fix remix/response/compress compressResponse() returning 406 Not Acceptable when the client lists only encodings the server does not support, such as Accept-Encoding: gzip with encodings: ['br']. An unlisted identity encoding is acceptable, so the response is now sent uncompressed. Responses are still rejected when the client refuses identity with identity;q=0 or *;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 GET response when a GET route serves a HEAD request. The body is now stripped after middleware runs.
    • Inline { middleware, handler } controller actions type their handler with their own action middleware.
    • RouterContext and MiddlewareContext keep the types of the other middleware when the array contains a conditional entry like ...(isDev ? [logger()] : []).

    See the @remix-run/fetch-router changelog for details.

  • Bumped @remix-run/* dependencies:

5 days ago
remix

test v1.2.0

Minor Changes

  • t.useFakeTimers() now fakes Date, performance.now(), setImmediate()/clearImmediate(), and AbortSignal.timeout() along with the timer functions, so wall-clock code such as expiry checks and timestamps can be tested without injecting a clock. While fake timers are active, Date.now(), new Date(), and performance.now() read the fake clock and move forward only with advance() or advanceAsync(). new Date(value), Date.parse(), Date.UTC(), and instanceof Date keep working. Immediates fire on the next advance(), and AbortSignal.timeout(ms) signals abort with a TimeoutError once the fake clock reaches ms. (#12203)

    Like Node's mock timers, the fake Date starts at the Unix epoch (0) and performance.now() starts at 0. Tests that used fake timers while reading the real Date, or while relying on real immediates or AbortSignal.timeout(), now see fake time instead. Pass the new now option to start at a specific time:

    let timers = t.useFakeTimers({ now: new Date('2030-01-01T00:00:00Z') })
  • Added data-property mocking with mock.property() and t.mock.property(), including read/write records, one-access value overrides, and descriptor restoration. Added getter and setter spies through mock.getter(), mock.setter(), and the fourth mock.method() argument. Exported MockTracker as the shared type for standalone and test-context mocks. (#12225)

    Test-context accessor and property mocks restore in reverse installation order after cleanup callbacks, even when a test or cleanup callback fails. Method mocks layered over getter spies preserve the accessor's backing value. Method, accessor, and property mocks can be created while Array.isArray is mocked, with array argument checks preserved.

  • Added public TestFn and TestMeta types for reusable test callbacks and metadata, with linked API documentation for the test body and its options. (#12226)

  • Add new t.waitFor(condition, { interval, timeout }) API to retry assertions until they pass. Polling stops when the test ends. See Polling Assertions for usage. (#12224)

Patch Changes

  • Fix several gaps in t.useFakeTimers(): (#12203)

    • clearTimeout() and clearInterval() now cancel real timers created before fake timers were enabled. Previously the fakes ignored those timers, so a test with a timeout option that enabled fake timers left its real timeout timer running after it finished, which later aborted the test's signal and kept the process alive.
    • setTimeout() and setInterval() now pass extra arguments to the callback.
    • In Node, fake timers return handles with ref(), unref(), hasRef(), and refresh(), so code that calls .unref() on a timer no longer throws. Clearing an expired timeout's handle prevents refresh() from reactivating it.
    • Calling t.useFakeTimers() again restores the previous clock before starting a new one, so cleanup restores the original Date. Repeated restore() calls have no effect.
    • Restore fake timers synchronously on abort and before user cleanup callbacks. Finished or aborted contexts cannot enable another clock, and runner deadlines keep using real timers.
    • Reject overlapping clocks, roll back failed installations, and restore the original property descriptors without reinstalling fakes beneath spies. Restoration attempts every property, reports failures, and permits retrying failed properties.
    • Keep fake timer IDs unique across clocks so clearing a stale numeric handle cannot cancel a later test's timer.
    • Fake AbortSignal.timeout(ms) validates its argument synchronously using Node's numeric integer range of 0 through 4294967295 in every runtime.
  • Fix test and lifecycle hook timeouts stalling under fake timers and prevent late timeouts from aborting completed test signals. (#12224)

5 days ago
remix

session-middleware v1.0.3

Patch Changes

5 days ago
remix

compression-middleware v1.0.3

Patch Changes

5 days ago
remix

spa v1.0.3

Patch Changes

5 days ago
remix

static-middleware v1.0.3

Patch Changes