Skip to content

Commit

Permalink
Merge branch 'main' into missing-versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthurmtro authored Feb 4, 2025
2 parents 3fe0439 + 65326e3 commit 3e0cb60
Show file tree
Hide file tree
Showing 56 changed files with 588 additions and 165 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ tsconfig.tsbuildinfo
/fixtures/my-remix-app
/fixtures/deno-app
/integration/playwright-report
/test-results
/integration/test-results
/uploads

.eslintcache
Expand Down
131 changes: 75 additions & 56 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,175 +13,178 @@ We manage release notes in this file instead of the paginated Github Releases Pa
<summary>Table of Contents</summary>

- [Remix Releases](#remix-releases)
- [v2.15.2](#v2152)
- [v2.15.3](#v2153)
- [Patch Changes](#patch-changes)
- [Updated Dependencies](#updated-dependencies)
- [v2.15.1](#v2151)
- [v2.15.2](#v2152)
- [Patch Changes](#patch-changes-1)
- [v2.15.0](#v2150)
- [Updated Dependencies](#updated-dependencies-1)
- [v2.15.1](#v2151)
- [Patch Changes](#patch-changes-2)
- [v2.15.0](#v2150)
- [Patch Changes](#patch-changes-3)
- [v2.14.0](#v2140)
- [Minor Changes](#minor-changes)
- [Patch Changes](#patch-changes-3)
- [Updated Dependencies](#updated-dependencies-1)
- [Patch Changes](#patch-changes-4)
- [Updated Dependencies](#updated-dependencies-2)
- [Changes by Package](#changes-by-package)
- [v2.13.1](#v2131)
- [Patch Changes](#patch-changes-4)
- [Patch Changes](#patch-changes-5)
- [v2.13.0](#v2130)
- [What's Changed](#whats-changed)
- [Stabilized APIs](#stabilized-apis)
- [Minor Changes](#minor-changes-1)
- [Patch Changes](#patch-changes-5)
- [Updated Dependencies](#updated-dependencies-2)
- [Patch Changes](#patch-changes-6)
- [Updated Dependencies](#updated-dependencies-3)
- [Changes by Package](#changes-by-package-1)
- [v2.12.1](#v2121)
- [Patch Changes](#patch-changes-6)
- [Patch Changes](#patch-changes-7)
- [Changes by Package](#changes-by-package-2)
- [v2.12.0](#v2120)
- [What's Changed](#whats-changed-1)
- [Future Flag for Automatic Dependency Optimization (unstable)](#future-flag-for-automatic-dependency-optimization-unstable)
- [Improved Single Fetch Type Safety (unstable)](#improved-single-fetch-type-safety-unstable)
- [Updates to Single Fetch Revalidation Behavior (unstable)](#updates-to-single-fetch-revalidation-behavior-unstable)
- [Minor Changes](#minor-changes-2)
- [Patch Changes](#patch-changes-7)
- [Updated Dependencies](#updated-dependencies-3)
- [Changes by Package](#changes-by-package-3)
- [v2.11.2](#v2112)
- [Patch Changes](#patch-changes-8)
- [Updated Dependencies](#updated-dependencies-4)
- [Changes by Package](#changes-by-package-3)
- [v2.11.2](#v2112)
- [Patch Changes](#patch-changes-9)
- [Updated Dependencies](#updated-dependencies-5)
- [Changes by Package](#changes-by-package-4)
- [v2.11.1](#v2111)
- [Patch Changes](#patch-changes-9)
- [Patch Changes](#patch-changes-10)
- [Changes by Package](#changes-by-package-5)
- [v2.11.0](#v2110)
- [What's Changed](#whats-changed-2)
- [Renamed `unstable_fogOfWar` future flag to `unstable_lazyRouteDiscovery` (unstable)](#renamed-unstable_fogofwar-future-flag-to-unstable_lazyroutediscovery-unstable)
- [Removed `response` stub in Single Fetch (unstable)](#removed-response-stub-in-single-fetch-unstable)
- [Minor Changes](#minor-changes-3)
- [Patch Changes](#patch-changes-10)
- [Updated Dependencies](#updated-dependencies-5)
- [Changes by Package](#changes-by-package-6)
- [v2.10.3](#v2103)
- [Patch Changes](#patch-changes-11)
- [Updated Dependencies](#updated-dependencies-6)
- [Changes by Package](#changes-by-package-6)
- [v2.10.3](#v2103)
- [Patch Changes](#patch-changes-12)
- [Updated Dependencies](#updated-dependencies-7)
- [Changes by Package](#changes-by-package-7)
- [v2.10.2](#v2102)
- [Patch Changes](#patch-changes-12)
- [Patch Changes](#patch-changes-13)
- [Changes by Package](#changes-by-package-8)
- [v2.10.1](#v2101)
- [Patch Changes](#patch-changes-13)
- [Updated Dependencies](#updated-dependencies-7)
- [Patch Changes](#patch-changes-14)
- [Updated Dependencies](#updated-dependencies-8)
- [Changes by Package](#changes-by-package-9)
- [v2.10.0](#v2100)
- [What's Changed](#whats-changed-3)
- [Lazy Route Discovery (a.k.a. "Fog of War")](#lazy-route-discovery-aka-fog-of-war)
- [Minor Changes](#minor-changes-4)
- [Patch Changes](#patch-changes-14)
- [Updated Dependencies](#updated-dependencies-8)
- [Patch Changes](#patch-changes-15)
- [Updated Dependencies](#updated-dependencies-9)
- [Changes by Package](#changes-by-package-10)
- [v2.9.2](#v292)
- [What's Changed](#whats-changed-4)
- [Updated Type-Safety for Single Fetch](#updated-type-safety-for-single-fetch)
- [Patch Changes](#patch-changes-15)
- [Updated Dependencies](#updated-dependencies-9)
- [Patch Changes](#patch-changes-16)
- [Updated Dependencies](#updated-dependencies-10)
- [Changes by Package](#changes-by-package-11)
- [v2.9.1](#v291)
- [Patch Changes](#patch-changes-16)
- [Patch Changes](#patch-changes-17)
- [Changes by Package](#changes-by-package-12)
- [v2.9.0](#v290)
- [What's Changed](#whats-changed-5)
- [Single Fetch (unstable)](#single-fetch-unstable)
- [Undici](#undici)
- [Minor Changes](#minor-changes-5)
- [Patch Changes](#patch-changes-17)
- [Updated Dependencies](#updated-dependencies-10)
- [Changes by Package](#changes-by-package-13)
- [v2.8.1](#v281)
- [Patch Changes](#patch-changes-18)
- [Updated Dependencies](#updated-dependencies-11)
- [Changes by Package](#changes-by-package-13)
- [v2.8.1](#v281)
- [Patch Changes](#patch-changes-19)
- [Updated Dependencies](#updated-dependencies-12)
- [Changes by Package](#changes-by-package-14)
- [v2.8.0](#v280)
- [Minor Changes](#minor-changes-6)
- [Patch Changes](#patch-changes-19)
- [Updated Dependencies](#updated-dependencies-12)
- [Patch Changes](#patch-changes-20)
- [Updated Dependencies](#updated-dependencies-13)
- [Changes by Package](#changes-by-package-15)
- [2.7.2](#272)
- [Patch Changes](#patch-changes-20)
- [2.7.1](#271)
- [Patch Changes](#patch-changes-21)
- [2.7.1](#271)
- [Patch Changes](#patch-changes-22)
- [v2.7.0](#v270)
- [What's Changed](#whats-changed-6)
- [Stabilized Vite Plugin](#stabilized-vite-plugin)
- [New `Layout` Export](#new-layout-export)
- [Basename support](#basename-support)
- [Cloudflare Proxy as a Vite Plugin](#cloudflare-proxy-as-a-vite-plugin)
- [Minor Changes](#minor-changes-7)
- [Patch Changes](#patch-changes-22)
- [Updated Dependencies](#updated-dependencies-13)
- [Patch Changes](#patch-changes-23)
- [Updated Dependencies](#updated-dependencies-14)
- [Changes by Package](#changes-by-package-16)
- [v2.6.0](#v260)
- [What's Changed](#whats-changed-7)
- [Unstable Vite Plugin updates](#unstable-vite-plugin-updates)
- [Minor Changes](#minor-changes-8)
- [Patch Changes](#patch-changes-23)
- [Updated Dependencies](#updated-dependencies-14)
- [Changes by Package](#changes-by-package-17)
- [v2.5.1](#v251)
- [Patch Changes](#patch-changes-24)
- [Updated Dependencies](#updated-dependencies-15)
- [Changes by Package](#changes-by-package-17)
- [v2.5.1](#v251)
- [Patch Changes](#patch-changes-25)
- [Updated Dependencies](#updated-dependencies-16)
- [Changes by Package](#changes-by-package-18)
- [v2.5.0](#v250)
- [What's Changed](#whats-changed-8)
- [SPA Mode (unstable)](#spa-mode-unstable)
- [Server Bundles (unstable)](#server-bundles-unstable)
- [Minor Changes](#minor-changes-9)
- [Patch Changes](#patch-changes-25)
- [Updated Dependencies](#updated-dependencies-16)
- [Changes by Package](#changes-by-package-19)
- [v2.4.1](#v241)
- [Patch Changes](#patch-changes-26)
- [Updated Dependencies](#updated-dependencies-17)
- [Changes by Package](#changes-by-package-19)
- [v2.4.1](#v241)
- [Patch Changes](#patch-changes-27)
- [Updated Dependencies](#updated-dependencies-18)
- [Changes by Package](#changes-by-package-20)
- [v2.4.0](#v240)
- [What's Changed](#whats-changed-9)
- [Client Data](#client-data)
- [`future.v3_relativeSplatPath`](#futurev3_relativesplatpath)
- [Vite Updates (Unstable)](#vite-updates-unstable)
- [Minor Changes](#minor-changes-10)
- [Patch Changes](#patch-changes-27)
- [Updated Dependencies](#updated-dependencies-18)
- [Changes by Package](#changes-by-package-21)
- [v2.3.1](#v231)
- [Patch Changes](#patch-changes-28)
- [Updated Dependencies](#updated-dependencies-19)
- [Changes by Package](#changes-by-package-21)
- [v2.3.1](#v231)
- [Patch Changes](#patch-changes-29)
- [Updated Dependencies](#updated-dependencies-20)
- [Changes by Package](#changes-by-package-22)
- [v2.3.0](#v230)
- [What's Changed](#whats-changed-10)
- [Stabilized `useBlocker`](#stabilized-useblocker)
- [`unstable_flushSync` API](#unstable_flushsync-api)
- [Minor Changes](#minor-changes-11)
- [Patch Changes](#patch-changes-29)
- [Updated Dependencies](#updated-dependencies-20)
- [Patch Changes](#patch-changes-30)
- [Updated Dependencies](#updated-dependencies-21)
- [Changes by Package](#changes-by-package-23)
- [v2.2.0](#v220)
- [What's Changed](#whats-changed-11)
- [Vite!](#vite)
- [New Fetcher APIs](#new-fetcher-apis)
- [Persistence Future Flag](#persistence-future-flag)
- [Minor Changes](#minor-changes-12)
- [Patch Changes](#patch-changes-30)
- [Updated Dependencies](#updated-dependencies-21)
- [Patch Changes](#patch-changes-31)
- [Updated Dependencies](#updated-dependencies-22)
- [Changes by Package](#changes-by-package-24)
- [v2.1.0](#v210)
- [What's Changed](#whats-changed-12)
- [View Transitions](#view-transitions)
- [Stable `createRemixStub`](#stable-createremixstub)
- [Minor Changes](#minor-changes-13)
- [Patch Changes](#patch-changes-31)
- [Updated Dependencies](#updated-dependencies-22)
- [Patch Changes](#patch-changes-32)
- [Updated Dependencies](#updated-dependencies-23)
- [Changes by Package](#changes-by-package-25)
- [v2.0.1](#v201)
- [Patch Changes](#patch-changes-32)
- [Patch Changes](#patch-changes-33)
- [Changes by Package 🔗](#changes-by-package-)
- [v2.0.0](#v200)
- [Breaking Changes](#breaking-changes)
Expand All @@ -193,7 +196,7 @@ We manage release notes in this file instead of the paginated Github Releases Pa
- [Breaking Type Changes](#breaking-type-changes)
- [New Features](#new-features)
- [Other Notable Changes](#other-notable-changes)
- [Updated Dependencies](#updated-dependencies-23)
- [Updated Dependencies](#updated-dependencies-24)
- [Changes by Package](#changes-by-package-26)

</details>
Expand Down Expand Up @@ -245,6 +248,22 @@ Date: YYYY-MM-DD
-->

## v2.15.3

Date: 2025-01-30

### Patch Changes

- `@remix-run/react` - Properly handle interrupted manifest requests in lazy route discovery ([#10447](https://github.com/remix-run/remix/pull/10447))
- `@remix-run/server-runtime` - Avoid duplication of `Set-Cookie` headers if also returned from `headers` ([#10424](https://github.com/remix-run/remix/pull/10424))
- `@remix-run/server-runtime` - Properly handle status codes that cannot have a body in single fetch responses (204, etc.) ([#10410](https://github.com/remix-run/remix/pull/10410))

### Updated Dependencies

- [`[email protected]`](https://github.com/remix-run/react-router/releases/tag/react-router%406.29.0)

**Full Changelog**: [`v2.15.2...v2.15.3`](https://github.com/remix-run/remix/compare/[email protected]@2.15.3)

## v2.15.2

Date: 2024-12-20
Expand Down
2 changes: 2 additions & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,7 @@
- oott123
- orballo
- oscarnewman
- outofgamut
- ovi-ispas
- pacexy
- pandaiolo
Expand Down Expand Up @@ -658,6 +659,7 @@
- TimonVS
- tjefferson08
- tmcw
- Tobbe
- tombiju
- tombohub
- tombyrer
Expand Down
2 changes: 1 addition & 1 deletion docs/discussion/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ Once Remix has served the document to the browser, it "hydrates" the page with t

When the user clicks a link, instead of making a round trip to the server for the entire document and all the assets, Remix simply fetches the data for the next page and updates the UI.

Additionally, when users submit a `<Form>` to update data, instead of doing a normal HTML document request, the browser runtime will make a fetch to the server instead and automatically revalidate all data on the page and updating it with React.
Additionally, when users submit a `<Form>` to update data, instead of doing a normal HTML document request, the browser runtime will make a fetch to the server instead and automatically revalidate all data on the page and update it with React.

This has many performance benefits over making a full-document request:

Expand Down
23 changes: 23 additions & 0 deletions docs/guides/single-fetch.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,29 @@ Single Fetch requires using [`undici`][undici] as your `fetch` polyfill, or usin

With Single Fetch enabled, there will now only be one request made on client-side navigations even when multiple loaders need to run. To handle merging headers for the handlers called, the [`headers`][headers] export will now also apply to `loader`/`action` data requests. In many cases, the logic you already have in there for document requests should be close to sufficient for your new Single Fetch data requests.

```diff
-import { json } from "@remix-run/node";
+import { data } from "@remix-run/node";

// This example assumes you already have a headers function to handle header
// merging for your document requests
export function headers() {
// ...
}

export async function loader({}: LoaderFunctionArgs) {
let tasks = await fetchTasks();
- return json(tasks, {
+ return data(tasks, {
headers: {
"Cache-Control": "public, max-age=604800"
}
});
}
```

⚠️ This is especially important to review for caching behaviors. Prior to Single Fetch, a given loader could choose it's own cache duration and it would apply to the singular HTTP response from that loader. But document requests would call multiple loaders and required an application to implement the `headers` method to intelligently merge headers returned from loaders across multiple routes. With Single fetch, document and data requests now behave the same so your `headers` function needs to return the proper headers/caching behavior for _all_ routes.

**4. Add a `nonce` (if you are using a CSP)**

If you have a [content security policy for scripts][csp] with [nonce-sources][csp-nonce], you will need to add that `nonce` to two places for the streaming Single Fetch implementation:
Expand Down
2 changes: 1 addition & 1 deletion docs/route/headers.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ If we are looking at `/users/123/profile` then three routes are rendering:

If a user is looking at `/users/123/profile` and `users.$userId.profile.tsx` does not export a `headers` function, then Remix will use the return value of `users.$userId.tsx`'s `headers` function. If that file doesn't export one, then it will use the result of the one in `users.tsx`, and so on.

If all three define `headers`, the deepest module wins, in this case `users.$userId.profile.tsx`. However, if your `users.$userId.profile.tsx`'s `loader` threw and bubbled to a boundary in `users.userId.tsx` - then `users.userId.tsx`'s `headers` function would be used as it is the leaf rendered route.
If all three define `headers`, the deepest module wins, in this case `users.$userId.profile.tsx`. However, if your `users.$userId.profile.tsx`'s `loader` threw and bubbled to a boundary in `users.$userId.tsx` - then `users.$userId.tsx`'s `headers` function would be used as it is the leaf rendered route.

We don't want surprise headers in your responses, so it's your job to merge them if you'd like. Remix passes in the `parentHeaders` to your `headers` function. So `users.tsx` headers get passed to `users.$userId.tsx`, and then `users.$userId.tsx`'s `headers` are passed to `users.$userId.profile.tsx`'s `headers`.

Expand Down
8 changes: 7 additions & 1 deletion docs/start/future-flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -454,12 +454,18 @@ export async function loader({}: LoaderFunctionArgs) {
}
```

If you were using the second parameter of `json`/`defer` to set a custom status or headers on your response, you can continue doing so via the new `data` API:
If you were using the second parameter of `json`/`defer` to set a custom status or headers on your response, you can continue doing so via the new `data` API (please note that you will need a `headers` export to apply those headers to Single Fetch data requests):

```diff
-import { json } from "@remix-run/node";
+import { data } from "@remix-run/node";

// This example assumes you already have a headers function to handle header
// merging for your document requests
export function headers() {
// ...
}

export async function loader({}: LoaderFunctionArgs) {
let tasks = await fetchTasks();
- return json(tasks, {
Expand Down
4 changes: 2 additions & 2 deletions docs/start/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ npx remix-serve build/server/index.js

You should be able to open up [http://localhost:3000][http-localhost-3000] and see the "hello world" page.

Aside from the unholy amount of code in `node_modules`, our Remix app is just one file:
Aside from the unholy amount of code in `node_modules`, our Remix app is just three files:

```
├── app/
│ └── root.jsx
── package.json
── package.json
└── vite.config.js
```

Expand Down
Loading

0 comments on commit 3e0cb60

Please sign in to comment.