Skip to content

Commit c92e07b

Browse files
committed
Merge branch 'dev' into markdalgleish/rsc-hmr-hdr
2 parents 8cd58b1 + 658235f commit c92e07b

File tree

75 files changed

+2976
-1064
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+2976
-1064
lines changed

.changeset/cool-pigs-cheer.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-router": patch
3+
---
4+
5+
[UNSTABLE] Ensure resource route errors go through `handleError` w/middleware enabled

.changeset/famous-laws-happen.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-router": patch
3+
---
4+
5+
Prevent _"Did not find corresponding fetcher result"_ console error when navigating during a `fetcher.submit` revalidation

.changeset/giant-ligers-mix.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-router": minor
3+
---
4+
5+
Add `nonce` prop to `Links` & `PrefetchPageLinks`

.changeset/good-months-hope.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-router": patch
3+
---
4+
5+
Switch Lazy Route Discovery manifest URL generation to usea standalone `URLSearchParams` instance instead of `URL.searchParams` to avoid a major performance bottleneck in Chrome

.changeset/grumpy-frogs-greet.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-router": patch
3+
---
4+
5+
[UNSTABLE] Propagate returned Response from server middleware if next wasn't called

.changeset/neat-dolls-join.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-router": patch
3+
---
4+
5+
[UNSTABLE] Allow server middlewares to return `data()` values which will be converted into a `Response`
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-router": patch
3+
---
4+
5+
- [UNSTABLE] When middleware is enabled, make the `context` parameter read-only (via `Readonly<unstable_RouterContextProvider>`) so that TypeScript will not allow you to write arbitrary fields to it in loaders, actions, or middleware.

.changeset/polite-vans-travel.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@react-router/dev": patch
3+
---
4+
5+
Fix rename without mkdir in Vite plugin

.changeset/rare-mice-report.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
"react-router": patch
3+
---
4+
5+
[UNSTABLE] Rename and alter the signature/functionality of the `unstable_respond` API in `staticHandler.query`/`staticHandler.queryRoute`
6+
7+
- The API has been renamed to `unstable_generateMiddlewareResponse` for clarity
8+
- The main functional change is that instead of running the loaders/actions before calling `unstable_respond` and handing you the result, we now pass a `query`/`queryRoute` function as a parameter and you execute the loaders/actions inside your callback, giving you full access to pre-processing and error handling
9+
- The `query` version of the API now has a signature of `(query: (r: Request) => Promise<StaticHandlerContext | Response>) => Promise<Response>`
10+
- The `queryRoute` version of the API now has a signature of `(queryRoute: (r: Request) => Promise<Response>) => Promise<Response>`
11+
- This allows for more advanced usages such as running logic before/after calling `query` and direct error handling of errors thrown from query
12+
- ⚠️ This is a breaking change if you've adopted the `staticHandler` `unstable_respond` API
13+
14+
```tsx
15+
let response = await staticHandler.query(request, {
16+
requestContext: new unstable_RouterContextProvider(),
17+
async unstable_generateMiddlewareResponse(query) {
18+
try {
19+
// At this point we've run middleware top-down so we need to call the
20+
// handlers and generate the Response to bubble back up the middleware
21+
let result = await query(request);
22+
if (isResponse(result)) {
23+
return result; // Redirects, etc.
24+
}
25+
return await generateHtmlResponse(result);
26+
} catch (error: unknown) {
27+
return generateErrorResponse(error);
28+
}
29+
},
30+
});
31+
```

.changeset/rare-mice-report2.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-router": patch
3+
---
4+
5+
[UNSTABLE] Convert internal middleware implementations to use the new `unstable_generateMiddlewareResponse` API

0 commit comments

Comments
 (0)