-
Notifications
You must be signed in to change notification settings - Fork 46.5k
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
Prepare internal code sync #23144
Draft
acdlite
wants to merge
12
commits into
facebook:main
Choose a base branch
from
acdlite:prepare-www-sync
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Prepare internal code sync #23144
Conversation
This file contains 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
facebook-github-bot
added
CLA Signed
React Core Team
Opened by a member of the React Core Team
labels
Jan 19, 2022
acdlite
force-pushed
the
prepare-www-sync
branch
from
January 19, 2022 19:42
62f3031
to
0bb1103
Compare
acdlite
force-pushed
the
prepare-www-sync
branch
6 times, most recently
from
January 20, 2022 02:46
bbb4096
to
5017133
Compare
acdlite
force-pushed
the
prepare-www-sync
branch
9 times, most recently
from
June 9, 2022 18:05
3b71cb6
to
b4ac045
Compare
acdlite
force-pushed
the
prepare-www-sync
branch
3 times, most recently
from
June 17, 2022 17:47
ace496a
to
fc8ee7f
Compare
acdlite
force-pushed
the
prepare-www-sync
branch
4 times, most recently
from
June 29, 2022 23:51
33511a2
to
6245ddf
Compare
acdlite
force-pushed
the
prepare-www-sync
branch
from
October 21, 2022 01:34
6245ddf
to
dc67a11
Compare
acdlite
force-pushed
the
prepare-www-sync
branch
from
December 5, 2022 21:54
dc67a11
to
92e5533
Compare
…ck (facebook#25543)" This reverts commit d2a0176. The old (unstable) mechanism for suspending was to throw a promise. The purpose of throwing is to interrupt the component's execution, and also to signal to React that the interruption was caused by Suspense as opposed to some other error. A flaw is that throwing is meant to be an implementation detail — if code in userspace catches the promise, it can lead to unexpected behavior. With `use`, userspace code does not throw promises directly, but `use` itself still needs to throw something to interrupt the component and unwind the stack. The solution is to throw an internal error. In development, we can detect whether the error was caught by a userspace try/catch block and log a warning — though it's not foolproof, since a clever user could catch the object and rethrow it later. The error message includes advice to move `use` outside of the try/catch block. I did not yet implement the warning in Flight.
This reverts commit fa77f52. There are two different switch statements that we use to unwrap a `use`-ed promise, but there really only needs to be one. This was a factoring artifact that arose because I implemented the yieldy `status` instrumentation thing before I implemented `use` (for promises that are thrown directly during render, which is the old Suspense pattern that will be superseded by `use`).
This reverts commit 5f9d29a. To derisk the rollout of `use`, and simplify the implementation, this reverts the yield-to-microtasks behavior for promises that are thrown directly (as opposed to being unwrapped by `use`). We may add this back later. However, the plan is to deprecate throwing a promise directly and migrate all existing Suspense code to `use`, so the extra code probably isn't worth it.
acdlite
force-pushed
the
prepare-www-sync
branch
from
December 5, 2022 22:00
79b7a10
to
b73a5c6
Compare
This reverts commit 42aff59. The distinction between "wakeable" and "thenable" isn't really important in these files anymore so we should just pick one.
…book#25226)" This reverts commit 3613284. implements the experimental use(context) API for the server components (Flight) and SSR (Fizz) runtimes
This reverts commit c28f313. Follow up to facebook#25084 and facebook#25207. Implements experimental_use(promise) API in the SSR runtime (Fizz). This is largely a copy-paste of the Flight implementation. I have intentionally tried to keep both as close as possible.
Empty commit used to mark point at which Fizz's `use` was removed completely from the codebase. Subsequent commits will add it back.
This reverts commit dedfeff. This reverts commit c28f313. Follow up to facebook#25084 and facebook#25207. Implements experimental_use(promise) API in the SSR runtime (Fizz). This is largely a copy-paste of the Flight implementation. I have intentionally tried to keep both as close as possible.
…sr (facebook#25226)"" This reverts commit 0dfb986. This reverts commit 3613284. implements the experimental use(context) API for the server components (Flight) and SSR (Fizz) runtimes
This reverts commit b73a5c6. This reverts commit 5f9d29a. To derisk the rollout of `use`, and simplify the implementation, this reverts the yield-to-microtasks behavior for promises that are thrown directly (as opposed to being unwrapped by `use`). We may add this back later. However, the plan is to deprecate throwing a promise directly and migrate all existing Suspense code to `use`, so the extra code probably isn't worth it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Using this PR to kick off build pipeline in CI