Repository navigation
fix(server + client): Post release httpBatchStreamLink issues - #4481
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
kamilogorek
reviewed
Jun 4, 2023
kamilogorek
reviewed
Jun 4, 2023
Contributor
We use |
This reverts commit 2ea8bc6.
KATT
approved these changes
Jun 4, 2023
3 tasks done
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Changes
TextDecoderdoesn't exist in the global scope for React Native #4347 (comment)Commit: f877b24
Added a
textDecoderoption to the instantiation ofhttpBatchStreamLink:This is not required to be provided, but allows for overriding the native API (like is already done for
fetch).The
TextDecoderAPI is now accessed from the global scopeglobal.TextDecoder❓️❓️Which is the most supported one?
globalorglobalThis? ❓️❓️The
TextDecoderAPI is now accessed from inside a function, so should not crash the client, even if it wasn't tree-shaken out*on Next.js 12,
httpBatchStreamLinkworks like a regularhttpBatchLinkCommit: cbe8398
On some servers, "pushing data to a stream" is not sufficient to "stream a response". We might have several cases like this (different adapters, different uses...), but so far I've only encountered 1.
On Next.js <13 and on Express with a
compress()link, the response isn't streamed because it's being gzipped. Both of these use thenodeHTTPRequestHandlerand in both of these cases, there is a method added to theresobject:res.flush().flushkey onNodeHTTPResponsetype (which is accurate: sometimes it's there sometimes not).flush()on every.write()for a streamed responseonHeadinstead of firstonChunk. This was not really necessary for this fix, but seems more correct and might make future similar fixes easier.the new version introduced a type error about a missing
eagerGenerationkey #4347 (comment)Commit: 4e8c260
Version 10.29 added a new
eagerGenerationkey in the arguments passed toResponseMetaFnto indicate that this function is being called before knowing the response body. This key is always provided byresolveHTTPResponsebut some people seem to have been using the type externally. So we're making it optional.✅ Checklist