Welcome to Remix!
Remix is a web framework that helps you build better websites with React.
To get started, open a new shell and run:
npx create-remix@latest
Then follow the prompts you see in your terminal.
For more information about Remix, visit remix.run!
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