Socket
Socket
Sign inDemoInstall

@remix-run/server-runtime

Package Overview
Dependencies
8
Maintainers
2
Versions
932
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install
Previous1345
94Next

0.0.0-nightly-45c755219-20240509

Diff

mjackson
published 0.0.0-nightly-feb25eb42-20240508 •

mjackson
published 0.0.0-nightly-142f47be5-20240507 •

mjackson
published 0.0.0-nightly-bd6a30601-20240503 •

mjackson
published 0.0.0-nightly-612f33e63-20240502 •

mjackson
published 2.9.1 •

Changelog

Source

v2.9.1

Date: 2024-04-24

Patch Changes

  • @remix-run/dev - Fix issue where consumers who had added Remix packages to Vite's ssr.noExternal option were being overridden by the Remix Vite plugin adding Remix packages to Vite's ssr.external option (#9301)
  • @remix-run/react - Ignore future/*.d.ts files from TS build (#9299)

Changes by Package

Full Changelog: v2.9.0...v2.9.1

mjackson
published 2.9.1-pre.1 •

mjackson
published 2.9.1-pre.0 •

mjackson
published 2.9.0 •

Changelog

Source

v2.9.0

Date: 2024-04-23

What's Changed

Single Fetch (unstable)

2.9.0 introduces a future.unstable_singleFetch flag to enable to Single Fetch behavior (RFC) in your Remix application. Please refer to the docs for the full detail but the high-level changes to be aware of include:

  • Naked objects returned from loader/action functions are no longer automatically serialized to JSON responses
    • Instead, they'll be streamed as-is via turbo-stream which allows direct serialization of more complex types such as Promise, Date, Map instances, and more
    • You will need to modify your tsconfig.json's compilerOptions.types array to infer types properly when using Single Fetch
  • The headers export is no longer used when Single Fetch is enabled in favor of a new response stub passed to your loader/action functions
  • The json/defer/redirect utilities are deprecated when using Single Fetch (but still work mostly the same)
  • Actions no longer automatically revalidate on 4xx/5xx responses - you can return a 2xx to opt-into revalidation or use shouldRevalidate

[!IMPORTANT] Single Fetch requires using undici as your fetch polyfill, or using the built-in fetch on Node 20+, because it relies on APIs available there but not in the @remix-run/web-fetch polyfill. Please refer to the Undici section below for more details.

  • If you are managing your own server and calling installGlobals(), you will need to call installGlobals({ nativeFetch: true }) to avoid runtime errors when using Single Fetch
  • If you are using remix-serve, it will use undici automatically if Single Fetch is enabled
Undici

Remix 2.9.0 adds a new installGlobals({ nativeFetch: true }) flag to opt into using undici for the Web Fetch polyfills instead of the @remix-run/web-* packages. This change has a few primary benefits:

  • It will allow us to stop maintaining our own web-std-io fork in future versions of Remix
  • It should bring us more in-line with spec compliance
    • ⚠️ It is possible that some non-spec-compliant bugs in our fork will be "fixed" by moving to undici, so beware of "breaking bug fixes" and keep an eye on any advanced fetch API interactions you're performing in your app
    • ⚠️ In some cases, undici may have different behavior by design -- most notably, undici's garbage collection behavior differs and you are required to consume all fetch response bodies to avoid a memory leak in your app
  • Because undici is the fetch implementation used by node internally, it should better prepare Remix apps to more smoothly drop the polyfill to use the built-in Node.js APIs on node 20+

Minor Changes

  • New future.unstable_singleFetch flag (#8773, #9073, #9084, #9272)
  • @remix-run/node - Add a new installGlobals({ nativeFetch: true }) flag to opt-into using undici as the fetch polyfill instead of @remix-run/web-* (#9106, #9111, #9198)
  • @remix-run/server-runtime - Add ResponseStub header interface and deprecate the headers export when Single Fetch is enabled (#9142)

Patch Changes

  • create-remix - Allow . in repo name when using --template flag (#9026)
  • @remix-run/dev - Improve getDependenciesToBundle resolution in monorepos (#8848)
  • @remix-run/dev - Fix SPA mode when Single Fetch is enabled by using streaming entry.server (#9063)
  • @remix-run/dev - Vite: added sourcemap support for transformed routes (#8970)
  • @remix-run/dev - Update links printed to the console by the Remix CLI/Dev Server to point to updated docs locations (#9176)
  • @remix-run/server-runtime - Handle redirects created by handleDataRequest (#9104)

Updated Dependencies

Changes by Package

Full Changelog: v2.8.1...v2.9.0

mjackson
published 2.9.0-pre.8 •

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc