|
1 | 1 | # Changelog |
2 | 2 |
|
| 3 | +## Unreleased |
| 4 | + |
| 5 | +### Changed: `dispatch()` answers as production in a few edge cases |
| 6 | + |
| 7 | +**Before.** `dispatch()` from `@rangojs/router/testing` kept its own copy of |
| 8 | +the handler's steps around a response route: the global middleware passes, |
| 9 | +the response route's timeout, the redirect interception and the response's |
| 10 | +finalization. In a few cases its answer differed from the one `router.fetch` |
| 11 | +sends. |
| 12 | + |
| 13 | +**After.** It runs the production handler's request stages, so these cases |
| 14 | +answer as production does: |
| 15 | + |
| 16 | +- An action request (`?_rsc_action`, not a partial) whose final pass ran no |
| 17 | + global middleware, answered with a 3xx (a trailing-slash redirect, or a |
| 18 | + redirect from a response route or its route middleware): the 3xx, through |
| 19 | + the open-redirect guard, instead of a `204` + `X-RSC-Redirect`. |
| 20 | +- A partial request (`?_rsc_partial`) to a trailing-slash path: a global |
| 21 | + middleware that reads the response after `next()` sees the `204` + |
| 22 | + `X-RSC-Redirect` instead of a `308`. The response is unchanged. |
| 23 | +- A response route's `renderStartMs` timeout with no global middleware: |
| 24 | + `onResponse` callbacks the route registered before the deadline no longer |
| 25 | + apply to the 504 or `onTimeout` response. |
| 26 | +- A content-negotiated response route whose route middleware short-circuits: |
| 27 | + the response carries `Vary: Accept`. |
| 28 | +- A response route for a type with no MIME (image, stream, any) whose handler |
| 29 | + returns a value that is not a `Response`: the 500 carries production's |
| 30 | + message, `Response route handler for "…" must return a Response object`. |
| 31 | +- A throwing `onTimeout` logs `[RSC] onTimeout callback error:` instead of |
| 32 | + `[dispatch] onTimeout callback error:`. |
| 33 | +- A response-route timeout on a rewritten pass: `onError`, `onTimeout` and |
| 34 | + the `request.timeout` event carry the rewrite target's request and URL. |
| 35 | + Without a request-id header, that event's `requestId` then differs from the |
| 36 | + one on `dispatch`'s own `request.start` and `request.end`. |
| 37 | +- A stream-idle timeout's `onError` call and `request.timeout` event carry |
| 38 | + `routeKey`. |
| 39 | +- The same timeout, stream-idle or rewrite error reaches `onError` once per |
| 40 | + request. |
| 41 | + |
| 42 | +No change in your code. A test that pinned one of the old answers now gets |
| 43 | +production's. |
| 44 | + |
3 | 45 | ## 0.27.0 (2026-10-23) |
4 | 46 |
|
5 | 47 | ### Breaking: Back or Forward onto a page a server action made stale re-runs its loaders and route, as the action's own revalidation does, and every stale request renders live ([#1231](https://github.com/rangojs/rango/pull/1231)) |
|
0 commit comments