-
Notifications
You must be signed in to change notification settings - Fork 46.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Flight] Support postponing through a serialized promise #27818
Conversation
if ( | ||
enablePostpone && | ||
typeof reason === 'object' && | ||
reason !== null && | ||
(reason: any).$$typeof === REACT_POSTPONE_TYPE | ||
) { | ||
const postponeInstance: Postpone = (reason: any); | ||
logPostpone(request, postponeInstance.message); | ||
emitPostponeChunk(request, newTask.id, postponeInstance); | ||
} else { | ||
newTask.status = ERRORED; | ||
const digest = logRecoverableError(request, reason); | ||
emitErrorChunk(request, newTask.id, digest, reason); | ||
} | ||
if (request.destination !== null) { | ||
flushCompletedChunks(request, request.destination); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this just an oversight before? The lack of parity between the already resolved pathway and the delayed resolve pathway seems so glaring I worry I misunderstand how this is supposed to work. That said without some deeper reasoning why it has to work differently this seems like a quite straight forward fix
18fff5d
to
009eef4
Compare
5a1b141
to
de4ecdb
Compare
…he server should be possible however prior to this change Flight treated this case like an error rather than a postpone. This fix adds support for postponing in this position and adds a test asserting you can successfully prerender the root if you unwrap this promise inside a suspense boundary.
de4ecdb
to
b36305c
Compare
Postponing in a promise that is being serialized to the client from the server should be possible however prior to this change Flight treated this case like an error rather than a postpone. This fix adds support for postponing in this position and adds a test asserting you can successfully prerender the root if you unwrap this promise inside a suspense boundary. DiffTrain build for [5bcade5](5bcade5)
Updates React from 2c338b16f to 0cdfef19b. ### React upstream changes - facebook/react#27821 - facebook/react#27820 - facebook/react#27818 - facebook/react#27819 - facebook/react#27817 - facebook/react#27703 - facebook/react#27796 - facebook/react#27811 - facebook/react#27804 - facebook/react#27807 - facebook/react#27805 - facebook/react#27792 - facebook/react#27788 - facebook/react#26852 - facebook/react#27790 - facebook/react#27786 - facebook/react#27785 - facebook/react#27783 - facebook/react#27784 - facebook/react#27769 - facebook/react#27766 - facebook/react#27701 - facebook/react#27732 - facebook/react#27740 - facebook/react#27767 - facebook/react#27768 - facebook/react#27765 - facebook/react#27759 - facebook/react#27579 - facebook/react#27709 - facebook/react#27734 - facebook/react#27739 - facebook/react#27717 - facebook/react#27583 - facebook/react#27713 Closes NEXT-1887
Updates React from 2c338b16f to 0cdfef19b. ### React upstream changes - facebook/react#27821 - facebook/react#27820 - facebook/react#27818 - facebook/react#27819 - facebook/react#27817 - facebook/react#27703 - facebook/react#27796 - facebook/react#27811 - facebook/react#27804 - facebook/react#27807 - facebook/react#27805 - facebook/react#27792 - facebook/react#27788 - facebook/react#26852 - facebook/react#27790 - facebook/react#27786 - facebook/react#27785 - facebook/react#27783 - facebook/react#27784 - facebook/react#27769 - facebook/react#27766 - facebook/react#27701 - facebook/react#27732 - facebook/react#27740 - facebook/react#27767 - facebook/react#27768 - facebook/react#27765 - facebook/react#27759 - facebook/react#27579 - facebook/react#27709 - facebook/react#27734 - facebook/react#27739 - facebook/react#27717 - facebook/react#27583 - facebook/react#27713 Closes NEXT-1887
) Postponing in a promise that is being serialized to the client from the server should be possible however prior to this change Flight treated this case like an error rather than a postpone. This fix adds support for postponing in this position and adds a test asserting you can successfully prerender the root if you unwrap this promise inside a suspense boundary.
Postponing in a promise that is being serialized to the client from the server should be possible however prior to this change Flight treated this case like an error rather than a postpone. This fix adds support for postponing in this position and adds a test asserting you can successfully prerender the root if you unwrap this promise inside a suspense boundary. DiffTrain build for commit 5bcade5.
Postponing in a promise that is being serialized to the client from the server should be possible however prior to this change Flight treated this case like an error rather than a postpone. This fix adds support for postponing in this position and adds a test asserting you can successfully prerender the root if you unwrap this promise inside a suspense boundary.