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

Wire up the native API for useSyncExternalStore #22237

Merged
merged 1 commit into from
Sep 7, 2021

Conversation

acdlite
Copy link
Collaborator

@acdlite acdlite commented Sep 2, 2021

Adds useSyncExternalStore to the internal dispatcher, and exports the native API from the React package without yet implementing it.

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Sep 2, 2021
@sizebot
Copy link

sizebot commented Sep 2, 2021

Comparing: 031abd2...5685290

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 +0.15% 127.60 kB 127.79 kB +0.13% 40.73 kB 40.78 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js +0.15% 130.42 kB 130.62 kB +0.11% 41.66 kB 41.70 kB
facebook-www/ReactDOM-prod.classic.js +0.07% 405.18 kB 405.49 kB +0.08% 75.05 kB 75.10 kB
facebook-www/ReactDOM-prod.modern.js +0.08% 393.75 kB 394.05 kB +0.09% 73.33 kB 73.39 kB
facebook-www/ReactDOMForked-prod.classic.js +0.07% 405.18 kB 405.49 kB +0.08% 75.05 kB 75.11 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
facebook-react-native/react/cjs/React-prod.js +1.62% 16.77 kB 17.04 kB +1.07% 4.32 kB 4.36 kB
facebook-react-native/react/cjs/React-profiling.js +1.62% 16.77 kB 17.04 kB +1.07% 4.32 kB 4.36 kB
facebook-www/React-prod.modern.js +1.60% 16.89 kB 17.17 kB +0.99% 4.36 kB 4.40 kB
facebook-www/React-profiling.modern.js +1.60% 16.89 kB 17.17 kB +0.99% 4.36 kB 4.40 kB
facebook-www/React-prod.classic.js +1.59% 17.04 kB 17.31 kB +1.05% 4.40 kB 4.45 kB
facebook-www/React-profiling.classic.js +1.59% 17.04 kB 17.31 kB +1.05% 4.40 kB 4.45 kB
oss-experimental/react-suspense-test-utils/cjs/react-suspense-test-utils.js +1.52% 2.57 kB 2.61 kB +1.11% 1.08 kB 1.10 kB
oss-stable-semver/react-suspense-test-utils/cjs/react-suspense-test-utils.js +1.52% 2.57 kB 2.61 kB +1.11% 1.08 kB 1.10 kB
oss-stable/react-suspense-test-utils/cjs/react-suspense-test-utils.js +1.52% 2.57 kB 2.61 kB +1.11% 1.08 kB 1.10 kB
oss-experimental/react/cjs/react.production.min.js +1.26% 7.64 kB 7.73 kB +0.81% 2.95 kB 2.97 kB
oss-experimental/react-debug-tools/cjs/react-debug-tools.production.min.js +1.04% 6.63 kB 6.70 kB +1.09% 2.56 kB 2.59 kB
oss-stable-semver/react-debug-tools/cjs/react-debug-tools.production.min.js +1.04% 6.63 kB 6.70 kB +1.09% 2.56 kB 2.59 kB
oss-stable/react-debug-tools/cjs/react-debug-tools.production.min.js +1.04% 6.63 kB 6.70 kB +1.09% 2.56 kB 2.59 kB
oss-experimental/react/umd/react.profiling.min.js +0.77% 11.64 kB 11.73 kB +0.50% 4.60 kB 4.63 kB
oss-experimental/react/umd/react.production.min.js +0.77% 11.64 kB 11.73 kB +0.48% 4.60 kB 4.63 kB
oss-experimental/react-debug-tools/cjs/react-debug-tools.development.js +0.65% 22.63 kB 22.78 kB +0.62% 6.12 kB 6.16 kB
oss-stable-semver/react-debug-tools/cjs/react-debug-tools.development.js +0.65% 22.63 kB 22.78 kB +0.62% 6.12 kB 6.16 kB
oss-stable/react-debug-tools/cjs/react-debug-tools.development.js +0.65% 22.63 kB 22.78 kB +0.62% 6.12 kB 6.16 kB
oss-stable-semver/react-server/cjs/react-server.production.min.js +0.40% 17.27 kB 17.34 kB +0.60% 5.88 kB 5.92 kB
oss-stable/react-server/cjs/react-server.production.min.js +0.40% 17.27 kB 17.34 kB +0.60% 5.88 kB 5.92 kB
oss-experimental/react-server/cjs/react-server.production.min.js +0.40% 17.39 kB 17.46 kB +0.59% 5.92 kB 5.96 kB
oss-experimental/react-server/cjs/react-server-flight.production.min.js +0.35% 6.79 kB 6.81 kB +0.46% 2.85 kB 2.86 kB
oss-stable-semver/react-server/cjs/react-server-flight.production.min.js +0.35% 6.79 kB 6.81 kB +0.46% 2.85 kB 2.86 kB
oss-stable/react-server/cjs/react-server-flight.production.min.js +0.35% 6.79 kB 6.81 kB +0.46% 2.85 kB 2.86 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-writer.browser.production.min.server.js +0.35% 6.60 kB 6.63 kB +0.43% 2.80 kB 2.81 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-writer.browser.production.min.server.js +0.35% 6.60 kB 6.63 kB +0.43% 2.80 kB 2.81 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-writer.browser.production.min.server.js +0.35% 6.60 kB 6.63 kB +0.43% 2.80 kB 2.81 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-writer.node.production.min.server.js +0.35% 6.61 kB 6.64 kB +0.47% 2.77 kB 2.79 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-writer.node.production.min.server.js +0.35% 6.61 kB 6.64 kB +0.47% 2.77 kB 2.79 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-writer.node.production.min.server.js +0.35% 6.61 kB 6.64 kB +0.47% 2.77 kB 2.79 kB
oss-experimental/react-server-dom-webpack/umd/react-server-dom-webpack-writer.browser.production.min.server.js +0.34% 6.82 kB 6.84 kB +0.52% 2.89 kB 2.90 kB
oss-stable-semver/react-server-dom-webpack/umd/react-server-dom-webpack-writer.browser.production.min.server.js +0.34% 6.82 kB 6.84 kB +0.52% 2.89 kB 2.90 kB
oss-stable/react-server-dom-webpack/umd/react-server-dom-webpack-writer.browser.production.min.server.js +0.34% 6.82 kB 6.84 kB +0.52% 2.89 kB 2.90 kB
oss-stable-semver/react-test-renderer/umd/react-test-renderer.development.js +0.28% 626.28 kB 628.05 kB +0.11% 131.86 kB 132.01 kB
oss-stable/react-test-renderer/umd/react-test-renderer.development.js +0.28% 626.28 kB 628.05 kB +0.11% 131.86 kB 132.01 kB
facebook-react-native/react/cjs/React-dev.js +0.28% 99.56 kB 99.84 kB +0.24% 24.08 kB 24.14 kB
oss-stable-semver/react-test-renderer/cjs/react-test-renderer.development.js +0.28% 597.10 kB 598.77 kB +0.11% 130.48 kB 130.62 kB
oss-stable/react-test-renderer/cjs/react-test-renderer.development.js +0.28% 597.10 kB 598.77 kB +0.11% 130.48 kB 130.62 kB
facebook-www/ReactFlightDOMRelayServer-prod.classic.js +0.28% 15.47 kB 15.51 kB +0.38% 3.94 kB 3.96 kB
facebook-www/ReactFlightDOMRelayServer-prod.modern.js +0.28% 15.47 kB 15.51 kB +0.38% 3.94 kB 3.96 kB
facebook-react-native/react-test-renderer/cjs/ReactTestRenderer-dev.js +0.27% 607.49 kB 609.15 kB +0.09% 131.44 kB 131.56 kB
oss-experimental/react-test-renderer/umd/react-test-renderer.development.js +0.27% 642.98 kB 644.74 kB +0.10% 135.30 kB 135.43 kB
oss-experimental/react-test-renderer/cjs/react-test-renderer.development.js +0.27% 612.95 kB 614.62 kB +0.10% 133.87 kB 134.00 kB
facebook-relay/flight/ReactFlightNativeRelayServer-prod.js +0.27% 15.88 kB 15.92 kB +0.35% 4.03 kB 4.05 kB
facebook-www/ReactTestRenderer-dev.classic.js +0.27% 618.91 kB 620.58 kB +0.10% 132.64 kB 132.78 kB
facebook-www/ReactTestRenderer-dev.modern.js +0.27% 618.93 kB 620.59 kB +0.10% 132.65 kB 132.79 kB
oss-experimental/react/cjs/react.development.js +0.27% 84.23 kB 84.46 kB +0.21% 22.48 kB 22.53 kB
oss-stable-semver/react-art/cjs/react-art.development.js +0.26% 646.15 kB 647.83 kB +0.11% 139.99 kB 140.14 kB
oss-stable/react-art/cjs/react-art.development.js +0.26% 646.15 kB 647.83 kB +0.11% 139.99 kB 140.14 kB
facebook-www/React-dev.modern.js +0.26% 108.04 kB 108.32 kB +0.19% 26.41 kB 26.46 kB
facebook-www/React-dev.classic.js +0.26% 109.06 kB 109.34 kB +0.20% 26.60 kB 26.66 kB
oss-experimental/react-art/cjs/react-art.development.js +0.25% 662.03 kB 663.71 kB +0.10% 143.42 kB 143.56 kB
oss-stable-semver/react-test-renderer/umd/react-test-renderer.production.min.js +0.25% 77.80 kB 78.00 kB +0.25% 24.42 kB 24.48 kB
oss-stable/react-test-renderer/umd/react-test-renderer.production.min.js +0.25% 77.80 kB 78.00 kB +0.25% 24.42 kB 24.48 kB
oss-stable-semver/react-test-renderer/cjs/react-test-renderer.production.min.js +0.25% 77.59 kB 77.79 kB +0.17% 24.06 kB 24.10 kB
oss-stable/react-test-renderer/cjs/react-test-renderer.production.min.js +0.25% 77.59 kB 77.79 kB +0.17% 24.06 kB 24.10 kB
oss-experimental/react-test-renderer/umd/react-test-renderer.production.min.js +0.25% 80.18 kB 80.38 kB +0.27% 25.19 kB 25.26 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.development.js +0.24% 697.31 kB 698.98 kB +0.10% 148.14 kB 148.29 kB
oss-stable/react-reconciler/cjs/react-reconciler.development.js +0.24% 697.31 kB 698.98 kB +0.10% 148.14 kB 148.29 kB
oss-experimental/react-test-renderer/cjs/react-test-renderer.production.min.js +0.24% 79.97 kB 80.17 kB +0.23% 24.81 kB 24.86 kB
react-native/implementations/ReactFabric-dev.js +0.24% 698.24 kB 699.90 kB +0.09% 151.31 kB 151.44 kB
facebook-www/ReactART-dev.modern.js +0.24% 700.23 kB 701.89 kB +0.08% 149.52 kB 149.64 kB
oss-stable-semver/react-art/cjs/react-art.production.min.js +0.24% 80.73 kB 80.92 kB +0.10% 25.08 kB 25.10 kB
oss-stable/react-art/cjs/react-art.production.min.js +0.24% 80.73 kB 80.92 kB +0.10% 25.08 kB 25.10 kB
oss-stable-semver/react-art/umd/react-art.development.js +0.24% 749.22 kB 750.99 kB +0.10% 158.36 kB 158.51 kB
oss-stable/react-art/umd/react-art.development.js +0.24% 749.22 kB 750.99 kB +0.10% 158.36 kB 158.51 kB
oss-experimental/react-reconciler/cjs/react-reconciler.development.js +0.23% 713.38 kB 715.05 kB +0.09% 151.58 kB 151.71 kB
facebook-www/ReactART-dev.classic.js +0.23% 710.51 kB 712.17 kB +0.08% 151.63 kB 151.75 kB
react-native/implementations/ReactNativeRenderer-dev.js +0.23% 715.39 kB 717.05 kB +0.10% 155.20 kB 155.35 kB
react-native/implementations/ReactFabric-dev.fb.js +0.23% 720.23 kB 721.90 kB +0.09% 155.68 kB 155.82 kB
oss-experimental/react-art/umd/react-art.development.js +0.23% 765.95 kB 767.71 kB +0.08% 161.79 kB 161.92 kB
oss-experimental/react-art/cjs/react-art.production.min.js +0.23% 83.12 kB 83.31 kB +0.16% 25.83 kB 25.87 kB
oss-stable-semver/react-dom/umd/react-dom-server.browser.production.min.js +0.23% 32.17 kB 32.24 kB +0.32% 10.92 kB 10.96 kB
oss-stable/react-dom/umd/react-dom-server.browser.production.min.js +0.23% 32.17 kB 32.24 kB +0.32% 10.92 kB 10.96 kB
react-native/implementations/ReactNativeRenderer-dev.fb.js +0.23% 735.36 kB 737.03 kB +0.09% 159.06 kB 159.20 kB
oss-stable-semver/react-dom/umd/react-dom-server-legacy.browser.production.min.js +0.22% 32.07 kB 32.14 kB +0.31% 10.68 kB 10.72 kB
oss-stable/react-dom/umd/react-dom-server-legacy.browser.production.min.js +0.22% 32.07 kB 32.14 kB +0.31% 10.68 kB 10.72 kB
oss-experimental/react-dom/umd/react-dom-server-legacy.browser.production.min.js +0.22% 32.21 kB 32.28 kB +0.30% 10.73 kB 10.77 kB
oss-experimental/react-dom/umd/react-dom-server.browser.production.min.js +0.22% 32.31 kB 32.38 kB +0.32% 10.99 kB 11.02 kB
oss-experimental/react/umd/react.development.js +0.22% 107.77 kB 108.01 kB +0.22% 27.43 kB 27.49 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +0.22% 31.89 kB 31.96 kB +0.34% 10.55 kB 10.59 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +0.22% 31.89 kB 31.96 kB +0.34% 10.55 kB 10.59 kB
oss-stable-semver/react-dom/cjs/react-dom-server.browser.production.min.js +0.22% 32.01 kB 32.08 kB +0.31% 10.82 kB 10.86 kB
oss-stable/react-dom/cjs/react-dom-server.browser.production.min.js +0.22% 32.01 kB 32.08 kB +0.31% 10.82 kB 10.86 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +0.22% 32.02 kB 32.09 kB +0.36% 10.59 kB 10.63 kB
oss-experimental/react-dom/cjs/react-dom-server.browser.production.min.js +0.21% 32.14 kB 32.21 kB +0.33% 10.88 kB 10.91 kB
oss-stable-semver/react-dom/cjs/react-dom-server.node.production.min.js +0.21% 32.29 kB 32.36 kB +0.30% 10.83 kB 10.86 kB
oss-stable/react-dom/cjs/react-dom-server.node.production.min.js +0.21% 32.29 kB 32.36 kB +0.30% 10.83 kB 10.86 kB
oss-experimental/react-dom/cjs/react-dom-server.node.production.min.js +0.21% 32.43 kB 32.50 kB +0.31% 10.88 kB 10.92 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.node.production.min.js +0.21% 32.48 kB 32.55 kB +0.33% 10.77 kB 10.80 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.node.production.min.js +0.21% 32.48 kB 32.55 kB +0.33% 10.77 kB 10.80 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.production.min.js +0.21% 89.72 kB 89.91 kB +0.17% 27.55 kB 27.60 kB
oss-stable/react-reconciler/cjs/react-reconciler.production.min.js +0.21% 89.72 kB 89.91 kB +0.17% 27.55 kB 27.60 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.node.production.min.js +0.21% 32.62 kB 32.69 kB +0.32% 10.81 kB 10.85 kB
oss-experimental/react-reconciler/cjs/react-reconciler.production.min.js +0.21% 92.17 kB 92.36 kB +0.22% 28.32 kB 28.38 kB

Generated by 🚫 dangerJS against 5685290

Adds useSyncExternalStore to the internal dispatcher, and exports
the native API from the React package without yet implementing it.
@acdlite acdlite force-pushed the wire-up-native-usesyncexternalstore branch 3 times, most recently from 8a16679 to 5685290 Compare September 7, 2021 16:36
Copy link
Member

@rickhanlonii rickhanlonii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

return otherExports;
});
if (gate(flags => flags.variant)) {
// We'll use the variant flag to represent the native implementation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it

@acdlite acdlite merged commit 77912d9 into facebook:main Sep 7, 2021
facebook-github-bot pushed a commit to facebook/react-native that referenced this pull request Sep 11, 2021
Summary:
This sync includes the following changes:
- **[95d762e40](facebook/react@95d762e40 )**: Remove duplicate test //<Andrew Clark>//
- **[d4d1dc085](facebook/react@d4d1dc085 )**: Reorder VARIANT feature flags ([#22266](facebook/react#22266)) //<Dan Abramov>//
- **[2f156eafb](facebook/react@2f156eafb )**: Adjust consoleManagedByDevToolsDuringStrictMode feature flag ([#22253](facebook/react#22253)) //<Dan Abramov>//
- **[cfd819332](facebook/react@cfd819332 )**: Add useSyncExternalStore to react-debug-tools ([#22240](facebook/react#22240)) //<Andrew Clark>//
- **[8e80592a3](facebook/react@8e80592a3 )**: Remove state queue from useSyncExternalStore ([#22265](facebook/react#22265)) //<Andrew Clark>//
- **[06f98c168](facebook/react@06f98c168 )**: Implement useSyncExternalStore in Fiber ([#22239](facebook/react#22239)) //<Andrew Clark>//
- **[77912d9a0](facebook/react@77912d9a0 )**: Wire up the native API for useSyncExternalStore ([#22237](facebook/react#22237)) //<Andrew Clark>//
- **[031abd24b](facebook/react@031abd24b )**: Add warning and test for useSyncExternalStore when getSnapshot isn't cached ([#22262](facebook/react#22262)) //<salazarm>//
- **[b8884de24](facebook/react@b8884de24 )**: break up import keyword to avoid being accidentally parsed as dynamic import statement in external code ([#21918](facebook/react#21918)) //<Jianhua Zheng>//
- **[6d6bba5bf](facebook/react@6d6bba5bf )**: Fix typo in ReactUpdatePriority-test.js ([#21958](facebook/react#21958)) //<Ikko Ashimine>//
- **[0c0d1ddae](facebook/react@0c0d1ddae )**: feat(eslint-plugin-react-hooks): support ESLint 8.x ([#22248](facebook/react#22248)) //<Michaël De Boey>//
- **[1314299c7](facebook/react@1314299c7 )**: Initial shim of useSyncExternalStore ([#22211](facebook/react#22211)) //<Andrew Clark>//
- **[fc40f02ad](facebook/react@fc40f02ad )**: Add consoleManagedByDevToolsDuringStrictMode feature flag in React Reconciler ([#22196](facebook/react#22196)) //<Luna Ruan>//
- **[46a0f050a](facebook/react@46a0f050a )**: Set up use-sync-external-store package ([#22202](facebook/react#22202)) //<Andrew Clark>//
- **[8723e772b](facebook/react@8723e772b )**: Fix a string interpolation typo in ReactHooks test ([#22174](facebook/react#22174)) //<Matt Hargett>//
- **[60a30cf32](facebook/react@60a30cf32 )**: Console Logging for StrictMode Double Rendering ([#22030](facebook/react#22030)) //<Luna Ruan>//
- **[76bbad3e3](facebook/react@76bbad3e3 )**: Add maxYieldMs feature flag in Scheduler ([#22165](facebook/react#22165)) //<Ricky>//
- **[b0b53ae2c](facebook/react@b0b53ae2c )**: Add feature flags for scheduler experiments ([#22105](facebook/react#22105)) //<Ricky>//

Changelog:
[General][Changed] - React Native sync for revisions bd5bf55...95d762e

jest_e2e[run_all_tests]

Reviewed By: mdvacca

Differential Revision: D30809906

fbshipit-source-id: 131cfdf91e15f67fa59a5d925467e538ee89fe10
zhengjitf pushed a commit to zhengjitf/react that referenced this pull request Apr 15, 2022
Adds useSyncExternalStore to the internal dispatcher, and exports
the native API from the React package without yet implementing 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.

4 participants