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

Move useMemoCache hook to react/compiler-runtime #28954

Merged
merged 1 commit into from
Apr 30, 2024

Conversation

kassens
Copy link
Member

@kassens kassens commented Apr 29, 2024

Move useMemoCache hook to react/compiler-runtime

For Meta-internal purposes, we keep the export on react itself to reduce churn.

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Apr 29, 2024
@kassens kassens force-pushed the pr28954 branch 2 times, most recently from 290712f to 7f13ae3 Compare April 29, 2024 20:24
@react-sizebot
Copy link

react-sizebot commented Apr 29, 2024

Comparing: d779eba...10b2ec7

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.js = 6.66 kB 6.66 kB = 1.82 kB 1.82 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.67 kB 6.67 kB = 1.83 kB 1.83 kB
facebook-www/ReactDOM-prod.classic.js = 591.11 kB 591.11 kB = 103.94 kB 103.94 kB
facebook-www/ReactDOM-prod.modern.js = 567.33 kB 567.33 kB = 100.34 kB 100.34 kB
oss-experimental/react/cjs/react-compiler-runtime.development.js +∞% 0.00 kB 2.60 kB +∞% 0.00 kB 1.31 kB
oss-experimental/react/cjs/react-compiler-runtime.production.js +∞% 0.00 kB 0.46 kB +∞% 0.00 kB 0.33 kB
oss-experimental/react/cjs/react-compiler-runtime.profiling.js +∞% 0.00 kB 0.46 kB +∞% 0.00 kB 0.33 kB
oss-experimental/react/compiler-runtime.js +∞% 0.00 kB 0.41 kB +∞% 0.00 kB 0.27 kB
oss-stable-semver/react/cjs/react-compiler-runtime.development.js +∞% 0.00 kB 2.60 kB +∞% 0.00 kB 1.31 kB
oss-stable-semver/react/cjs/react-compiler-runtime.production.js +∞% 0.00 kB 0.46 kB +∞% 0.00 kB 0.33 kB
oss-stable-semver/react/cjs/react-compiler-runtime.profiling.js +∞% 0.00 kB 0.46 kB +∞% 0.00 kB 0.33 kB
oss-stable-semver/react/compiler-runtime.js +∞% 0.00 kB 0.41 kB +∞% 0.00 kB 0.27 kB
oss-stable/react/cjs/react-compiler-runtime.development.js +∞% 0.00 kB 2.60 kB +∞% 0.00 kB 1.31 kB
oss-stable/react/cjs/react-compiler-runtime.production.js +∞% 0.00 kB 0.46 kB +∞% 0.00 kB 0.33 kB
oss-stable/react/cjs/react-compiler-runtime.profiling.js +∞% 0.00 kB 0.46 kB +∞% 0.00 kB 0.33 kB
oss-stable/react/compiler-runtime.js +∞% 0.00 kB 0.41 kB +∞% 0.00 kB 0.27 kB
test_utils/ReactAllWarnings.js Deleted 64.26 kB 0.00 kB Deleted 16.02 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/react/cjs/react-compiler-runtime.development.js +∞% 0.00 kB 2.60 kB +∞% 0.00 kB 1.31 kB
oss-experimental/react/cjs/react-compiler-runtime.production.js +∞% 0.00 kB 0.46 kB +∞% 0.00 kB 0.33 kB
oss-experimental/react/cjs/react-compiler-runtime.profiling.js +∞% 0.00 kB 0.46 kB +∞% 0.00 kB 0.33 kB
oss-experimental/react/compiler-runtime.js +∞% 0.00 kB 0.41 kB +∞% 0.00 kB 0.27 kB
oss-stable-semver/react/cjs/react-compiler-runtime.development.js +∞% 0.00 kB 2.60 kB +∞% 0.00 kB 1.31 kB
oss-stable-semver/react/cjs/react-compiler-runtime.production.js +∞% 0.00 kB 0.46 kB +∞% 0.00 kB 0.33 kB
oss-stable-semver/react/cjs/react-compiler-runtime.profiling.js +∞% 0.00 kB 0.46 kB +∞% 0.00 kB 0.33 kB
oss-stable-semver/react/compiler-runtime.js +∞% 0.00 kB 0.41 kB +∞% 0.00 kB 0.27 kB
oss-stable/react/cjs/react-compiler-runtime.development.js +∞% 0.00 kB 2.60 kB +∞% 0.00 kB 1.31 kB
oss-stable/react/cjs/react-compiler-runtime.production.js +∞% 0.00 kB 0.46 kB +∞% 0.00 kB 0.33 kB
oss-stable/react/cjs/react-compiler-runtime.profiling.js +∞% 0.00 kB 0.46 kB +∞% 0.00 kB 0.33 kB
oss-stable/react/compiler-runtime.js +∞% 0.00 kB 0.41 kB +∞% 0.00 kB 0.27 kB
facebook-react-native/react/cjs/React-prod.js +0.23% 21.88 kB 21.93 kB +0.21% 5.74 kB 5.75 kB
facebook-react-native/react/cjs/React-profiling.js +0.23% 22.32 kB 22.37 kB +0.21% 5.81 kB 5.83 kB
facebook-www/React-prod.modern.js +0.22% 22.68 kB 22.73 kB +0.33% 5.84 kB 5.86 kB
facebook-www/React-prod.classic.js +0.22% 22.68 kB 22.73 kB +0.31% 5.84 kB 5.86 kB
facebook-www/React-profiling.modern.js +0.22% 23.12 kB 23.17 kB +0.29% 5.92 kB 5.93 kB
facebook-www/React-profiling.classic.js +0.22% 23.12 kB 23.17 kB +0.29% 5.92 kB 5.94 kB
facebook-react-native/react-test-renderer/cjs/ReactTestRenderer-profiling.js +0.20% 337.57 kB 338.26 kB +0.15% 58.62 kB 58.71 kB
react-native/implementations/ReactFabric-profiling.js = 337.01 kB 336.31 kB = 58.35 kB 58.26 kB
react-native/implementations/ReactFabric-prod.js = 309.96 kB 309.25 kB = 54.16 kB 54.08 kB
oss-experimental/react/cjs/react.development.js = 95.17 kB 94.95 kB = 26.01 kB 25.98 kB
oss-stable/react-test-renderer/cjs/react-test-renderer.production.js = 298.34 kB 296.89 kB = 53.03 kB 52.73 kB
oss-stable-semver/react-test-renderer/cjs/react-test-renderer.production.js = 298.29 kB 296.84 kB = 53.00 kB 52.70 kB
oss-stable/react-test-renderer/cjs/react-test-renderer.development.js = 805.02 kB 800.93 kB = 175.53 kB 174.55 kB
oss-stable-semver/react-test-renderer/cjs/react-test-renderer.development.js = 804.99 kB 800.90 kB = 175.50 kB 174.52 kB
oss-experimental/react/cjs/react.production.js = 18.01 kB 17.91 kB = 4.68 kB 4.66 kB
test_utils/ReactAllWarnings.js Deleted 64.26 kB 0.00 kB Deleted 16.02 kB 0.00 kB

Generated by 🚫 dangerJS against 10b2ec7

@kassens kassens force-pushed the pr28954 branch 2 times, most recently from d7bae39 to e2aa58f Compare April 29, 2024 23:37
@kassens kassens requested a review from acdlite April 29, 2024 23:47
@kassens kassens marked this pull request as ready for review April 29, 2024 23:47
@kassens kassens force-pushed the pr28954 branch 2 times, most recently from 7fd1a59 to 50f76da Compare April 29, 2024 23:53
@@ -36,7 +36,7 @@ export const disableTextareaChildren = false;
export const enableSuspenseAvoidThisFallback = false;
export const enableSuspenseAvoidThisFallbackFizz = false;
export const enableCPUSuspense = false;
export const enableUseMemoCacheHook = true;
export const enableUseMemoCacheHook = __EXPERIMENTAL__;
Copy link
Member Author

Choose a reason for hiding this comment

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

This needs to match as a bundle test is using the test renderer and asserting this isn't available in non-experimental.

For Meta-internal purposes, we keep the export on `react` itself to reduce churn.

// export to match the name of the OSS function typically exported from
// react/compiler-runtime
export {useMemoCache as c} from './src/ReactHooks';
Copy link
Member

Choose a reason for hiding this comment

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

I think @acdlite and @gnoff may have suggested the idea of moving the impl as well into it's own package and dynamically injecting it into the dispatcher iirc. This feels okay to me as a first step though

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure that's possible as useMemoCache adds an extra field to the fiber.

I think what we can look into is how this should look in the server build. We might iterate on that as the server build should probably have a noop use memo cache or not even use the transform.

@kassens kassens merged commit 4508873 into facebook:main Apr 30, 2024
38 checks passed
github-actions bot pushed a commit that referenced this pull request Apr 30, 2024
Move useMemoCache hook to react/compiler-runtime

For Meta-internal purposes, we keep the export on `react` itself to
reduce churn.

DiffTrain build for commit 4508873.
github-actions bot pushed a commit that referenced this pull request Apr 30, 2024
Move useMemoCache hook to react/compiler-runtime

For Meta-internal purposes, we keep the export on `react` itself to
reduce churn.

DiffTrain build for [4508873](4508873)
hoxyq added a commit that referenced this pull request May 8, 2024
Full list of changes (not a public changelog):
* fix[react-devtools/ci]: fix configurations for e2e testing
([hoxyq](https://github.com/hoxyq) in
[#29016](#29016))
* feat[react-devtools]: display forget badge for components in profiling
session ([hoxyq](https://github.com/hoxyq) in
[#29014](#29014))
* fix[react-devtools]: add backwards compat with legacy element type
symbol ([hoxyq](https://github.com/hoxyq) in
[#28982](#28982))
* Expose "view source" options to Fusebox integration
([motiz88](https://github.com/motiz88) in
[#28973](#28973))
* Enable inspected element context menu in Fusebox
([motiz88](https://github.com/motiz88) in
[#28972](#28972))
* Check in `frontend.d.ts` for react-devtools-fusebox, include in build
output ([motiz88](https://github.com/motiz88) in
[#28970](#28970))
* Devtools: Fix build-for-devtools
([eps1lon](https://github.com/eps1lon) in
[#28976](#28976))
* Move useMemoCache hook to react/compiler-runtime
([kassens](https://github.com/kassens) in
[#28954](#28954))
* warn -> error for Test Renderer deprecation
([acdlite](https://github.com/acdlite) in
[#28904](#28904))
* [react-dom] move all client code to `react-dom/client`
([gnoff](https://github.com/gnoff) in
[#28271](#28271))
* Rename the react.element symbol to react.transitional.element
([sebmarkbage](https://github.com/sebmarkbage) in
[#28813](#28813))
* Rename Forget badge ([jbonta](https://github.com/jbonta) in
[#28858](#28858))
* Devtools: Add support for useFormStatus
([eps1lon](https://github.com/eps1lon) in
[#28413](#28413))
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.

None yet

5 participants