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

Fix circular dependencies between shared, reconciler, and react directories #19971

Open
wants to merge 10 commits into
base: master
from

Conversation

@matthargett
Copy link

@matthargett matthargett commented Oct 6, 2020

Summary

In trying to align the Roblox Lua version of React (Roact), we came across some circular dependencies. After a brief Twitter conversation with @gaearon , we decided to take a crack at untangling them. The change looks large, but it is mostly tweaking import paths after moving files.

While I'm not sure 'shared' is the right place for some of these things, I think that being able to see the shape of things will make it clearer how these things could have reasonable cohesion, encapsulate detail, and not have any cycles.

It felt particularly good to delete some workaround in the rollup/build scripts that were only there to trick tools into not getting stuck on the circular dependencies. I'd like to be able to remove the ReactSharedInternals reference in react/React.js and just export is from react/index.js, but it looks like some of the tooling demands that it stay there. There were other little things I left in place like that, to not unnecessarily disrupt things.

Test Plan

On a MacBook Pro with node 14.12.0, there are a few tests that fail after a fresh checkout. I want to see if those come up in CI as well, or if it's something in my environment. Besides that caveat, ran all test, flow, lint, and prettier targets. As you'll see in the commits, a few of the circular dependencies were purely in types and had to be worked out.

matthargett added 10 commits Oct 4, 2020
… to push the __SECRET_INTERNALS symbol down to there as well, and remove the workaround for the circular dependency in the setupHostConfig and other places.
…ks workarounds for the circular dependency it needed.
…Fix up a few imports to be local, which reveals that the cohesion here is quite good. Next step is to move a few more files from shared/ into shared/src, for consistency and to eliminate a few import '..' smells.
… ReactFeatureFlags, as I'm wondering if we want to have a directory separate from src/ for that kind of file. (I also wondered if we might want a separate shared/types directory, but moved those anyway.) Nearly all changes are import path changes, with a couple snapshot updated that had implementation directory details in them.
…t *and* tests at every incremental step. This would have better distributed these changes into the appropriate commits.
…uded multiple times in UMD bundles. I'm not sure that's necessary anymore, as I see the workspace is hoisting the package appropriately. Adding the explicit dependencies in the relevant packages to fix the build for those packages, and hopefully simplify the build further.
@codesandbox
Copy link

@codesandbox codesandbox bot commented Oct 6, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit bdc954c:

Sandbox Source
React Configuration
@sizebot
Copy link

@sizebot sizebot commented Oct 6, 2020

Details of bundled changes.

Comparing: 4ead6b5...bdc954c

react

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-jsx-runtime.development.js +3.7% +3.3% 37.47 KB 38.86 KB 10.77 KB 11.12 KB NODE_DEV
JSXDEVRuntime-prod.js 🔺+14.3% 🔺+9.0% 509 B 582 B 332 B 362 B FB_WWW_PROD
react.development.js -0.5% -0.1% 112.43 KB 111.93 KB 27.23 KB 27.19 KB UMD_DEV
react-jsx-runtime.production.min.js 🔺+6.7% -1.1% 984 B 1.03 KB 614 B 607 B NODE_PROD
JSXDEVRuntime-profiling.js +14.3% +9.0% 509 B 582 B 332 B 362 B FB_WWW_PROFILING
JSXRuntime-prod.js 🔺+10.4% 🔺+5.4% 1.49 KB 1.65 KB 720 B 759 B RN_FB_PROD
JSXRuntime-profiling.js +10.4% +5.4% 1.49 KB 1.65 KB 720 B 759 B RN_FB_PROFILING
react-unstable-cache.development.js -1.8% -3.2% 1.05 KB 1.04 KB 587 B 568 B NODE_DEV
React-dev.js -0.0% -0.1% 89 KB 88.98 KB 21.17 KB 21.15 KB RN_FB_DEV
react-unstable-cache.production.min.js -2.2% -2.8% 867 B 848 B 562 B 546 B NODE_PROD
React-prod.js -0.2% -0.5% 17.14 KB 17.11 KB 4.54 KB 4.52 KB RN_FB_PROD
react-unstable-cache.profiling.min.js -2.2% -2.7% 866 B 847 B 561 B 546 B NODE_PROFILING
React-profiling.js -0.2% -0.5% 17.14 KB 17.11 KB 4.54 KB 4.52 KB RN_FB_PROFILING
react-jsx-dev-runtime.development.js +3.8% +3.3% 36.89 KB 38.28 KB 10.6 KB 10.95 KB NODE_DEV
react-jsx-dev-runtime.production.min.js -7.5% -5.1% 478 B 442 B 331 B 314 B NODE_PROD
react-jsx-dev-runtime.profiling.min.js -7.5% -4.8% 477 B 441 B 330 B 314 B NODE_PROFILING
JSXDEVRuntime-dev.js +3.4% +3.5% 39.91 KB 41.26 KB 11.11 KB 11.49 KB FB_WWW_DEV
react.production.min.js -0.2% -0.3% 12.3 KB 12.27 KB 4.79 KB 4.78 KB UMD_PROD
react-jsx-runtime.profiling.min.js +6.7% -1.1% 983 B 1.02 KB 614 B 607 B NODE_PROFILING
react.profiling.min.js -0.2% -0.3% 15.82 KB 15.78 KB 5.88 KB 5.86 KB UMD_PROFILING
react.development.js -0.2% -0.2% 74.26 KB 74.13 KB 19.67 KB 19.64 KB NODE_DEV
react.production.min.js -0.6% -0.8% 7.5 KB 7.45 KB 2.95 KB 2.92 KB NODE_PROD
JSXDEVRuntime-dev.js +4.5% +4.2% 31.82 KB 33.26 KB 8.99 KB 9.37 KB RN_FB_DEV
JSXDEVRuntime-prod.js 🔺+1.7% 🔺+3.2% 461 B 469 B 309 B 319 B RN_FB_PROD
React-dev.js -0.1% -0.2% 96.85 KB 96.74 KB 23.42 KB 23.37 KB FB_WWW_DEV
JSXDEVRuntime-profiling.js +1.7% +3.2% 461 B 469 B 309 B 319 B RN_FB_PROFILING
React-prod.js -0.1% -0.4% 16.88 KB 16.86 KB 4.37 KB 4.35 KB FB_WWW_PROD
React-profiling.js -0.1% -0.4% 16.88 KB 16.86 KB 4.37 KB 4.35 KB FB_WWW_PROFILING
JSXRuntime-dev.js +4.5% +4.1% 32.4 KB 33.85 KB 9.16 KB 9.54 KB RN_FB_DEV

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.development.js +0.1% +0.1% 909.01 KB 909.61 KB 206.63 KB 206.77 KB NODE_DEV
ReactDOMForked-prod.js 🔺+0.1% -0.1% 375.79 KB 376.21 KB 69.7 KB 69.67 KB FB_WWW_PROD
react-dom-server.node.development.js +1.1% +1.1% 138.57 KB 140.16 KB 36.58 KB 36.99 KB NODE_DEV
react-dom.production.min.js 🔺+0.4% -0.1% 122.43 KB 122.86 KB 39.36 KB 39.31 KB NODE_PROD
ReactDOMForked-profiling.js +0.1% -0.1% 390.34 KB 390.74 KB 72.29 KB 72.24 KB FB_WWW_PROFILING
react-dom-server.browser.development.js +4.1% +3.3% 144.73 KB 150.6 KB 36.77 KB 37.97 KB UMD_DEV
react-dom-server.node.production.min.js -11.0% -11.8% 20.66 KB 18.38 KB 7.65 KB 6.75 KB NODE_PROD
react-dom-test-utils.production.min.js -1.2% -0.9% 13.71 KB 13.54 KB 5.32 KB 5.28 KB UMD_PROD
ReactDOMTesting-dev.js +0.1% +0.2% 911.7 KB 913.07 KB 205.29 KB 205.67 KB FB_WWW_DEV
react-dom-test-utils.development.js +2.4% +2.1% 66.29 KB 67.91 KB 18.84 KB 19.24 KB NODE_DEV
ReactDOMTesting-prod.js 🔺+0.1% -0.1% 371.04 KB 371.39 KB 70.05 KB 70.01 KB FB_WWW_PROD
react-dom-unstable-fizz.node.development.js -0.3% -1.0% 5.52 KB 5.5 KB 1.84 KB 1.83 KB NODE_DEV
react-dom-test-utils.production.min.js 🔺+1.1% 🔺+0.3% 13.7 KB 13.84 KB 5.27 KB 5.28 KB NODE_PROD
react-dom-unstable-fizz.browser.development.js -0.4% -1.1% 5.25 KB 5.24 KB 1.78 KB 1.76 KB UMD_DEV
react-dom-unstable-fizz.node.production.min.js -1.6% -2.4% 1.17 KB 1.15 KB 666 B 650 B NODE_PROD
react-dom-unstable-fizz.browser.production.min.js -1.5% -2.5% 1.22 KB 1.2 KB 711 B 693 B UMD_PROD
ReactTestUtils-dev.js +2.3% +2.3% 60.91 KB 62.3 KB 16.79 KB 17.17 KB FB_WWW_DEV
react-dom-unstable-fizz.browser.development.js -0.4% -1.0% 4.78 KB 4.76 KB 1.68 KB 1.66 KB NODE_DEV
react-dom.development.js +0.3% +0.3% 955.22 KB 957.76 KB 209.18 KB 209.71 KB UMD_DEV
react-dom-unstable-fizz.browser.production.min.js -1.8% -2.6% 1.01 KB 1020 B 616 B 600 B NODE_PROD
react-dom.production.min.js -0.2% -0.1% 122.25 KB 122.03 KB 40.09 KB 40.04 KB UMD_PROD
react-dom.profiling.min.js -0.2% -0.1% 127.52 KB 127.28 KB 41.76 KB 41.73 KB UMD_PROFILING
ReactDOMForked-dev.js 0.0% +0.1% 971.42 KB 971.66 KB 215.95 KB 216.12 KB FB_WWW_DEV
react-dom.profiling.min.js +0.3% -0.1% 127.88 KB 128.29 KB 41.04 KB 40.98 KB NODE_PROFILING
react-dom-server.browser.production.min.js -11.2% -11.5% 20.34 KB 18.07 KB 7.55 KB 6.68 KB UMD_PROD
ReactDOM-dev.js 0.0% +0.1% 960.75 KB 960.9 KB 214.67 KB 214.82 KB FB_WWW_DEV
ReactDOM-prod.js 🔺+0.1% -0.0% 373.38 KB 373.8 KB 69.16 KB 69.13 KB FB_WWW_PROD
react-dom-server.browser.development.js +1.2% +1.1% 137.3 KB 138.89 KB 36.33 KB 36.74 KB NODE_DEV
ReactDOM-profiling.js +0.1% -0.1% 386.35 KB 386.75 KB 71.63 KB 71.58 KB FB_WWW_PROFILING
react-dom-server.browser.production.min.js -11.3% -11.9% 20.24 KB 17.96 KB 7.5 KB 6.6 KB NODE_PROD
ReactDOMServer-dev.js +0.9% +1.0% 141.48 KB 142.75 KB 36.29 KB 36.65 KB FB_WWW_DEV
ReactDOMServer-prod.js 🔺+0.5% 🔺+0.2% 46.44 KB 46.69 KB 10.83 KB 10.85 KB FB_WWW_PROD
react-dom-test-utils.development.js +6.1% +4.9% 71.48 KB 75.84 KB 19.36 KB 20.3 KB UMD_DEV

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactART-prod.js 🔺+0.2% -0.1% 232.96 KB 233.34 KB 41.18 KB 41.16 KB FB_WWW_PROD
react-art.development.js +0.5% +0.6% 691.29 KB 694.8 KB 146.6 KB 147.42 KB UMD_DEV
react-art.production.min.js -0.2% -0.2% 111.38 KB 111.18 KB 34.59 KB 34.53 KB UMD_PROD
react-art.development.js +0.3% +0.3% 592.44 KB 593.96 KB 128.72 KB 129.09 KB NODE_DEV
react-art.production.min.js 🔺+0.6% -0.2% 76.26 KB 76.72 KB 23.67 KB 23.63 KB NODE_PROD
ReactART-dev.js +0.2% +0.3% 618.81 KB 620.1 KB 131.51 KB 131.89 KB FB_WWW_DEV

react-cache

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-cache.development.js +20.9% +17.3% 8.23 KB 9.95 KB 2.77 KB 3.25 KB NODE_DEV
react-cache.production.min.js -0.9% -1.7% 2.15 KB 2.13 KB 1.1 KB 1.08 KB NODE_PROD

react-transport-dom-relay

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactFlightDOMRelayServer-dev.js +10.2% +10.0% 14.25 KB 15.7 KB 4 KB 4.4 KB FB_WWW_DEV
ReactFlightDOMRelayServer-prod.js 🔺+3.0% 🔺+1.8% 10.81 KB 11.14 KB 3.02 KB 3.07 KB FB_WWW_PROD

react-noop-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-noop-renderer-flight-server.development.js -1.0% -2.9% 1.83 KB 1.82 KB 825 B 801 B NODE_DEV
react-noop-renderer-flight-server.production.min.js -2.0% -3.6% 969 B 950 B 524 B 505 B NODE_PROD
react-noop-renderer.development.js +4.4% +4.8% 37.59 KB 39.25 KB 8.13 KB 8.53 KB NODE_DEV
react-noop-renderer.production.min.js -1.0% -2.5% 13.5 KB 13.36 KB 4.07 KB 3.97 KB NODE_PROD
react-noop-renderer-flight-client.development.js -1.3% -2.6% 1.48 KB 1.46 KB 722 B 703 B NODE_DEV
react-noop-renderer-flight-client.production.min.js -2.5% -4.0% 749 B 730 B 470 B 451 B NODE_PROD
react-noop-renderer-server.development.js -1.2% -2.5% 1.6 KB 1.58 KB 752 B 733 B NODE_DEV
react-noop-renderer-server.production.min.js -2.2% -4.0% 852 B 833 B 479 B 460 B NODE_PROD
react-noop-renderer-persistent.development.js +4.4% +4.9% 37.6 KB 39.26 KB 8.14 KB 8.53 KB NODE_DEV
react-noop-renderer-persistent.production.min.js -1.0% -2.5% 13.51 KB 13.37 KB 4.08 KB 3.98 KB NODE_PROD

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler.development.js +0.3% +0.3% 650 KB 651.67 KB 138.7 KB 139.08 KB NODE_DEV
react-reconciler-reflection.development.js +10.2% +8.6% 16.61 KB 18.3 KB 4.95 KB 5.38 KB NODE_DEV
react-reconciler.production.min.js 🔺+0.6% -0.2% 86.19 KB 86.7 KB 26.54 KB 26.49 KB NODE_PROD
react-reconciler-reflection.production.min.js -0.4% -0.9% 2.8 KB 2.79 KB 1.16 KB 1.14 KB NODE_PROD
react-reconciler.profiling.min.js +0.5% -0.1% 91.62 KB 92.11 KB 28.18 KB 28.15 KB NODE_PROFILING

react-test-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-test-renderer.development.js +0.4% +0.5% 605.58 KB 608.11 KB 127.63 KB 128.26 KB UMD_DEV
react-test-renderer.production.min.js -0.4% -0.2% 76.45 KB 76.13 KB 24 KB 23.95 KB UMD_PROD
react-test-renderer.development.js +0.3% +0.3% 576.86 KB 578.47 KB 126.15 KB 126.5 KB NODE_DEV
react-test-renderer.production.min.js 🔺+0.7% -0.2% 76.25 KB 76.76 KB 23.71 KB 23.65 KB NODE_PROD
ReactTestRenderer-dev.js +0.2% +0.3% 591.94 KB 593.31 KB 127.26 KB 127.7 KB FB_WWW_DEV
ReactTestRenderer-dev.js +0.3% +0.3% 586.63 KB 588.29 KB 127.04 KB 127.42 KB RN_FB_DEV
ReactTestRenderer-prod.js 0.0% -0.2% 228.96 KB 229.03 KB 41.81 KB 41.73 KB RN_FB_PROD
ReactTestRenderer-profiling.js 0.0% -0.1% 240.36 KB 240.43 KB 43.96 KB 43.9 KB RN_FB_PROFILING

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactNativeRenderer-dev.js +0.1% +0.1% 677.09 KB 677.53 KB 146.95 KB 147.05 KB RN_OSS_DEV
ReactNativeRenderer-prod.js 🔺+0.1% -0.1% 267.61 KB 267.88 KB 47.78 KB 47.73 KB RN_OSS_PROD
ReactNativeRenderer-profiling.js +0.1% -0.1% 279.14 KB 279.41 KB 49.98 KB 49.95 KB RN_OSS_PROFILING
ReactFabric-dev.js +0.2% +0.2% 657.84 KB 659.42 KB 142.31 KB 142.65 KB RN_OSS_DEV
ReactFabric-prod.js 🔺+0.1% -0.1% 261.45 KB 261.71 KB 46.51 KB 46.46 KB RN_OSS_PROD
ReactFabric-profiling.js +0.1% -0.1% 272.84 KB 273.1 KB 48.72 KB 48.66 KB RN_OSS_PROFILING

create-subscription

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
create-subscription.development.js +30.6% +21.3% 5.61 KB 7.33 KB 2.05 KB 2.49 KB NODE_DEV
create-subscription.production.min.js -1.0% -1.9% 1.94 KB 1.92 KB 967 B 949 B NODE_PROD

react-transport-dom-webpack

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-transport-dom-webpack-server-runtime.development.js -0.6% -1.4% 2.99 KB 2.97 KB 1.07 KB 1.06 KB NODE_DEV
react-transport-dom-webpack-server-runtime.production.min.js -3.7% -5.1% 513 B 494 B 350 B 332 B NODE_PROD
react-transport-dom-webpack.development.js -0.1% -0.4% 16.78 KB 16.76 KB 4.81 KB 4.79 KB UMD_DEV
react-transport-dom-webpack.production.min.js -0.5% -1.3% 3.69 KB 3.67 KB 1.71 KB 1.69 KB UMD_PROD
react-transport-dom-webpack.development.js -0.1% -0.5% 15.64 KB 15.62 KB 4.69 KB 4.67 KB NODE_DEV
react-transport-dom-webpack.production.min.js -0.5% -1.2% 3.49 KB 3.47 KB 1.61 KB 1.59 KB NODE_PROD
react-transport-dom-webpack-server.node.development.js -7.0% -7.3% 15 KB 13.94 KB 4.32 KB 4 KB NODE_DEV
react-transport-dom-webpack-server.browser.development.js +8.2% +3.0% 15.13 KB 16.37 KB 4.17 KB 4.29 KB UMD_DEV
react-transport-dom-webpack-server.node.production.min.js -10.1% -11.6% 4.78 KB 4.29 KB 2.09 KB 1.85 KB NODE_PROD
react-transport-dom-webpack-server.browser.production.min.js -9.2% -9.1% 4.81 KB 4.37 KB 2.15 KB 1.95 KB UMD_PROD
react-transport-dom-webpack-server.browser.development.js -7.5% -7.7% 14.06 KB 13 KB 4.05 KB 3.74 KB NODE_DEV
react-transport-dom-webpack-plugin.js -4.3% -6.0% 437 B 418 B 298 B 280 B NODE_ES2015
react-transport-dom-webpack-server.browser.production.min.js -10.5% -11.9% 4.6 KB 4.12 KB 2.05 KB 1.81 KB NODE_PROD

react-server

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-server-flight-server-runtime.development.js -0.6% -1.4% 2.98 KB 2.96 KB 1.06 KB 1.05 KB NODE_DEV
react-server-flight-server-runtime.production.min.js -3.8% -4.5% 505 B 486 B 337 B 322 B NODE_PROD
react-server-flight.development.js -7.2% -7.6% 14.59 KB 13.53 KB 4.21 KB 3.89 KB NODE_DEV
react-server-flight.production.min.js -9.9% -11.1% 4.88 KB 4.4 KB 2.14 KB 1.91 KB NODE_PROD
react-server.development.js -0.3% -1.0% 5.45 KB 5.43 KB 1.73 KB 1.71 KB NODE_DEV
react-server.production.min.js -1.6% -2.3% 1.16 KB 1.15 KB 649 B 634 B NODE_PROD

react-debug-tools

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-debug-tools.development.js +8.0% +7.2% 20.5 KB 22.15 KB 5.67 KB 6.08 KB NODE_DEV
react-debug-tools.production.min.js 🔺+1.2% -1.0% 5.48 KB 5.54 KB 2.13 KB 2.1 KB NODE_PROD

ReactDOM: size: -1.2%, gzip: -0.9%

React: size: -0.2%, gzip: -0.3%

Size changes (experimental)

Generated by 🚫 dangerJS against bdc954c

@sizebot
Copy link

@sizebot sizebot commented Oct 6, 2020

Details of bundled changes.

Comparing: 4ead6b5...bdc954c

react

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-jsx-runtime.development.js +3.7% +3.3% 37.46 KB 38.86 KB 10.77 KB 11.12 KB NODE_DEV
JSXDEVRuntime-prod.js 🔺+14.3% 🔺+9.0% 509 B 582 B 332 B 362 B FB_WWW_PROD
react.development.js -0.4% -0.0% 108.45 KB 107.97 KB 26.5 KB 26.5 KB UMD_DEV
react-jsx-runtime.production.min.js 🔺+8.1% 🔺+0.2% 971 B 1.03 KB 606 B 607 B NODE_PROD
JSXDEVRuntime-profiling.js +14.3% +9.0% 509 B 582 B 332 B 362 B FB_WWW_PROFILING
JSXRuntime-prod.js 🔺+10.4% 🔺+5.4% 1.49 KB 1.65 KB 720 B 759 B RN_FB_PROD
JSXRuntime-profiling.js +10.4% +5.4% 1.49 KB 1.65 KB 720 B 759 B RN_FB_PROFILING
React-dev.js -0.0% -0.1% 90 KB 89.99 KB 21.41 KB 21.39 KB RN_FB_DEV
React-prod.js -0.1% -0.1% 17.28 KB 17.27 KB 4.58 KB 4.57 KB RN_FB_PROD
React-profiling.js -0.1% -0.1% 17.28 KB 17.27 KB 4.58 KB 4.57 KB RN_FB_PROFILING
react-jsx-dev-runtime.development.js +3.8% +3.4% 36.88 KB 38.28 KB 10.59 KB 10.95 KB NODE_DEV
react-jsx-dev-runtime.production.min.js -4.9% -2.5% 465 B 442 B 322 B 314 B NODE_PROD
react-jsx-dev-runtime.profiling.min.js -5.0% -2.2% 464 B 441 B 321 B 314 B NODE_PROFILING
JSXDEVRuntime-dev.js +3.4% +3.5% 39.91 KB 41.26 KB 11.11 KB 11.49 KB FB_WWW_DEV
react.production.min.js -0.1% -0.4% 11.2 KB 11.19 KB 4.48 KB 4.46 KB UMD_PROD
react-jsx-runtime.profiling.min.js +8.1% +0.2% 970 B 1.02 KB 606 B 607 B NODE_PROFILING
react.profiling.min.js -0.1% -0.5% 14.71 KB 14.7 KB 5.56 KB 5.54 KB UMD_PROFILING
react.development.js -0.1% -0.2% 70.48 KB 70.38 KB 18.97 KB 18.94 KB NODE_DEV
react.production.min.js -0.3% -0.6% 6.33 KB 6.31 KB 2.62 KB 2.61 KB NODE_PROD
JSXDEVRuntime-dev.js +4.5% +4.2% 31.82 KB 33.26 KB 8.99 KB 9.37 KB RN_FB_DEV
JSXDEVRuntime-prod.js 🔺+1.7% 🔺+3.2% 461 B 469 B 309 B 319 B RN_FB_PROD
React-dev.js -0.1% -0.1% 97.84 KB 97.75 KB 23.64 KB 23.61 KB FB_WWW_DEV
JSXDEVRuntime-profiling.js +1.7% +3.2% 461 B 469 B 309 B 319 B RN_FB_PROFILING
React-prod.js -0.1% 0.0% 17.02 KB 17.01 KB 4.41 KB 4.41 KB FB_WWW_PROD
React-profiling.js -0.1% 0.0% 17.02 KB 17.01 KB 4.41 KB 4.41 KB FB_WWW_PROFILING
JSXRuntime-dev.js +4.5% +4.1% 32.4 KB 33.85 KB 9.16 KB 9.54 KB RN_FB_DEV

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.development.js +0.1% +0.1% 873.46 KB 874.08 KB 200.08 KB 200.24 KB NODE_DEV
ReactDOMForked-prod.js 🔺+0.1% -0.0% 387.12 KB 387.56 KB 71.44 KB 71.42 KB FB_WWW_PROD
react-dom-server.node.development.js +1.2% +1.1% 137.06 KB 138.67 KB 36.37 KB 36.79 KB NODE_DEV
react-dom.production.min.js 🔺+0.4% -0.1% 117.88 KB 118.36 KB 38.02 KB 37.97 KB NODE_PROD
ReactDOMForked-profiling.js +0.1% -0.0% 401.71 KB 402.15 KB 74 KB 73.99 KB FB_WWW_PROFILING
react-dom-server.browser.development.js +4.1% +3.3% 143.14 KB 149.04 KB 36.57 KB 37.78 KB UMD_DEV
react-dom-server.node.production.min.js -11.2% -11.8% 20.2 KB 17.95 KB 7.58 KB 6.68 KB NODE_PROD
react-dom-test-utils.production.min.js -1.1% -0.7% 13.7 KB 13.54 KB 5.31 KB 5.28 KB UMD_PROD
ReactDOMTesting-dev.js +0.2% +0.2% 940.04 KB 941.49 KB 210.76 KB 211.18 KB FB_WWW_DEV
react-dom-test-utils.development.js +2.5% +2.2% 66.28 KB 67.91 KB 18.84 KB 19.24 KB NODE_DEV
ReactDOMTesting-prod.js 🔺+0.1% -0.0% 384.11 KB 384.49 KB 72.23 KB 72.2 KB FB_WWW_PROD
react-dom-test-utils.production.min.js 🔺+1.2% 🔺+0.5% 13.68 KB 13.84 KB 5.26 KB 5.28 KB NODE_PROD
ReactTestUtils-dev.js +2.3% +2.3% 60.91 KB 62.3 KB 16.78 KB 17.17 KB FB_WWW_DEV
react-dom.development.js +0.3% +0.3% 917.91 KB 920.49 KB 202.6 KB 203.12 KB UMD_DEV
react-dom.production.min.js -0.2% -0.1% 117.78 KB 117.6 KB 38.74 KB 38.72 KB UMD_PROD
react-dom.profiling.min.js -0.1% -0.1% 121.68 KB 121.51 KB 39.91 KB 39.88 KB UMD_PROFILING
ReactDOMForked-dev.js 0.0% +0.1% 997.01 KB 997.32 KB 220.7 KB 220.91 KB FB_WWW_DEV
react-dom.profiling.min.js +0.4% -0.0% 121.96 KB 122.43 KB 39.2 KB 39.19 KB NODE_PROFILING
react-dom-server.browser.production.min.js -11.3% -11.5% 19.88 KB 17.63 KB 7.46 KB 6.61 KB UMD_PROD
ReactDOM-dev.js 0.0% +0.1% 986.33 KB 986.56 KB 219.35 KB 219.53 KB FB_WWW_DEV
ReactDOM-prod.js 🔺+0.1% -0.0% 384.64 KB 385.09 KB 70.85 KB 70.85 KB FB_WWW_PROD
react-dom-server.browser.development.js +1.2% +1.2% 135.79 KB 137.4 KB 36.12 KB 36.54 KB NODE_DEV
ReactDOM-profiling.js +0.1% -0.0% 397.66 KB 398.1 KB 73.27 KB 73.25 KB FB_WWW_PROFILING
react-dom-server.browser.production.min.js -11.4% -12.0% 19.78 KB 17.52 KB 7.42 KB 6.53 KB NODE_PROD
ReactDOMServer-dev.js +0.9% +1.0% 145.51 KB 146.87 KB 37.3 KB 37.68 KB FB_WWW_DEV
ReactDOMServer-prod.js 🔺+0.6% 🔺+0.3% 47.3 KB 47.57 KB 11.04 KB 11.07 KB FB_WWW_PROD
react-dom-test-utils.development.js +6.1% +4.9% 71.47 KB 75.84 KB 19.35 KB 20.3 KB UMD_DEV

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactART-prod.js 🔺+0.2% -0.0% 240.1 KB 240.5 KB 42.44 KB 42.43 KB FB_WWW_PROD
react-art.development.js +0.5% +0.6% 664.39 KB 667.92 KB 141.59 KB 142.41 KB UMD_DEV
react-art.production.min.js -0.2% -0.1% 108.49 KB 108.32 KB 33.71 KB 33.67 KB UMD_PROD
react-art.development.js +0.3% +0.3% 566.8 KB 568.35 KB 123.79 KB 124.17 KB NODE_DEV
react-art.production.min.js 🔺+0.7% -0.0% 73.43 KB 73.91 KB 22.82 KB 22.82 KB NODE_PROD
ReactART-dev.js +0.2% +0.3% 628.82 KB 630.12 KB 133.54 KB 133.93 KB FB_WWW_DEV

react-cache

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-cache.development.js +21.1% +17.6% 8.22 KB 9.95 KB 2.76 KB 3.25 KB NODE_DEV
react-cache.production.min.js -0.3% -0.8% 2.13 KB 2.13 KB 1.09 KB 1.08 KB NODE_PROD

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactNativeRenderer-dev.js +0.1% +0.1% 682.47 KB 682.93 KB 147.8 KB 147.93 KB RN_FB_DEV
ReactFabric-dev.js +0.2% +0.3% 663.23 KB 664.82 KB 143.16 KB 143.53 KB RN_FB_DEV
ReactNativeRenderer-dev.js +0.1% +0.1% 677.08 KB 677.53 KB 146.94 KB 147.05 KB RN_OSS_DEV
ReactFabric-prod.js 🔺+0.1% -0.1% 261.4 KB 261.67 KB 46.49 KB 46.45 KB RN_FB_PROD
ReactNativeRenderer-prod.js 🔺+0.1% -0.1% 267.6 KB 267.88 KB 47.77 KB 47.73 KB RN_OSS_PROD
ReactFabric-profiling.js +0.1% -0.1% 272.79 KB 273.06 KB 48.69 KB 48.64 KB RN_FB_PROFILING
ReactNativeRenderer-profiling.js +0.1% -0.0% 279.13 KB 279.41 KB 49.97 KB 49.95 KB RN_OSS_PROFILING
ReactNativeRenderer-prod.js 🔺+0.1% -0.1% 267.56 KB 267.83 KB 47.75 KB 47.71 KB RN_FB_PROD
ReactNativeRenderer-profiling.js +0.1% -0.0% 279.08 KB 279.36 KB 49.95 KB 49.93 KB RN_FB_PROFILING
ReactFabric-dev.js +0.2% +0.3% 657.83 KB 659.42 KB 142.3 KB 142.65 KB RN_OSS_DEV
ReactFabric-prod.js 🔺+0.1% -0.1% 261.44 KB 261.71 KB 46.51 KB 46.46 KB RN_OSS_PROD
ReactFabric-profiling.js +0.1% -0.1% 272.83 KB 273.1 KB 48.71 KB 48.66 KB RN_OSS_PROFILING

react-transport-dom-relay

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactFlightDOMRelayServer-dev.js +10.2% +10.0% 14.25 KB 15.7 KB 4 KB 4.4 KB FB_WWW_DEV
ReactFlightDOMRelayServer-prod.js 🔺+3.0% 🔺+1.8% 10.81 KB 11.14 KB 3.02 KB 3.07 KB FB_WWW_PROD

react-noop-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-noop-renderer-flight-server.development.js -0.3% -1.8% 1.82 KB 1.82 KB 816 B 801 B NODE_DEV
react-noop-renderer-flight-server.production.min.js -0.6% -1.9% 956 B 950 B 515 B 505 B NODE_PROD
react-noop-renderer.development.js +4.4% +5.0% 37.58 KB 39.25 KB 8.13 KB 8.53 KB NODE_DEV
react-noop-renderer.production.min.js -0.9% -2.3% 13.49 KB 13.36 KB 4.07 KB 3.97 KB NODE_PROD
react-noop-renderer-flight-client.development.js -0.4% -1.4% 1.46 KB 1.46 KB 713 B 703 B NODE_DEV
react-noop-renderer-flight-client.production.min.js -0.8% -2.2% 736 B 730 B 461 B 451 B NODE_PROD
react-noop-renderer-server.development.js -0.4% -1.3% 1.59 KB 1.58 KB 743 B 733 B NODE_DEV
react-noop-renderer-server.production.min.js -0.7% -2.3% 839 B 833 B 471 B 460 B NODE_PROD
react-noop-renderer-persistent.development.js +4.4% +5.0% 37.59 KB 39.26 KB 8.13 KB 8.53 KB NODE_DEV
react-noop-renderer-persistent.production.min.js -0.9% -2.3% 13.5 KB 13.37 KB 4.07 KB 3.98 KB NODE_PROD

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler.development.js +0.3% +0.3% 621.88 KB 623.58 KB 133.17 KB 133.57 KB NODE_DEV
react-reconciler-reflection.development.js +10.3% +8.7% 16.6 KB 18.3 KB 4.95 KB 5.38 KB NODE_DEV
react-reconciler.production.min.js 🔺+0.6% -0.2% 82.92 KB 83.44 KB 25.64 KB 25.6 KB NODE_PROD
react-reconciler-reflection.production.min.js 🔺+0.1% -0.2% 2.79 KB 2.79 KB 1.15 KB 1.14 KB NODE_PROD
react-reconciler.profiling.min.js +0.6% -0.2% 86.97 KB 87.5 KB 26.85 KB 26.8 KB NODE_PROFILING

react-test-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-test-renderer.development.js +0.4% +0.5% 605.55 KB 608.11 KB 127.62 KB 128.26 KB UMD_DEV
react-test-renderer.production.min.js -0.4% -0.1% 76.42 KB 76.13 KB 23.98 KB 23.95 KB UMD_PROD
react-test-renderer.development.js +0.3% +0.3% 576.84 KB 578.47 KB 126.13 KB 126.5 KB NODE_DEV
react-test-renderer.production.min.js 🔺+0.7% -0.2% 76.23 KB 76.76 KB 23.69 KB 23.65 KB NODE_PROD
ReactTestRenderer-dev.js +0.2% +0.3% 591.93 KB 593.31 KB 127.25 KB 127.7 KB FB_WWW_DEV
ReactTestRenderer-dev.js +0.3% +0.3% 586.61 KB 588.29 KB 127.03 KB 127.42 KB RN_FB_DEV
ReactTestRenderer-prod.js 0.0% -0.2% 228.94 KB 229.03 KB 41.8 KB 41.73 KB RN_FB_PROD
ReactTestRenderer-profiling.js 0.0% -0.1% 240.35 KB 240.43 KB 43.95 KB 43.9 KB RN_FB_PROFILING

create-subscription

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
create-subscription.development.js +30.9% +21.7% 5.6 KB 7.33 KB 2.05 KB 2.49 KB NODE_DEV
create-subscription.production.min.js -0.3% -1.0% 1.92 KB 1.92 KB 959 B 949 B NODE_PROD

react-transport-dom-webpack

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-transport-dom-webpack-server-runtime.development.js -0.2% -0.7% 2.98 KB 2.97 KB 1.07 KB 1.06 KB NODE_DEV
react-transport-dom-webpack-server-runtime.production.min.js -1.2% -2.6% 500 B 494 B 341 B 332 B NODE_PROD
react-transport-dom-webpack.development.js -0.0% -0.2% 16.77 KB 16.76 KB 4.8 KB 4.79 KB UMD_DEV
react-transport-dom-webpack.production.min.js -0.2% -0.6% 3.68 KB 3.67 KB 1.7 KB 1.69 KB UMD_PROD
react-transport-dom-webpack.development.js -0.0% -0.3% 15.63 KB 15.62 KB 4.68 KB 4.67 KB NODE_DEV
react-transport-dom-webpack.production.min.js -0.2% -0.5% 3.47 KB 3.47 KB 1.6 KB 1.59 KB NODE_PROD
react-transport-dom-webpack-server.node.development.js -7.0% -7.1% 14.99 KB 13.94 KB 4.31 KB 4 KB NODE_DEV
react-transport-dom-webpack-server.browser.development.js +8.3% +3.2% 15.12 KB 16.37 KB 4.16 KB 4.29 KB UMD_DEV
react-transport-dom-webpack-server.node.production.min.js -9.9% -11.3% 4.76 KB 4.29 KB 2.08 KB 1.85 KB NODE_PROD
react-transport-dom-webpack-server.browser.production.min.js -8.9% -8.8% 4.8 KB 4.37 KB 2.14 KB 1.95 KB UMD_PROD
react-transport-dom-webpack-server.browser.development.js -7.4% -7.5% 14.05 KB 13 KB 4.04 KB 3.74 KB NODE_DEV
react-transport-dom-webpack-plugin.js -1.4% -3.1% 424 B 418 B 289 B 280 B NODE_ES2015
react-transport-dom-webpack-server.browser.production.min.js -10.2% -11.6% 4.59 KB 4.12 KB 2.04 KB 1.81 KB NODE_PROD

react-server

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-server-flight-server-runtime.development.js -0.2% -0.7% 2.97 KB 2.96 KB 1.05 KB 1.05 KB NODE_DEV
react-server-flight-server-runtime.production.min.js -1.2% -2.1% 492 B 486 B 329 B 322 B NODE_PROD
react-server-flight.development.js -7.2% -7.4% 14.58 KB 13.53 KB 4.2 KB 3.89 KB NODE_DEV
react-server-flight.production.min.js -9.6% -10.7% 4.87 KB 4.4 KB 2.13 KB 1.91 KB NODE_PROD
react-server.development.js -0.1% -0.5% 5.43 KB 5.43 KB 1.72 KB 1.71 KB NODE_DEV
react-server.production.min.js -0.5% -1.1% 1.15 KB 1.15 KB 641 B 634 B NODE_PROD

react-debug-tools

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-debug-tools.development.js +8.1% +7.4% 20.49 KB 22.15 KB 5.67 KB 6.08 KB NODE_DEV
react-debug-tools.production.min.js 🔺+1.4% -0.6% 5.47 KB 5.54 KB 2.12 KB 2.1 KB NODE_PROD

ReactDOM: size: -1.1%, gzip: -0.7%

React: size: -0.1%, gzip: -0.4%

Size changes (stable)

Generated by 🚫 dangerJS against bdc954c

@gaearon
Copy link
Member

@gaearon gaearon commented Oct 7, 2020

Seems like CI is failing?

Also, could you please briefly describe the high level approach?

@gaearon
Copy link
Member

@gaearon gaearon commented Oct 9, 2020

Also, what's with the shared/ -> shared/src/ move? Why was it important?

@matthargett
Copy link
Author

@matthargett matthargett commented Oct 9, 2020

It wa

Also, what's with the shared/ -> shared/src/ move? Why was it important?

It wasn’t important, I was trying to get congruency with the other modules in the monorepo as I moved things. I’m happy to move them back to reduce the footprint of this PR.

@gaearon
Copy link
Member

@gaearon gaearon commented Oct 9, 2020

It wasn’t important, I was trying to get congruency with the other modules in the monorepo as I moved things. I’m happy to move them back to reduce the footprint of this PR.

Yeah that would be better. FWIW it was intentional that it had no src to highlight it's special and not an actual package.

As you'll see in the commits, a few of the circular dependencies were purely in types and had to be worked out.

This might also make sense to send as a separate PR so we don't conflate the real changes with types.

@matthargett
Copy link
Author

@matthargett matthargett commented Oct 11, 2020

@gaearon extracted the smaller slice you requested in #19997 . Once that is merged, I can rebase this one and we can see if it's then small enough, or if it requires another separate PR to be extracted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.