Skip to content

Commit 3441787

Browse files
committed
Merge branch 'release-next'
2 parents fde17e9 + c51985e commit 3441787

File tree

118 files changed

+2027
-2722
lines changed

Some content is hidden

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

118 files changed

+2027
-2722
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ node_modules/
2828
.wireit
2929
.eslintcache
3030
.tmp
31+
tsup.config.bundled_*.mjs
3132
/.env
3233
/NOTES.md
3334

CHANGELOG.md

Lines changed: 133 additions & 122 deletions
Large diffs are not rendered by default.

contributors.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@
149149
- johnpangalos
150150
- jonkoops
151151
- jrakotoharisoa
152+
- jrestall
152153
- juanpprieto
153154
- jungwoo3490
154155
- kachun333

docs/explanation/special-files.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,32 @@ The `default` export of this module is a function that lets you create the respo
229229

230230
This module should render the markup for the current page using a `<ServerRouter>` element with the `context` and `url` for the current request. This markup will (optionally) be re-hydrated once JavaScript loads in the browser using the [client entry module][client-entry].
231231

232+
### `streamTimeout`
233+
234+
If you are [streaming] responses, you can export an optional `streamTimeout` value (in milliseconds) that will control the amount of time the server will wait for streamed promises to settle before rejecting outstanding promises them and closing the stream.
235+
236+
It's recommended to decouple this value from the timeout in which you abort the React renderer. You should always set the React rendering timeout to a higher value so it has time to stream down the underlying rejections from your `streamTimeout`.
237+
238+
```tsx lines=[1-2,13-15]
239+
// Reject all pending promises from handler functions after 10 seconds
240+
export const streamTimeout = 10000;
241+
242+
export default function handleRequest(...) {
243+
return new Promise((resolve, reject) => {
244+
// ...
245+
246+
const { pipe, abort } = renderToPipeableStream(
247+
<ServerRouter context={routerContext} url={request.url} />,
248+
{ /* ... */ }
249+
);
250+
251+
// Abort the streaming render pass after 11 seconds soto allow the rejected
252+
// boundaries to be flushed
253+
setTimeout(abort, streamTimeout + 1000);
254+
});
255+
}
256+
```
257+
232258
### `handleDataRequest`
233259

234260
You can export an optional `handleDataRequest` function that will allow you to modify the response of a data request. These are the requests that do not render HTML, but rather return the loader and action data to the browser once client-side hydration has occurred.
@@ -328,4 +354,5 @@ console.log(supportsVibrationAPI);
328354
[rendertopipeablestream]: https://react.dev/reference/react-dom/server/renderToPipeableStream
329355
[rendertoreadablestream]: https://react.dev/reference/react-dom/server/renderToReadableStream
330356
[node-streaming-entry-server]: https://github.com/remix-run/react-router/blob/dev/packages/react-router-dev/config/defaults/entry.server.node.tsx
357+
[streaming]: ../how-to/suspense
331358
[use_effect]: https://react.dev/reference/react/useEffect

docs/start/framework/installation.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,16 @@ You can now open your browser to `http://localhost:5173`
3333

3434
You can [view the template on GitHub][default-template] to see how to manually set up your project.
3535

36-
To get started with a template that deploys to your preferred host, check out [all of our templates](https://github.com/remix-run/react-router-templates).
36+
We also have a number of [ready to deploy templates][react-router-templates] available for you to get started with:
37+
38+
```shellscript nonumber
39+
npx create-react-router@latest --template remix-run/react-router-templates/<template-name>
40+
```
3741

3842
---
3943

4044
Next: [Routing](./routing)
4145

4246
[manual_usage]: ../how-to/manual-usage
4347
[default-template]: https://github.com/remix-run/react-router-templates/tree/main/default
48+
[react-router-templates]: https://github.com/remix-run/react-router-templates

examples/auth-router-provider/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88
"esModuleInterop": false,
99
"allowSyntheticDefaultImports": true,
1010
"strict": true,
11-
"forceConsistentCasingInFileNames": true,
1211
"module": "ESNext",
1312
"moduleResolution": "Node",
1413
"resolveJsonModule": true,
15-
"isolatedModules": true,
14+
"verbatimModuleSyntax": true,
1615
"noEmit": true,
1716
"jsx": "react-jsx",
1817
"importsNotUsedAsValues": "error"

examples/auth/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88
"esModuleInterop": false,
99
"allowSyntheticDefaultImports": true,
1010
"strict": true,
11-
"forceConsistentCasingInFileNames": true,
1211
"module": "ESNext",
1312
"moduleResolution": "Node",
1413
"resolveJsonModule": true,
15-
"isolatedModules": true,
14+
"verbatimModuleSyntax": true,
1615
"noEmit": true,
1716
"jsx": "react-jsx",
1817
"importsNotUsedAsValues": "error"

examples/basic-data-router/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88
"esModuleInterop": false,
99
"allowSyntheticDefaultImports": true,
1010
"strict": true,
11-
"forceConsistentCasingInFileNames": true,
1211
"module": "ESNext",
1312
"moduleResolution": "Node",
1413
"resolveJsonModule": true,
15-
"isolatedModules": true,
14+
"verbatimModuleSyntax": true,
1615
"noEmit": true,
1716
"jsx": "react-jsx",
1817
"importsNotUsedAsValues": "error"

examples/basic/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88
"esModuleInterop": false,
99
"allowSyntheticDefaultImports": true,
1010
"strict": true,
11-
"forceConsistentCasingInFileNames": true,
1211
"module": "ESNext",
1312
"moduleResolution": "Node",
1413
"resolveJsonModule": true,
15-
"isolatedModules": true,
14+
"verbatimModuleSyntax": true,
1615
"noEmit": true,
1716
"jsx": "react-jsx",
1817
"importsNotUsedAsValues": "error"

examples/custom-filter-link/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88
"esModuleInterop": false,
99
"allowSyntheticDefaultImports": true,
1010
"strict": true,
11-
"forceConsistentCasingInFileNames": true,
1211
"module": "ESNext",
1312
"moduleResolution": "Node",
1413
"resolveJsonModule": true,
15-
"isolatedModules": true,
14+
"verbatimModuleSyntax": true,
1615
"noEmit": true,
1716
"jsx": "react-jsx",
1817
"importsNotUsedAsValues": "error"

0 commit comments

Comments
 (0)