You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove the leftover/unused `abortDelay` prop from `ServerRouter` and update the default `entry.server.tsx` to use the new `streamTimeout` value for Single Fetch
6
+
7
+
- The `abortDelay` functionality was removed in v7 as it was coupled to the `defer` implementation from Remix v2, but this removal of this prop was missed
8
+
- If you were still using this prop in your `entry.server` file, it's likely your app is not aborting streams as you would expect and you will need to adopt the new [`streamTimeout`](https://reactrouter.com/explanation/special-files#streamtimeout) value introduced with Single Fetch
Copy file name to clipboardExpand all lines: docs/explanation/special-files.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -229,6 +229,32 @@ The `default` export of this module is a function that lets you create the respo
229
229
230
230
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].
231
231
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
// 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
+
232
258
### `handleDataRequest`
233
259
234
260
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.
@@ -289,3 +315,4 @@ Note that this does not handle thrown `Response` instances from your `loader`/`a
0 commit comments