Skip to content
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
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft

Conversation

acdlite
Copy link
Collaborator

@acdlite acdlite commented Jan 19, 2022

Using this PR to kick off build pipeline in CI

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Jan 19, 2022
@sizebot
Copy link

sizebot commented Jan 19, 2022

Comparing: d807eb5...97a2263

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.min.js = 154.26 kB 154.26 kB = 48.94 kB 48.94 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 156.18 kB 156.18 kB = 49.60 kB 49.60 kB
facebook-www/ReactDOM-prod.classic.js = 532.79 kB 532.79 kB = 94.91 kB 94.91 kB
facebook-www/ReactDOM-prod.modern.js = 517.88 kB 517.88 kB = 92.70 kB 92.70 kB
facebook-www/ReactDOMForked-prod.classic.js = 532.79 kB 532.79 kB = 94.91 kB 94.91 kB
oss-experimental/react-server/cjs/react-server.production.min.js = 24.51 kB 23.97 kB = 8.39 kB 8.11 kB
oss-stable-semver/react-server/cjs/react-server.production.min.js = 24.27 kB 23.72 kB = 8.30 kB 8.02 kB
oss-stable/react-server/cjs/react-server.production.min.js = 24.27 kB 23.72 kB = 8.30 kB 8.02 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-experimental/react-dom/umd/react-dom-server.browser.development.js = 336.71 kB 335.82 kB = 74.77 kB 74.51 kB
oss-experimental/react-dom/umd/react-dom-server-legacy.browser.development.js = 336.18 kB 335.29 kB = 74.33 kB 74.05 kB
oss-stable/react-dom/umd/react-dom-server.browser.development.js = 335.34 kB 334.45 kB = 74.43 kB 74.15 kB
oss-stable-semver/react-dom/umd/react-dom-server.browser.development.js = 335.31 kB 334.42 kB = 74.41 kB 74.13 kB
oss-stable/react-dom/umd/react-dom-server-legacy.browser.development.js = 334.80 kB 333.91 kB = 73.98 kB 73.70 kB
oss-stable-semver/react-dom/umd/react-dom-server-legacy.browser.development.js = 334.78 kB 333.89 kB = 73.96 kB 73.67 kB
oss-experimental/react-dom/cjs/react-dom-server.node.development.js = 322.31 kB 321.42 kB = 73.96 kB 73.69 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.node.development.js = 322.29 kB 321.39 kB = 74.01 kB 73.75 kB
oss-experimental/react-dom/cjs/react-dom-static.node.development.js = 322.27 kB 321.38 kB = 74.05 kB 73.78 kB
oss-experimental/react-dom/cjs/react-dom-server.browser.development.js = 321.09 kB 320.20 kB = 74.02 kB 73.75 kB
oss-stable/react-dom/cjs/react-dom-server.node.development.js = 321.02 kB 320.13 kB = 73.61 kB 73.33 kB
oss-stable-semver/react-dom/cjs/react-dom-server.node.development.js = 321.00 kB 320.10 kB = 73.59 kB 73.31 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.node.development.js = 320.99 kB 320.10 kB = 73.66 kB 73.38 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.node.development.js = 320.97 kB 320.08 kB = 73.64 kB 73.36 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.browser.development.js = 320.58 kB 319.69 kB = 73.55 kB 73.28 kB
oss-experimental/react-dom/cjs/react-dom-static.browser.development.js = 320.39 kB 319.50 kB = 73.83 kB 73.56 kB
oss-stable/react-dom/cjs/react-dom-server.browser.development.js = 319.79 kB 318.90 kB = 73.67 kB 73.39 kB
oss-stable-semver/react-dom/cjs/react-dom-server.browser.development.js = 319.77 kB 318.88 kB = 73.65 kB 73.37 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.browser.development.js = 319.28 kB 318.39 kB = 73.19 kB 72.92 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.browser.development.js = 319.26 kB 318.37 kB = 73.17 kB 72.89 kB
oss-experimental/react-dom/cjs/react-dom-server.bun.development.js = 317.90 kB 317.01 kB = 73.14 kB 72.87 kB
oss-stable/react-dom/cjs/react-dom-server.bun.development.js = 316.61 kB 315.71 kB = 72.78 kB 72.51 kB
oss-stable-semver/react-dom/cjs/react-dom-server.bun.development.js = 316.58 kB 315.69 kB = 72.76 kB 72.49 kB
facebook-www/ReactDOMServer-dev.classic.js = 343.58 kB 342.48 kB = 76.43 kB 76.14 kB
facebook-www/ReactDOMServer-dev.modern.js = 336.88 kB 335.78 kB = 75.00 kB 74.73 kB
facebook-www/ReactDOMServerStreaming-dev.modern.js = 332.13 kB 331.03 kB = 73.92 kB 73.66 kB
facebook-www/ReactDOMServerStreaming-prod.modern.js = 128.54 kB 127.87 kB = 24.70 kB 24.37 kB
oss-experimental/react-server/cjs/react-server.development.js = 146.24 kB 145.34 kB = 36.42 kB 36.14 kB
oss-stable-semver/react-server/cjs/react-server.development.js = 145.62 kB 144.72 kB = 36.24 kB 35.95 kB
oss-stable/react-server/cjs/react-server.development.js = 145.62 kB 144.72 kB = 36.24 kB 35.95 kB
oss-experimental/react-dom/cjs/react-dom-server.node.production.min.js = 56.67 kB 56.13 kB = 18.03 kB 17.76 kB
oss-experimental/react-dom/cjs/react-dom-static.node.production.min.js = 56.67 kB 56.13 kB = 18.02 kB 17.77 kB
oss-stable/react-dom/cjs/react-dom-server.node.production.min.js = 56.28 kB 55.74 kB = 17.88 kB 17.63 kB
oss-stable-semver/react-dom/cjs/react-dom-server.node.production.min.js = 56.26 kB 55.72 kB = 17.86 kB 17.61 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.node.production.min.js = 55.84 kB 55.30 kB = 17.24 kB 16.98 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.node.production.min.js = 55.46 kB 54.91 kB = 17.08 kB 16.82 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.node.production.min.js = 55.43 kB 54.89 kB = 17.05 kB 16.80 kB
oss-experimental/react-dom/cjs/react-dom-server.bun.production.min.js = 55.14 kB 54.60 kB = 17.27 kB 17.01 kB
oss-stable/react-dom/cjs/react-dom-server.bun.production.min.js = 54.75 kB 54.21 kB = 17.11 kB 16.85 kB
oss-stable-semver/react-dom/cjs/react-dom-server.bun.production.min.js = 54.73 kB 54.19 kB = 17.08 kB 16.83 kB
oss-experimental/react-server/cjs/react-server.production.min.js = 24.51 kB 23.97 kB = 8.39 kB 8.11 kB
oss-stable-semver/react-server/cjs/react-server.production.min.js = 24.27 kB 23.72 kB = 8.30 kB 8.02 kB
oss-stable/react-server/cjs/react-server.production.min.js = 24.27 kB 23.72 kB = 8.30 kB 8.02 kB

Generated by 🚫 dangerJS against 97a2263

@acdlite acdlite force-pushed the prepare-www-sync branch 6 times, most recently from bbb4096 to 5017133 Compare January 20, 2022 02:46
@acdlite acdlite closed this Jan 23, 2022
@acdlite acdlite reopened this Jun 8, 2022
@acdlite acdlite force-pushed the prepare-www-sync branch 9 times, most recently from 3b71cb6 to b4ac045 Compare June 9, 2022 18:05
@acdlite acdlite force-pushed the prepare-www-sync branch 3 times, most recently from ace496a to fc8ee7f Compare June 17, 2022 17:47
@acdlite acdlite force-pushed the prepare-www-sync branch 4 times, most recently from 33511a2 to 6245ddf Compare June 29, 2022 23:51
…5615)"

This reverts commit 1a90262.

If a thenable resolves synchronously, `use` should unwrap its result
without suspending or interrupting the component's execution.
…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.
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 36aba8f.

This reverts commit 42aff59.

The distinction between "wakeable" and "thenable" isn't really
important in these files anymore so we should just pick one.
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
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants