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

Upgrade useSyncExternalStore to alpha channel #22662

Merged
merged 2 commits into from
Oct 31, 2021

Conversation

acdlite
Copy link
Collaborator

@acdlite acdlite commented Oct 31, 2021

Also renames useSyncExternalStoreExtra to useSyncExternalStoreWithSelector.

  • 'use-sync-external-store/shim' -> A shim for useSyncExternalStore that works in React 16 and 17 (any release that supports hooks). The module will first check if the built-in React API exists, before falling back to the shim.
  • 'use-sync-external-store/with-selector' -> An extended version of useSyncExternalStore that also supports selector and isEqual options. It does not shim use-sync-external-store; it composes the built-in React API. Use this if you only support 18+.
  • 'use-sync-external-store/shim/with-selector' -> Same API, but it composes use-sync-external-store/shim instead. Use this for compatability with 16 and 17.
  • 'use-sync-external-store' -> Re-exports React's built-in API. Not meant to be used. It will warn and direct users to either the shim or the built-in API.

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

sizebot commented Oct 31, 2021

Comparing: 9c8161b...14d177f

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 = 130.19 kB 130.19 kB = 41.42 kB 41.42 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 135.16 kB 135.16 kB = 42.95 kB 42.95 kB
facebook-www/ReactDOM-prod.classic.js = 419.90 kB 419.90 kB = 77.34 kB 77.33 kB
facebook-www/ReactDOM-prod.modern.js = 408.48 kB 408.48 kB = 75.59 kB 75.59 kB
facebook-www/ReactDOMForked-prod.classic.js = 419.90 kB 419.90 kB = 77.34 kB 77.34 kB
oss-experimental/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +∞% 0.00 kB 8.94 kB +∞% 0.00 kB 3.23 kB
oss-experimental/use-sync-external-store/cjs/use-sync-external-store-shim.native.development.js +∞% 0.00 kB 8.35 kB +∞% 0.00 kB 3.13 kB
oss-experimental/use-sync-external-store/cjs/use-sync-external-store-shim.native.production.min.js +∞% 0.00 kB 0.91 kB +∞% 0.00 kB 0.53 kB
oss-experimental/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js +∞% 0.00 kB 1.05 kB +∞% 0.00 kB 0.57 kB
oss-experimental/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +∞% 0.00 kB 6.26 kB +∞% 0.00 kB 1.89 kB
oss-experimental/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js +∞% 0.00 kB 1.12 kB +∞% 0.00 kB 0.62 kB
oss-experimental/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js +∞% 0.00 kB 6.21 kB +∞% 0.00 kB 1.87 kB
oss-experimental/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.min.js +∞% 0.00 kB 1.07 kB +∞% 0.00 kB 0.60 kB
oss-experimental/use-sync-external-store/shim/index.js +∞% 0.00 kB 0.24 kB +∞% 0.00 kB 0.16 kB
oss-experimental/use-sync-external-store/shim/index.native.js +∞% 0.00 kB 0.25 kB +∞% 0.00 kB 0.17 kB
oss-experimental/use-sync-external-store/shim/with-selector.js +∞% 0.00 kB 0.27 kB +∞% 0.00 kB 0.17 kB
oss-experimental/use-sync-external-store/with-selector.js +∞% 0.00 kB 0.25 kB +∞% 0.00 kB 0.17 kB
oss-stable-semver/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +∞% 0.00 kB 8.94 kB +∞% 0.00 kB 3.23 kB
oss-stable-semver/use-sync-external-store/cjs/use-sync-external-store-shim.native.development.js +∞% 0.00 kB 8.35 kB +∞% 0.00 kB 3.13 kB
oss-stable-semver/use-sync-external-store/cjs/use-sync-external-store-shim.native.production.min.js +∞% 0.00 kB 0.91 kB +∞% 0.00 kB 0.53 kB
oss-stable-semver/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js +∞% 0.00 kB 1.05 kB +∞% 0.00 kB 0.57 kB
oss-stable-semver/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +∞% 0.00 kB 6.26 kB +∞% 0.00 kB 1.89 kB
oss-stable-semver/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js +∞% 0.00 kB 1.12 kB +∞% 0.00 kB 0.62 kB
oss-stable-semver/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js +∞% 0.00 kB 6.21 kB +∞% 0.00 kB 1.87 kB
oss-stable-semver/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.min.js +∞% 0.00 kB 1.07 kB +∞% 0.00 kB 0.60 kB
oss-stable-semver/use-sync-external-store/shim/index.js +∞% 0.00 kB 0.24 kB +∞% 0.00 kB 0.16 kB
oss-stable-semver/use-sync-external-store/shim/index.native.js +∞% 0.00 kB 0.25 kB +∞% 0.00 kB 0.17 kB
oss-stable-semver/use-sync-external-store/shim/with-selector.js +∞% 0.00 kB 0.27 kB +∞% 0.00 kB 0.17 kB
oss-stable-semver/use-sync-external-store/with-selector.js +∞% 0.00 kB 0.25 kB +∞% 0.00 kB 0.17 kB
oss-stable/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +∞% 0.00 kB 8.94 kB +∞% 0.00 kB 3.23 kB
oss-stable/use-sync-external-store/cjs/use-sync-external-store-shim.native.development.js +∞% 0.00 kB 8.35 kB +∞% 0.00 kB 3.13 kB
oss-stable/use-sync-external-store/cjs/use-sync-external-store-shim.native.production.min.js +∞% 0.00 kB 0.91 kB +∞% 0.00 kB 0.53 kB
oss-stable/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js +∞% 0.00 kB 1.05 kB +∞% 0.00 kB 0.57 kB
oss-stable/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +∞% 0.00 kB 6.26 kB +∞% 0.00 kB 1.89 kB
oss-stable/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js +∞% 0.00 kB 1.12 kB +∞% 0.00 kB 0.62 kB
oss-stable/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js +∞% 0.00 kB 6.21 kB +∞% 0.00 kB 1.87 kB
oss-stable/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.min.js +∞% 0.00 kB 1.07 kB +∞% 0.00 kB 0.60 kB
oss-stable/use-sync-external-store/shim/index.js +∞% 0.00 kB 0.24 kB +∞% 0.00 kB 0.16 kB
oss-stable/use-sync-external-store/shim/index.native.js +∞% 0.00 kB 0.25 kB +∞% 0.00 kB 0.17 kB
oss-stable/use-sync-external-store/shim/with-selector.js +∞% 0.00 kB 0.27 kB +∞% 0.00 kB 0.17 kB
oss-stable/use-sync-external-store/with-selector.js +∞% 0.00 kB 0.25 kB +∞% 0.00 kB 0.17 kB
oss-experimental/use-sync-external-store/cjs/use-sync-external-store.development.js = 8.64 kB 3.40 kB = 3.20 kB 1.32 kB
oss-stable-semver/use-sync-external-store/cjs/use-sync-external-store.development.js = 8.64 kB 3.40 kB = 3.20 kB 1.32 kB
oss-stable/use-sync-external-store/cjs/use-sync-external-store.development.js = 8.64 kB 3.40 kB = 3.20 kB 1.32 kB
oss-experimental/use-sync-external-store/cjs/use-sync-external-store.production.min.js = 1.04 kB 0.35 kB = 0.58 kB 0.25 kB
oss-stable-semver/use-sync-external-store/cjs/use-sync-external-store.production.min.js = 1.04 kB 0.35 kB = 0.58 kB 0.25 kB
oss-stable/use-sync-external-store/cjs/use-sync-external-store.production.min.js = 1.04 kB 0.35 kB = 0.58 kB 0.25 kB
oss-experimental/use-sync-external-store/cjs/use-sync-external-store-extra.development.js Deleted 6.23 kB 0.00 kB Deleted 1.88 kB 0.00 kB
oss-experimental/use-sync-external-store/cjs/use-sync-external-store-extra.production.min.js Deleted 1.09 kB 0.00 kB Deleted 0.60 kB 0.00 kB
oss-experimental/use-sync-external-store/cjs/use-sync-external-store.native.development.js Deleted 8.21 kB 0.00 kB Deleted 3.10 kB 0.00 kB
oss-experimental/use-sync-external-store/cjs/use-sync-external-store.native.production.min.js Deleted 0.84 kB 0.00 kB Deleted 0.51 kB 0.00 kB
oss-experimental/use-sync-external-store/extra.js Deleted 0.24 kB 0.00 kB Deleted 0.16 kB 0.00 kB
oss-experimental/use-sync-external-store/index.native.js Deleted 0.24 kB 0.00 kB Deleted 0.16 kB 0.00 kB
oss-stable-semver/use-sync-external-store/cjs/use-sync-external-store-extra.development.js Deleted 6.23 kB 0.00 kB Deleted 1.88 kB 0.00 kB
oss-stable-semver/use-sync-external-store/cjs/use-sync-external-store-extra.production.min.js Deleted 1.09 kB 0.00 kB Deleted 0.60 kB 0.00 kB
oss-stable-semver/use-sync-external-store/cjs/use-sync-external-store.native.development.js Deleted 8.21 kB 0.00 kB Deleted 3.10 kB 0.00 kB
oss-stable-semver/use-sync-external-store/cjs/use-sync-external-store.native.production.min.js Deleted 0.84 kB 0.00 kB Deleted 0.51 kB 0.00 kB
oss-stable-semver/use-sync-external-store/extra.js Deleted 0.24 kB 0.00 kB Deleted 0.16 kB 0.00 kB
oss-stable-semver/use-sync-external-store/index.native.js Deleted 0.24 kB 0.00 kB Deleted 0.16 kB 0.00 kB
oss-stable/use-sync-external-store/cjs/use-sync-external-store-extra.development.js Deleted 6.23 kB 0.00 kB Deleted 1.88 kB 0.00 kB
oss-stable/use-sync-external-store/cjs/use-sync-external-store-extra.production.min.js Deleted 1.09 kB 0.00 kB Deleted 0.60 kB 0.00 kB
oss-stable/use-sync-external-store/cjs/use-sync-external-store.native.development.js Deleted 8.21 kB 0.00 kB Deleted 3.10 kB 0.00 kB
oss-stable/use-sync-external-store/cjs/use-sync-external-store.native.production.min.js Deleted 0.84 kB 0.00 kB Deleted 0.51 kB 0.00 kB
oss-stable/use-sync-external-store/extra.js Deleted 0.24 kB 0.00 kB Deleted 0.16 kB 0.00 kB
oss-stable/use-sync-external-store/index.native.js Deleted 0.24 kB 0.00 kB Deleted 0.16 kB 0.00 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-experimental/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +∞% 0.00 kB 8.94 kB +∞% 0.00 kB 3.23 kB
oss-experimental/use-sync-external-store/cjs/use-sync-external-store-shim.native.development.js +∞% 0.00 kB 8.35 kB +∞% 0.00 kB 3.13 kB
oss-experimental/use-sync-external-store/cjs/use-sync-external-store-shim.native.production.min.js +∞% 0.00 kB 0.91 kB +∞% 0.00 kB 0.53 kB
oss-experimental/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js +∞% 0.00 kB 1.05 kB +∞% 0.00 kB 0.57 kB
oss-experimental/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +∞% 0.00 kB 6.26 kB +∞% 0.00 kB 1.89 kB
oss-experimental/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js +∞% 0.00 kB 1.12 kB +∞% 0.00 kB 0.62 kB
oss-experimental/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js +∞% 0.00 kB 6.21 kB +∞% 0.00 kB 1.87 kB
oss-experimental/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.min.js +∞% 0.00 kB 1.07 kB +∞% 0.00 kB 0.60 kB
oss-experimental/use-sync-external-store/shim/index.js +∞% 0.00 kB 0.24 kB +∞% 0.00 kB 0.16 kB
oss-experimental/use-sync-external-store/shim/index.native.js +∞% 0.00 kB 0.25 kB +∞% 0.00 kB 0.17 kB
oss-experimental/use-sync-external-store/shim/with-selector.js +∞% 0.00 kB 0.27 kB +∞% 0.00 kB 0.17 kB
oss-experimental/use-sync-external-store/with-selector.js +∞% 0.00 kB 0.25 kB +∞% 0.00 kB 0.17 kB
oss-stable-semver/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +∞% 0.00 kB 8.94 kB +∞% 0.00 kB 3.23 kB
oss-stable-semver/use-sync-external-store/cjs/use-sync-external-store-shim.native.development.js +∞% 0.00 kB 8.35 kB +∞% 0.00 kB 3.13 kB
oss-stable-semver/use-sync-external-store/cjs/use-sync-external-store-shim.native.production.min.js +∞% 0.00 kB 0.91 kB +∞% 0.00 kB 0.53 kB
oss-stable-semver/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js +∞% 0.00 kB 1.05 kB +∞% 0.00 kB 0.57 kB
oss-stable-semver/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +∞% 0.00 kB 6.26 kB +∞% 0.00 kB 1.89 kB
oss-stable-semver/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js +∞% 0.00 kB 1.12 kB +∞% 0.00 kB 0.62 kB
oss-stable-semver/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js +∞% 0.00 kB 6.21 kB +∞% 0.00 kB 1.87 kB
oss-stable-semver/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.min.js +∞% 0.00 kB 1.07 kB +∞% 0.00 kB 0.60 kB
oss-stable-semver/use-sync-external-store/shim/index.js +∞% 0.00 kB 0.24 kB +∞% 0.00 kB 0.16 kB
oss-stable-semver/use-sync-external-store/shim/index.native.js +∞% 0.00 kB 0.25 kB +∞% 0.00 kB 0.17 kB
oss-stable-semver/use-sync-external-store/shim/with-selector.js +∞% 0.00 kB 0.27 kB +∞% 0.00 kB 0.17 kB
oss-stable-semver/use-sync-external-store/with-selector.js +∞% 0.00 kB 0.25 kB +∞% 0.00 kB 0.17 kB
oss-stable/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +∞% 0.00 kB 8.94 kB +∞% 0.00 kB 3.23 kB
oss-stable/use-sync-external-store/cjs/use-sync-external-store-shim.native.development.js +∞% 0.00 kB 8.35 kB +∞% 0.00 kB 3.13 kB
oss-stable/use-sync-external-store/cjs/use-sync-external-store-shim.native.production.min.js +∞% 0.00 kB 0.91 kB +∞% 0.00 kB 0.53 kB
oss-stable/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js +∞% 0.00 kB 1.05 kB +∞% 0.00 kB 0.57 kB
oss-stable/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +∞% 0.00 kB 6.26 kB +∞% 0.00 kB 1.89 kB
oss-stable/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js +∞% 0.00 kB 1.12 kB +∞% 0.00 kB 0.62 kB
oss-stable/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js +∞% 0.00 kB 6.21 kB +∞% 0.00 kB 1.87 kB
oss-stable/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.min.js +∞% 0.00 kB 1.07 kB +∞% 0.00 kB 0.60 kB
oss-stable/use-sync-external-store/shim/index.js +∞% 0.00 kB 0.24 kB +∞% 0.00 kB 0.16 kB
oss-stable/use-sync-external-store/shim/index.native.js +∞% 0.00 kB 0.25 kB +∞% 0.00 kB 0.17 kB
oss-stable/use-sync-external-store/shim/with-selector.js +∞% 0.00 kB 0.27 kB +∞% 0.00 kB 0.17 kB
oss-stable/use-sync-external-store/with-selector.js +∞% 0.00 kB 0.25 kB +∞% 0.00 kB 0.17 kB
oss-stable-semver/react/cjs/react.production.min.js +1.26% 7.21 kB 7.30 kB +0.71% 2.83 kB 2.85 kB
oss-stable/react/cjs/react.production.min.js +1.26% 7.21 kB 7.30 kB +0.71% 2.83 kB 2.85 kB
oss-stable-semver/react/umd/react.profiling.min.js +0.75% 11.26 kB 11.35 kB +0.47% 4.49 kB 4.51 kB
oss-stable/react/umd/react.profiling.min.js +0.75% 11.26 kB 11.35 kB +0.47% 4.49 kB 4.51 kB
oss-stable-semver/react/umd/react.production.min.js +0.75% 11.26 kB 11.35 kB +0.45% 4.49 kB 4.51 kB
oss-stable/react/umd/react.production.min.js +0.75% 11.26 kB 11.35 kB +0.45% 4.49 kB 4.51 kB
oss-stable-semver/react/cjs/react.development.js +0.28% 89.72 kB 89.98 kB +0.21% 24.24 kB 24.29 kB
oss-stable/react/cjs/react.development.js +0.28% 89.72 kB 89.98 kB +0.21% 24.24 kB 24.29 kB
oss-stable-semver/react/umd/react.development.js +0.24% 112.29 kB 112.55 kB +0.17% 28.84 kB 28.89 kB
oss-stable/react/umd/react.development.js +0.24% 112.29 kB 112.55 kB +0.17% 28.84 kB 28.89 kB
facebook-www/React-profiling.classic.js = 18.69 kB 18.60 kB = 4.66 kB 4.65 kB
facebook-www/React-profiling.modern.js = 18.54 kB 18.45 kB = 4.61 kB 4.60 kB
facebook-react-native/react/cjs/React-profiling.js = 18.47 kB 18.37 kB = 4.58 kB 4.57 kB
facebook-www/React-prod.classic.js = 17.54 kB 17.45 kB = 4.48 kB 4.47 kB
facebook-www/React-prod.modern.js = 17.40 kB 17.30 kB = 4.43 kB 4.43 kB
facebook-react-native/react/cjs/React-prod.js = 17.32 kB 17.22 kB = 4.40 kB 4.39 kB
oss-experimental/use-sync-external-store/cjs/use-sync-external-store.development.js = 8.64 kB 3.40 kB = 3.20 kB 1.32 kB
oss-stable-semver/use-sync-external-store/cjs/use-sync-external-store.development.js = 8.64 kB 3.40 kB = 3.20 kB 1.32 kB
oss-stable/use-sync-external-store/cjs/use-sync-external-store.development.js = 8.64 kB 3.40 kB = 3.20 kB 1.32 kB
oss-experimental/use-sync-external-store/cjs/use-sync-external-store.production.min.js = 1.04 kB 0.35 kB = 0.58 kB 0.25 kB
oss-stable-semver/use-sync-external-store/cjs/use-sync-external-store.production.min.js = 1.04 kB 0.35 kB = 0.58 kB 0.25 kB
oss-stable/use-sync-external-store/cjs/use-sync-external-store.production.min.js = 1.04 kB 0.35 kB = 0.58 kB 0.25 kB
oss-experimental/use-sync-external-store/cjs/use-sync-external-store-extra.development.js Deleted 6.23 kB 0.00 kB Deleted 1.88 kB 0.00 kB
oss-experimental/use-sync-external-store/cjs/use-sync-external-store-extra.production.min.js Deleted 1.09 kB 0.00 kB Deleted 0.60 kB 0.00 kB
oss-experimental/use-sync-external-store/cjs/use-sync-external-store.native.development.js Deleted 8.21 kB 0.00 kB Deleted 3.10 kB 0.00 kB
oss-experimental/use-sync-external-store/cjs/use-sync-external-store.native.production.min.js Deleted 0.84 kB 0.00 kB Deleted 0.51 kB 0.00 kB
oss-experimental/use-sync-external-store/extra.js Deleted 0.24 kB 0.00 kB Deleted 0.16 kB 0.00 kB
oss-experimental/use-sync-external-store/index.native.js Deleted 0.24 kB 0.00 kB Deleted 0.16 kB 0.00 kB
oss-stable-semver/use-sync-external-store/cjs/use-sync-external-store-extra.development.js Deleted 6.23 kB 0.00 kB Deleted 1.88 kB 0.00 kB
oss-stable-semver/use-sync-external-store/cjs/use-sync-external-store-extra.production.min.js Deleted 1.09 kB 0.00 kB Deleted 0.60 kB 0.00 kB
oss-stable-semver/use-sync-external-store/cjs/use-sync-external-store.native.development.js Deleted 8.21 kB 0.00 kB Deleted 3.10 kB 0.00 kB
oss-stable-semver/use-sync-external-store/cjs/use-sync-external-store.native.production.min.js Deleted 0.84 kB 0.00 kB Deleted 0.51 kB 0.00 kB
oss-stable-semver/use-sync-external-store/extra.js Deleted 0.24 kB 0.00 kB Deleted 0.16 kB 0.00 kB
oss-stable-semver/use-sync-external-store/index.native.js Deleted 0.24 kB 0.00 kB Deleted 0.16 kB 0.00 kB
oss-stable/use-sync-external-store/cjs/use-sync-external-store-extra.development.js Deleted 6.23 kB 0.00 kB Deleted 1.88 kB 0.00 kB
oss-stable/use-sync-external-store/cjs/use-sync-external-store-extra.production.min.js Deleted 1.09 kB 0.00 kB Deleted 0.60 kB 0.00 kB
oss-stable/use-sync-external-store/cjs/use-sync-external-store.native.development.js Deleted 8.21 kB 0.00 kB Deleted 3.10 kB 0.00 kB
oss-stable/use-sync-external-store/cjs/use-sync-external-store.native.production.min.js Deleted 0.84 kB 0.00 kB Deleted 0.51 kB 0.00 kB
oss-stable/use-sync-external-store/extra.js Deleted 0.24 kB 0.00 kB Deleted 0.16 kB 0.00 kB
oss-stable/use-sync-external-store/index.native.js Deleted 0.24 kB 0.00 kB Deleted 0.16 kB 0.00 kB

Generated by 🚫 dangerJS against 14d177f

@acdlite acdlite force-pushed the upgrade-usesyncexternalstore-to-alpha branch 2 times, most recently from 06817d9 to 3982cfe Compare October 31, 2021 22:11
Also renames `useSyncExternalStoreExtra` to
`useSyncExternalStoreWithSelector`.

- 'use-sync-external-store/shim' -> A shim for `useSyncExternalStore`
  that works in React 16 and 17 (any release that supports hooks). The
  module will first check if the built-in React API exists, before
  falling back to the shim.
- 'use-sync-external-store/with-selector' -> An extended version of
  `useSyncExternalStore` that also supports `selector` and `isEqual`
  options. It does _not_ shim `use-sync-external-store`; it composes the
  built-in React API. **Use this if you only support 18+.**
- 'use-sync-external-store/shim/with-selector' -> Same API, but it
  composes `use-sync-external-store/shim` instead. **Use this for
  compataibility with 16 and 17.**
- 'use-sync-external-store' -> Re-exports React's built-in API. Not
  meant to be used. It will warn and direct users to either the shim or
  the built-in API.
@acdlite acdlite force-pushed the upgrade-usesyncexternalstore-to-alpha branch from 3982cfe to 14d177f Compare October 31, 2021 22:23
@acdlite acdlite marked this pull request as ready for review October 31, 2021 22:37
@acdlite acdlite merged commit 6bce035 into facebook:main Oct 31, 2021
facebook-github-bot pushed a commit to facebook/react-native that referenced this pull request Nov 2, 2021
Summary:
This sync includes the following changes:
- **[5cccacd13](facebook/react@5cccacd13 )**: Upgrade useId to alpha channel ([#22674](facebook/react#22674)) //<Andrew Clark>//
- **[75f3ddebf](facebook/react@75f3ddebf )**: Remove experimental useOpaqueIdentifier API ([#22672](facebook/react#22672)) //<Andrew Clark>//
- **[8c4a05b8f](facebook/react@8c4a05b8f )**: Remove flow pragma comment from module registration start/stop templates ([#22670](facebook/react#22670)) //<Brian Vaughn>//
- **[ebf9ae857](facebook/react@ebf9ae857 )**: useId ([#22644](facebook/react#22644)) //<Andrew Clark>//
- **[a0d991fe6](facebook/react@a0d991fe6 )**: Re-land #22292 (remove uMS from open source build) ([#22664](facebook/react#22664)) //<Andrew Clark>//
- **[6bce0355c](facebook/react@6bce0355c )**: Upgrade useSyncExternalStore to alpha channel ([#22662](facebook/react#22662)) //<Andrew Clark>//
- **[7034408ff](facebook/react@7034408ff )**: Follow-up improvements to error code extraction infra ([#22516](facebook/react#22516)) //<Andrew Clark>//
- **[90e5d3638](facebook/react@90e5d3638 )**: chore: fix comment typo ([#22615](facebook/react#22615)) //<btea>//
- **[3c4c1c470](facebook/react@3c4c1c470 )**: Remove warning for dangling passive effects ([#22609](facebook/react#22609)) //<Andrew Clark>//
- **[d5b6b4b86](facebook/react@d5b6b4b86 )**: Expand act warning to cover all APIs that might schedule React work ([#22607](facebook/react#22607)) //<Andrew Clark>//
- **[fa9bea0c4](facebook/react@fa9bea0c4 )**: Initial implementation of cache cleanup ([#22510](facebook/react#22510)) //<Joseph Savona>//
- **[0e8a5aff3](facebook/react@0e8a5aff3 )**: Scheduling Profiler: Add marks for component effects (mount and unmount) ([#22578](facebook/react#22578)) //<Brian Vaughn>//
- **[4ba20579d](facebook/react@4ba20579d )**: Scheduling Profiler: De-emphasize React internal frames ([#22588](facebook/react#22588)) //<Brian Vaughn>//
- **[cdb8a1d19](facebook/react@cdb8a1d19 )**: [Fizz] Add option to inject bootstrapping script tags after the shell is injected ([#22594](facebook/react#22594)) //<Sebastian Markbåge>//
- **[34e4c9756](facebook/react@34e4c9756 )**: Clear extra nodes if there's a hydration mismatch within a suspense boundary  ([#22592](facebook/react#22592)) //<Sebastian Markbåge>//
- **[02f411578](facebook/react@02f411578 )**: Upgrade useInsertionEffect to stable ([#22589](facebook/react#22589)) //<Andrew Clark>//
- **[2af4a7933](facebook/react@2af4a7933 )**: Hydrate using SuspenseComponent as the parent ([#22582](facebook/react#22582)) //<Sebastian Markbåge>//
- **[b1acff0cc](facebook/react@b1acff0cc )**: Enable cache in test renderer ([#22580](facebook/react#22580)) //<Joseph Savona>//
- **[996da67b2](facebook/react@996da67b2 )**: Replace global `jest` heuristic with `IS_REACT_ACT_ENVIRONMENT` ([#22562](facebook/react#22562)) //<Andrew Clark>//
- **[163e81c1f](facebook/react@163e81c1f )**: Support disabling spurious act warnings with a global environment flag ([#22561](facebook/react#22561)) //<Andrew Clark>//
- **[23b7dfeff](facebook/react@23b7dfeff )**: Enable scheduling profiler for RN FB profiling builds ([#22566](facebook/react#22566)) //<Brian Vaughn>//
- **[61455a25b](facebook/react@61455a25b )**: Enable experimental Cache API in www TestRenderer ([#22554](facebook/react#22554)) //<Joseph Savona>//
- **[7142d110b](facebook/react@7142d110b )**: Bugfix: Nested useOpaqueIdentifier references ([#22553](facebook/react#22553)) //<Andrew Clark>//
- **[1e247ff89](facebook/react@1e247ff89 )**: Enabled scheduling profiler marks for React Native FB target ([#22544](facebook/react#22544)) //<Brian Vaughn>//
- **[c16b005f2](facebook/react@c16b005f2 )**: Update test and stack frame code to support newer V8 stack formats ([#22477](facebook/react#22477)) //<Brian Vaughn>//
- **[55d75005b](facebook/react@55d75005b )**: duplicate value in variable ([#22390](facebook/react#22390)) //<BIKI DAS>//

Changelog:
[General][Changed] - React Native sync for revisions afcb9cd...3fcd81d

jest_e2e[run_all_tests]

Reviewed By: yungsters

Differential Revision: D32065987

fbshipit-source-id: ef2d402835c981aab68ca40a894c66c1630864e9
KamranAsif pushed a commit to KamranAsif/react that referenced this pull request Nov 4, 2021
* Move useSyncExternalStore shim to a nested entrypoint

Also renames `useSyncExternalStoreExtra` to
`useSyncExternalStoreWithSelector`.

- 'use-sync-external-store/shim' -> A shim for `useSyncExternalStore`
  that works in React 16 and 17 (any release that supports hooks). The
  module will first check if the built-in React API exists, before
  falling back to the shim.
- 'use-sync-external-store/with-selector' -> An extended version of
  `useSyncExternalStore` that also supports `selector` and `isEqual`
  options. It does _not_ shim `use-sync-external-store`; it composes the
  built-in React API. **Use this if you only support 18+.**
- 'use-sync-external-store/shim/with-selector' -> Same API, but it
  composes `use-sync-external-store/shim` instead. **Use this for
  compatibility with 16 and 17.**
- 'use-sync-external-store' -> Re-exports React's built-in API. Not
  meant to be used. It will warn and direct users to either the shim or
  the built-in API.

* Upgrade useSyncExternalStore to alpha channel
facebook-github-bot pushed a commit to facebook/react-native that referenced this pull request Nov 15, 2021
Summary:
This sync includes the following changes:
- **[c0c71a868](facebook/react@c0c71a868 )**: Re-enable useMutableSource in internal RN ([#22750](facebook/react#22750)) //<Ricky>//
- **[cb11155c8](facebook/react@cb11155c8 )**: Add runtime type checks around module boundary code ([#22748](facebook/react#22748)) //<Brian Vaughn>//
- **[a04f13d29](facebook/react@a04f13d29 )**: react-refresh@0.11.0 //<Dan Abramov>//
- **[ff9897d23](facebook/react@ff9897d23 )**: [React Refresh] support typescript namespace syntax ([#22621](facebook/react#22621)) //<irinakk>//
- **[0ddd69d12](facebook/react@0ddd69d12 )**: Throw on hydration mismatch and force client rendering if boundary hasn't suspended within concurrent root ([#22629](facebook/react#22629)) //<salazarm>//
- **[c3f34e4be](facebook/react@c3f34e4be )**: eslint-plugin-react-hooks@4.3.0 //<Dan Abramov>//
- **[827021c4e](facebook/react@827021c4e )**: Changelog for eslint-plugin-react-hooks@4.3.0 //<Dan Abramov>//
- **[8ca3f567b](facebook/react@8ca3f567b )**: Fix module-boundary wrappers ([#22688](facebook/react#22688)) //<Brian Vaughn>//
- **[1bf6deb86](facebook/react@1bf6deb86 )**: Renamed packages/react-devtools-scheduling-profiler to packages/react-devtools-timeline ([#22691](facebook/react#22691)) //<Brian Vaughn>//
- **[51c558aeb](facebook/react@51c558aeb )**: Rename (some) "scheduling profiler" references to "timeline" ([#22690](facebook/react#22690)) //<Brian Vaughn>//
- **[00ced1e2b](facebook/react@00ced1e2b )**: Fix useId in strict mode ([#22681](facebook/react#22681)) //<Andrew Clark>//
- **[5cccacd13](facebook/react@5cccacd13 )**: Upgrade useId to alpha channel ([#22674](facebook/react#22674)) //<Andrew Clark>//
- **[75f3ddebf](facebook/react@75f3ddebf )**: Remove experimental useOpaqueIdentifier API ([#22672](facebook/react#22672)) //<Andrew Clark>//
- **[8c4a05b8f](facebook/react@8c4a05b8f )**: Remove flow pragma comment from module registration start/stop templates ([#22670](facebook/react#22670)) //<Brian Vaughn>//
- **[ebf9ae857](facebook/react@ebf9ae857 )**: useId ([#22644](facebook/react#22644)) //<Andrew Clark>//
- **[a0d991fe6](facebook/react@a0d991fe6 )**: Re-land #22292 (remove uMS from open source build) ([#22664](facebook/react#22664)) //<Andrew Clark>//
- **[6bce0355c](facebook/react@6bce0355c )**: Upgrade useSyncExternalStore to alpha channel ([#22662](facebook/react#22662)) //<Andrew Clark>//
- **[7034408ff](facebook/react@7034408ff )**: Follow-up improvements to error code extraction infra ([#22516](facebook/react#22516)) //<Andrew Clark>//
- **[90e5d3638](facebook/react@90e5d3638 )**: chore: fix comment typo ([#22615](facebook/react#22615)) //<btea>//
- **[3c4c1c470](facebook/react@3c4c1c470 )**: Remove warning for dangling passive effects ([#22609](facebook/react#22609)) //<Andrew Clark>//
- **[d5b6b4b86](facebook/react@d5b6b4b86 )**: Expand act warning to cover all APIs that might schedule React work ([#22607](facebook/react#22607)) //<Andrew Clark>//
- **[fa9bea0c4](facebook/react@fa9bea0c4 )**: Initial implementation of cache cleanup ([#22510](facebook/react#22510)) //<Joseph Savona>//
- **[0e8a5aff3](facebook/react@0e8a5aff3 )**: Scheduling Profiler: Add marks for component effects (mount and unmount) ([#22578](facebook/react#22578)) //<Brian Vaughn>//
- **[4ba20579d](facebook/react@4ba20579d )**: Scheduling Profiler: De-emphasize React internal frames ([#22588](facebook/react#22588)) //<Brian Vaughn>//
- **[cdb8a1d19](facebook/react@cdb8a1d19 )**: [Fizz] Add option to inject bootstrapping script tags after the shell is injected ([#22594](facebook/react#22594)) //<Sebastian Markbåge>//
- **[34e4c9756](facebook/react@34e4c9756 )**: Clear extra nodes if there's a hydration mismatch within a suspense boundary  ([#22592](facebook/react#22592)) //<Sebastian Markbåge>//
- **[02f411578](facebook/react@02f411578 )**: Upgrade useInsertionEffect to stable ([#22589](facebook/react#22589)) //<Andrew Clark>//
- **[2af4a7933](facebook/react@2af4a7933 )**: Hydrate using SuspenseComponent as the parent ([#22582](facebook/react#22582)) //<Sebastian Markbåge>//
- **[b1acff0cc](facebook/react@b1acff0cc )**: Enable cache in test renderer ([#22580](facebook/react#22580)) //<Joseph Savona>//
- **[996da67b2](facebook/react@996da67b2 )**: Replace global `jest` heuristic with `IS_REACT_ACT_ENVIRONMENT` ([#22562](facebook/react#22562)) //<Andrew Clark>//
- **[163e81c1f](facebook/react@163e81c1f )**: Support disabling spurious act warnings with a global environment flag ([#22561](facebook/react#22561)) //<Andrew Clark>//
- **[23b7dfeff](facebook/react@23b7dfeff )**: Enable scheduling profiler for RN FB profiling builds ([#22566](facebook/react#22566)) //<Brian Vaughn>//
- **[61455a25b](facebook/react@61455a25b )**: Enable experimental Cache API in www TestRenderer ([#22554](facebook/react#22554)) //<Joseph Savona>//
- **[7142d110b](facebook/react@7142d110b )**: Bugfix: Nested useOpaqueIdentifier references ([#22553](facebook/react#22553)) //<Andrew Clark>//
- **[1e247ff89](facebook/react@1e247ff89 )**: Enabled scheduling profiler marks for React Native FB target ([#22544](facebook/react#22544)) //<Brian Vaughn>//
- **[c16b005f2](facebook/react@c16b005f2 )**: Update test and stack frame code to support newer V8 stack formats ([#22477](facebook/react#22477)) //<Brian Vaughn>//
- **[55d75005b](facebook/react@55d75005b )**: duplicate value in variable ([#22390](facebook/react#22390)) //<BIKI DAS>//

Changelog:
[General][Changed] - React Native sync for revisions afcb9cd...c0c71a8

jest_e2e[run_all_tests]

Reviewed By: yungsters

Differential Revision: D32395873

fbshipit-source-id: 3afd158f167b1eedcc244e29aba1a2c502d3c9d9
zhengjitf pushed a commit to zhengjitf/react that referenced this pull request Apr 15, 2022
* Move useSyncExternalStore shim to a nested entrypoint

Also renames `useSyncExternalStoreExtra` to
`useSyncExternalStoreWithSelector`.

- 'use-sync-external-store/shim' -> A shim for `useSyncExternalStore`
  that works in React 16 and 17 (any release that supports hooks). The
  module will first check if the built-in React API exists, before
  falling back to the shim.
- 'use-sync-external-store/with-selector' -> An extended version of
  `useSyncExternalStore` that also supports `selector` and `isEqual`
  options. It does _not_ shim `use-sync-external-store`; it composes the
  built-in React API. **Use this if you only support 18+.**
- 'use-sync-external-store/shim/with-selector' -> Same API, but it
  composes `use-sync-external-store/shim` instead. **Use this for
  compatibility with 16 and 17.**
- 'use-sync-external-store' -> Re-exports React's built-in API. Not
  meant to be used. It will warn and direct users to either the shim or
  the built-in API.

* Upgrade useSyncExternalStore to alpha channel
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