rsnext/packages/next/server
Meno Abels 27fe5c8c28
Add response stream errorhandling in edge-function-runtime (#41102)
The behaviour of edge-function-runtime in the case of an error was not
identical to the edge-runtime.
If a type other than "Uint8Array" is written to the Response stream a
unhandledreject is raised and logged.
The current implementations(nodejs) accepts also Buffers and Strings
which causes that a Application
Developer things our stream implementation is broken if it is executed
as worker.
We introduced a helper function to consume the response stream and write
the "Uint8Array" stream chunks
to the server implementation. Due to the complication that the error
side effect is emitted via the unhandledrejection
handler it is almost impossible to test --- jest does not allow testing
of the unhandlerejections.
We tested extendsiveliy the helper in the edge-runtime so that this PR
integrates just the consuming function.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-10-06 11:56:13 -07:00
..
api-utils Improve types for <Image /> and responseLimit (#40863) 2022-09-26 22:41:25 -07:00
base-http Improve types for <Image /> and responseLimit (#40863) 2022-09-26 22:41:25 -07:00
dev Add response stream errorhandling in edge-function-runtime (#41102) 2022-10-06 11:56:13 -07:00
lib Add handling for static generation in app (#40561) 2022-09-19 18:05:28 +00:00
response-cache Eliminate path polyfill and incremental-cache from base server (#39548) 2022-08-12 15:25:47 +00:00
send-payload Change Flight response content type to application/octet-stream (#40665) 2022-09-18 20:49:05 +00:00
web Update edge runtime to 1.1.0-beta.37 (#41211) 2022-10-06 11:45:16 +00:00
accept-header.ts Enable @typescript-eslint/no-use-before-define for functions (#39602) 2022-08-15 10:29:51 -04:00
app-render.tsx Fix prefetch for new router (#41119) 2022-10-05 13:45:46 +00:00
base-server.ts Refactor app dir related flags (#41166) 2022-10-04 22:16:44 +00:00
body-streams.ts Add response stream errorhandling in edge-function-runtime (#41102) 2022-10-06 11:56:13 -07:00
config-schema.ts Disable built-in css-in-js transform on server layer (#41040) 2022-10-05 18:28:55 +02:00
config-shared.ts Apply experimental configs for middleware (#41142) 2022-10-04 10:08:17 -07:00
config-utils.ts feat(experimental): option to polyfill fetch using undici in Node.js <18 (#40318) 2022-09-27 13:37:28 -07:00
config.ts Fix experimental undici warning (#41077) 2022-09-30 17:20:20 -07:00
crypto-utils.ts Move next-server directory files to server directory (#26756) 2021-06-30 13:44:40 +02:00
font-utils.ts Adding experimental size adjust based option (#41009) 2022-09-30 00:35:50 +00:00
get-app-route-from-entrypoint.ts App Build Stats (#38884) 2022-08-10 19:31:01 +00:00
get-page-files.ts Add initial handling for routing tests (#36635) 2022-05-03 10:37:23 +00:00
get-route-from-entrypoint.ts App Build Stats (#38884) 2022-08-10 19:31:01 +00:00
google-font-metrics.json Adding experimental size adjust based option (#41009) 2022-09-30 00:35:50 +00:00
htmlescape.ts Subresource Integrity for App Directory (#39729) 2022-09-08 15:17:15 -07:00
image-optimizer.ts docs(image): improve error message when sharp is missing in standalone mode (#41133) 2022-10-05 17:28:29 +00:00
internal-utils.ts Rename flight parameters to rsc/next (#40979) 2022-09-28 13:18:37 +02:00
load-components.ts Add handling for static generation in app (#40561) 2022-09-19 18:05:28 +00:00
match-bundle.ts App Build Stats (#38884) 2022-08-10 19:31:01 +00:00
next-server.ts Add response stream errorhandling in edge-function-runtime (#41102) 2022-10-06 11:56:13 -07:00
next.ts Handle rewriting WebSocket requests (#39463) 2022-08-10 17:00:30 +00:00
node-polyfill-fetch.js feat(experimental): option to polyfill fetch using undici in Node.js <18 (#40318) 2022-09-27 13:37:28 -07:00
node-polyfill-web-streams.js Update Edge Runtime (#38862) 2022-07-21 18:29:19 +00:00
node-web-streams-helper.ts Check required root layout tags (#41120) 2022-10-03 19:27:16 +00:00
optimize-amp.ts Move next-server directory files to server directory (#26756) 2021-06-30 13:44:40 +02:00
post-process.ts Adding experimentalAdjustFallback feature to font optimization (#40185) 2022-09-16 14:13:21 -07:00
render-result.ts Change Flight response content type to application/octet-stream (#40665) 2022-09-18 20:49:05 +00:00
render.tsx Fix warning messages for next export (#41165) 2022-10-04 20:34:35 +00:00
request-meta.ts Apply experimental configs for middleware (#41142) 2022-10-04 10:08:17 -07:00
require.ts Add handling for static generation in app (#40561) 2022-09-19 18:05:28 +00:00
router.ts Revert "Revert "Refactor Server Router" (#40328)" (#40333) 2022-09-07 16:38:10 -07:00
serve-static.ts fix(#39706): add avif support for node serve static (#39733) 2022-08-18 17:57:12 +00:00
server-route-utils.ts Enable @typescript-eslint/no-use-before-define variables,enums,typedefs for core files (#39511) 2022-08-11 16:32:52 -05:00
utils.ts Mask Flight Parameters from Middleware (#39939) 2022-09-15 14:53:51 +00:00
web-server.ts Refactor app dir related flags (#41166) 2022-10-04 22:16:44 +00:00