Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@remix-run/server-runtime

Package Overview
Dependencies
Maintainers
0
Versions
1026
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@remix-run/server-runtime - npm Package Versions

1
103

0.0.0-nightly-cd403b516-20240809

Diff

mjackson
published 2.11.1 •

Changelog

Source

v2.11.1

Date: 2024-08-05

Patch Changes

  • @remix-run/react - Revert #9695, stop infinite reload (a7cffe57)

Changes by Package

Full Changelog: v2.11.0...v2.11.1

mjackson
published 2.11.1-pre.0 •

mjackson
published 0.0.0-nightly-907bcdbe9-20240802 •

mjackson
published 2.11.0 •

Changelog

Source

v2.11.0

Date: 2024-08-01

What's Changed

Renamed unstable_fogOfWar future flag to unstable_lazyRouteDiscovery (unstable)

We found that the future.unstable_fogOfWar flag name could be a bit confusing without the proper context (notably, the blog post), so we've renamed the flag to future.unstable_lazyRouteDiscovery for clarity. If you had opted into this feature already, please update the name of the flag in your vite.config.ts file (or remix.config.js).

Removed response stub in Single Fetch (unstable)

The original Single Fetch approach was based on an assumption that an eventual middleware implementation would require something like the ResponseStub API so users could mutate status/headers in middleware before/after handlers as well as during handlers. As part of Single Fetch, we wanted to align how response headers would be merged between document and data requests. Thinking response was the future API, we aligned document requests to use the response stub that data requests were using, and we stopped using the headers() function.

However, the realization/alignment between Michael and Ryan on the recent roadmap planning made us realize that the original assumption was incorrect. middleware won't need a response stub - as users can just mutate the Response they get from await next() directly.

Removing that assumption, and still wanting to align how headers get merged between document and data requests, it makes more sense to stick with the current headers() API and align Single Fetch data requests to use that existing API. This was we don't need to introduce any new header-related APIs which will make the adoption of Single Fetch much easier.

With this change:

  • The headers() function will let you control header merging for both document and data requests
  • In most cases, if you were returning json()/defer() without setting a custom status or headers, you can just remove those utility functions and return the raw data
    • return json({ data: "whatever" });
    • return { data: "whatever" };
  • If you were returning a custom status or headers via json/defer:
    • We've added a new API-compatible unstable_data utility that will let you send back status/headers alongside your raw data without having to encode it into a Response
  • We will be removing both json and defer in the next major version, but both should still work in Single Fetch in v2 to allow for incremental adoption of the new behavior

⚠️ If you've already adopted Single Fetch in it's unstable state and converted to response stub, you'll need to move those changes back to leveraging the headers() API.

Minor Changes

  • @remix-run/dev - Fog of War: Rename future.unstable_fogOfWar to future.unstable_lazyRouteDiscovery for clarity (#9763)
  • @remix-run/server-runtime - Add a new replace(url, init?) alternative to redirect(url, init?) that performs a history.replaceState instead of a history.pushState on client-side navigation redirects (#9764)
  • @remix-run/server-runtime - Single Fetch: Add a new unstable_data() API as a replacement for json/defer when custom status/headers are needed (#9769)
  • @remix-run/server-runtime - Single Fetch: Remove responseStub in favor of headers (#9769)

Patch Changes

  • @remix-run/dev - Handle absolute Vite base URLs (#9700)
  • @remix-run/react - Change initial hydration route mismatch from a URL check to a matches check to be resistant to URL inconsistencies (#9695)
  • @remix-run/react - Single Fetch: Ensure calls don't include any trailing slash from the pathname (i.e., /path/.data) (#9792)
  • @remix-run/react - Single Fetch: Add undefined to the useRouteLoaderData type override (#9796)

Updated Dependencies

Changes by Package

Full Changelog: v2.10.3...v2.11.0

mjackson
published 2.11.0-pre.2 •

mjackson
published 2.11.0-pre.1 •

mjackson
published 0.0.0-nightly-c00e3652a-20240731 •

mjackson
published 2.11.0-pre.0 •

mjackson
published 0.0.0-nightly-5fb59ccb4-20240730 •

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc