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

Unwind cycles reconciler fiber lanes #20256

Conversation

ZoteTheMighty
Copy link
Contributor

Summary

Following #20242, this PR untangles a slightly more elaborate cycle. In order to do so, I needed to make the types Lane, Lanes, LaneMap, and LanePriority into non-opaque types, which may go against their intent. Open to suggestions if there's a cleaner way to remove the cycle between ReactFiberLane and ReactInternalTypes that preserves the opaque tag.

Cycle detection

I used a tool called madge to detect cyclical imports. This change brings the number of cycles in the packages/react-reconciler package down from 50 to 48.

This eliminates the following cycles:

1) ReactFiberLane.js > ReactInternalTypes.js
2) ReactFiberLane.js > SchedulerWithReactIntegration.new.js

Test Plan

Since this change only affects the location of a type and constant definitions, there shouldn't be any need to add or change tests.

padoyle and others added 3 commits November 13, 2020 15:23
…eactInternalTypes. Necessitates making the Lane types non-opaque, very difficult to disentangle otherwise.
@codesandbox-ci
Copy link

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 f580128:

Sandbox Source
React Configuration

@sizebot
Copy link

sizebot commented Nov 14, 2020

Details of bundled changes.

Comparing: 765e89b...f580128

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom-test-utils.development.js 0.0% -0.0% 66.11 KB 66.11 KB 18.8 KB 18.79 KB NODE_DEV
ReactDOMTesting-dev.js -0.1% -0.1% 907.22 KB 906.62 KB 204.31 KB 204.11 KB FB_WWW_DEV
ReactDOM-dev.js -0.1% -0.2% 954.49 KB 953.22 KB 213.48 KB 213.04 KB FB_WWW_DEV
ReactDOM-prod.js -0.1% -0.1% 366.91 KB 366.7 KB 68.18 KB 68.13 KB FB_WWW_PROD
ReactDOM-profiling.js -0.1% -0.1% 383.26 KB 383.05 KB 71.16 KB 71.1 KB FB_WWW_PROFILING
react-dom-server.browser.development.js 0.0% -0.0% 144.37 KB 144.37 KB 36.71 KB 36.71 KB UMD_DEV
react-dom-server.node.development.js 0.0% -0.0% 138.23 KB 138.23 KB 36.52 KB 36.52 KB NODE_DEV
react-dom-server.browser.production.min.js 0.0% -0.0% 20.28 KB 20.28 KB 7.53 KB 7.53 KB UMD_PROD
react-dom-server.node.production.min.js 0.0% -0.0% 20.6 KB 20.6 KB 7.63 KB 7.63 KB NODE_PROD
react-dom-server.browser.development.js 0.0% -0.0% 136.96 KB 136.96 KB 36.27 KB 36.27 KB NODE_DEV
react-dom-test-utils.development.js 0.0% -0.0% 71.29 KB 71.29 KB 19.31 KB 19.31 KB UMD_DEV
ReactDOMServer-dev.js 0.0% -0.0% 141.4 KB 141.4 KB 36.3 KB 36.3 KB FB_WWW_DEV
ReactDOMServer-prod.js 0.0% -0.0% 46.28 KB 46.28 KB 10.79 KB 10.79 KB FB_WWW_PROD
react-dom-test-utils.production.min.js 0.0% 0.0% 13.7 KB 13.7 KB 5.26 KB 5.27 KB NODE_PROD
ReactDOMTesting-prod.js -0.0% -0.0% 368.38 KB 368.31 KB 69.79 KB 69.77 KB FB_WWW_PROD
react-dom.development.js -0.1% -0.2% 949.53 KB 948.35 KB 208.15 KB 207.7 KB UMD_DEV
react-dom.production.min.js -0.0% -0.0% 121.36 KB 121.35 KB 39.88 KB 39.86 KB UMD_PROD
react-dom.profiling.min.js -0.0% -0.0% 126.68 KB 126.62 KB 41.55 KB 41.53 KB UMD_PROFILING
react-dom-unstable-fizz.node.development.js 0.0% -0.2% 5.35 KB 5.35 KB 1.81 KB 1.8 KB NODE_DEV
react-dom.development.js -0.1% -0.2% 903.57 KB 902.4 KB 205.57 KB 205.16 KB NODE_DEV
ReactDOMForked-dev.js +0.1% +0.1% 953.19 KB 953.76 KB 212.89 KB 213.2 KB FB_WWW_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% -0.1% 1.22 KB 1.22 KB 713 B 712 B UMD_PROD
react-dom-unstable-fizz.node.production.min.js 0.0% -0.1% 1.17 KB 1.17 KB 668 B 667 B NODE_PROD
react-dom.production.min.js -0.0% -0.0% 121.53 KB 121.5 KB 39.14 KB 39.12 KB NODE_PROD
ReactDOMForked-prod.js 0.0% 🔺+0.1% 366.68 KB 366.7 KB 68.05 KB 68.13 KB FB_WWW_PROD
react-dom.profiling.min.js -0.1% -0.1% 127.04 KB 126.93 KB 40.83 KB 40.8 KB NODE_PROFILING
ReactDOMForked-profiling.js 0.0% +0.1% 383.03 KB 383.05 KB 71.04 KB 71.1 KB FB_WWW_PROFILING
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 4.6 KB 4.6 KB 1.64 KB 1.64 KB NODE_DEV

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactNativeRenderer-prod.js -0.0% -0.0% 267.46 KB 267.39 KB 47.75 KB 47.73 KB RN_OSS_PROD
ReactNativeRenderer-profiling.js -0.2% -0.0% 278.99 KB 278.51 KB 49.95 KB 49.92 KB RN_OSS_PROFILING
ReactFabric-dev.js -0.2% -0.1% 656.54 KB 655.19 KB 141.95 KB 141.8 KB RN_OSS_DEV
ReactFabric-prod.js -0.0% -0.0% 261.28 KB 261.21 KB 46.48 KB 46.47 KB RN_OSS_PROD
ReactFabric-profiling.js -0.2% -0.0% 272.67 KB 272.19 KB 48.68 KB 48.66 KB RN_OSS_PROFILING
ReactNativeRenderer-dev.js -0.2% -0.1% 675.79 KB 674.45 KB 146.59 KB 146.46 KB RN_OSS_DEV

react-test-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-test-renderer.development.js -0.2% -0.1% 604 KB 602.81 KB 127.28 KB 127.18 KB UMD_DEV
ReactTestRenderer-dev.js -0.2% -0.1% 585.03 KB 583.68 KB 126.67 KB 126.53 KB RN_FB_DEV
ReactTestRenderer-prod.js -0.0% -0.0% 228.59 KB 228.52 KB 41.74 KB 41.72 KB RN_FB_PROD
ReactTestRenderer-profiling.js -0.2% -0.0% 239.99 KB 239.51 KB 43.91 KB 43.89 KB RN_FB_PROFILING
react-test-renderer.production.min.js -0.0% -0.0% 76.24 KB 76.21 KB 23.97 KB 23.96 KB UMD_PROD
react-test-renderer.development.js -0.2% -0.1% 575.35 KB 574.19 KB 125.82 KB 125.71 KB NODE_DEV
react-test-renderer.production.min.js -0.0% -0.0% 76.04 KB 76.02 KB 23.68 KB 23.67 KB NODE_PROD
ReactTestRenderer-dev.js -0.2% -0.1% 590.38 KB 589.17 KB 126.91 KB 126.81 KB FB_WWW_DEV

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-art.production.min.js -0.0% -0.1% 75.54 KB 75.51 KB 23.49 KB 23.47 KB NODE_PROD
react-art.development.js -0.2% -0.0% 686.7 KB 685.52 KB 145.88 KB 145.82 KB UMD_DEV
react-art.production.min.js -0.1% -0.2% 110.66 KB 110.59 KB 34.41 KB 34.33 KB UMD_PROD
react-art.development.js -0.2% -0.1% 588.04 KB 586.87 KB 128.05 KB 127.95 KB NODE_DEV
ReactART-dev.js -0.2% -0.1% 621.55 KB 620.33 KB 132.39 KB 132.32 KB FB_WWW_DEV
ReactART-prod.js -0.1% -0.1% 230.09 KB 229.89 KB 40.87 KB 40.84 KB FB_WWW_PROD

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler-reflection.development.js 0.0% -0.0% 16.37 KB 16.37 KB 4.9 KB 4.9 KB NODE_DEV
react-reconciler-reflection.production.min.js 0.0% -0.1% 2.8 KB 2.8 KB 1.16 KB 1.16 KB NODE_PROD
react-reconciler.development.js -0.2% -0.1% 645.6 KB 644.43 KB 137.99 KB 137.9 KB NODE_DEV
react-reconciler.production.min.js -0.0% -0.1% 85.47 KB 85.44 KB 26.37 KB 26.35 KB NODE_PROD
react-reconciler.profiling.min.js -0.1% -0.0% 90.95 KB 90.84 KB 28.06 KB 28.05 KB NODE_PROFILING

ReactDOM: size: 0.0%, gzip: -0.0%

Size changes (experimental)

Generated by 🚫 dangerJS against f580128

@sizebot
Copy link

sizebot commented Nov 14, 2020

Details of bundled changes.

Comparing: 765e89b...f580128

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactDOMTesting-dev.js -0.1% -0.1% 935.56 KB 934.96 KB 209.81 KB 209.59 KB FB_WWW_DEV
ReactDOM-dev.js -0.1% -0.2% 980.07 KB 978.8 KB 218.17 KB 217.72 KB FB_WWW_DEV
ReactDOM-prod.js -0.1% -0.0% 378.17 KB 377.96 KB 69.95 KB 69.92 KB FB_WWW_PROD
ReactDOM-profiling.js -0.1% -0.0% 394.56 KB 394.36 KB 72.92 KB 72.89 KB FB_WWW_PROFILING
react-dom-server.browser.development.js 0.0% -0.0% 142.78 KB 142.78 KB 36.51 KB 36.51 KB UMD_DEV
react-dom-server.node.development.js 0.0% -0.0% 136.72 KB 136.72 KB 36.31 KB 36.31 KB NODE_DEV
react-dom-server.browser.production.min.js 0.0% -0.0% 19.82 KB 19.82 KB 7.44 KB 7.44 KB UMD_PROD
react-dom-server.node.production.min.js 0.0% -0.0% 20.14 KB 20.14 KB 7.56 KB 7.56 KB NODE_PROD
react-dom-server.browser.development.js 0.0% -0.0% 135.45 KB 135.45 KB 36.06 KB 36.06 KB NODE_DEV
react-dom-test-utils.development.js 0.0% -0.0% 71.28 KB 71.28 KB 19.3 KB 19.3 KB UMD_DEV
ReactDOMServer-dev.js 0.0% -0.0% 145.43 KB 145.43 KB 37.31 KB 37.31 KB FB_WWW_DEV
react-dom-test-utils.production.min.js 0.0% 0.0% 13.7 KB 13.7 KB 5.31 KB 5.32 KB UMD_PROD
ReactDOMServer-prod.js 0.0% -0.0% 47.15 KB 47.15 KB 11 KB 11 KB FB_WWW_PROD
react-dom-test-utils.production.min.js 0.0% 0.0% 13.68 KB 13.68 KB 5.26 KB 5.26 KB NODE_PROD
ReactDOMTesting-prod.js -0.0% -0.0% 381.45 KB 381.38 KB 72.01 KB 71.99 KB FB_WWW_PROD
react-dom.development.js -0.1% -0.2% 915.5 KB 914.32 KB 201.9 KB 201.43 KB UMD_DEV
react-dom.production.min.js -0.0% -0.0% 117.51 KB 117.5 KB 38.65 KB 38.64 KB UMD_PROD
react-dom.profiling.min.js -0.0% -0.1% 121.42 KB 121.36 KB 39.83 KB 39.8 KB UMD_PROFILING
react-dom.development.js -0.1% -0.2% 871.15 KB 869.98 KB 199.36 KB 198.92 KB NODE_DEV
ReactDOMForked-dev.js +0.1% +0.1% 978.77 KB 979.35 KB 217.68 KB 217.87 KB FB_WWW_DEV
react-dom.production.min.js -0.0% -0.0% 117.61 KB 117.58 KB 37.93 KB 37.92 KB NODE_PROD
ReactDOMForked-prod.js 0.0% 0.0% 377.94 KB 377.96 KB 69.92 KB 69.92 KB FB_WWW_PROD
react-dom.profiling.min.js -0.1% -0.1% 121.69 KB 121.58 KB 39.11 KB 39.07 KB NODE_PROFILING
ReactDOMForked-profiling.js 0.0% 0.0% 394.33 KB 394.36 KB 72.88 KB 72.89 KB FB_WWW_PROFILING

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactNativeRenderer-prod.js -0.0% -0.0% 267.45 KB 267.38 KB 47.74 KB 47.72 KB RN_OSS_PROD
ReactFabric-prod.js -0.0% -0.0% 261.23 KB 261.16 KB 46.46 KB 46.44 KB RN_FB_PROD
ReactNativeRenderer-profiling.js -0.2% -0.0% 278.98 KB 278.5 KB 49.94 KB 49.92 KB RN_OSS_PROFILING
ReactFabric-profiling.js -0.2% -0.0% 272.62 KB 272.14 KB 48.66 KB 48.63 KB RN_FB_PROFILING
ReactFabric-dev.js -0.2% -0.1% 656.53 KB 655.18 KB 141.94 KB 141.79 KB RN_OSS_DEV
ReactFabric-prod.js -0.0% -0.0% 261.27 KB 261.2 KB 46.47 KB 46.46 KB RN_OSS_PROD
ReactFabric-profiling.js -0.2% -0.0% 272.66 KB 272.18 KB 48.67 KB 48.65 KB RN_OSS_PROFILING
ReactNativeRenderer-dev.js -0.2% -0.1% 675.78 KB 674.43 KB 146.58 KB 146.45 KB RN_OSS_DEV
ReactFabric-dev.js -0.2% -0.1% 661.93 KB 660.58 KB 142.81 KB 142.67 KB RN_FB_DEV
ReactNativeRenderer-dev.js -0.2% -0.1% 681.17 KB 679.83 KB 147.46 KB 147.33 KB RN_FB_DEV
ReactNativeRenderer-prod.js -0.0% -0.0% 267.41 KB 267.33 KB 47.72 KB 47.7 KB RN_FB_PROD
ReactNativeRenderer-profiling.js -0.2% -0.0% 278.93 KB 278.45 KB 49.92 KB 49.9 KB RN_FB_PROFILING

react-test-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-test-renderer.development.js -0.2% -0.1% 603.97 KB 602.78 KB 127.26 KB 127.16 KB UMD_DEV
ReactTestRenderer-dev.js -0.2% -0.1% 585.01 KB 583.67 KB 126.66 KB 126.52 KB RN_FB_DEV
ReactTestRenderer-prod.js -0.0% -0.0% 228.58 KB 228.5 KB 41.74 KB 41.72 KB RN_FB_PROD
ReactTestRenderer-profiling.js -0.2% -0.0% 239.98 KB 239.5 KB 43.9 KB 43.88 KB RN_FB_PROFILING
react-test-renderer.production.min.js -0.0% -0.0% 76.22 KB 76.19 KB 23.95 KB 23.94 KB UMD_PROD
react-test-renderer.development.js -0.2% -0.1% 575.33 KB 574.16 KB 125.8 KB 125.7 KB NODE_DEV
react-test-renderer.production.min.js -0.0% -0.0% 76.02 KB 75.99 KB 23.67 KB 23.66 KB NODE_PROD
ReactTestRenderer-dev.js -0.2% -0.1% 590.37 KB 589.16 KB 126.9 KB 126.8 KB FB_WWW_DEV

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-art.production.min.js -0.0% -0.0% 73.33 KB 73.31 KB 22.82 KB 22.81 KB NODE_PROD
react-art.development.js -0.2% -0.1% 663.07 KB 661.89 KB 141.23 KB 141.15 KB UMD_DEV
react-art.production.min.js -0.1% -0.1% 108.39 KB 108.32 KB 33.68 KB 33.65 KB UMD_PROD
react-art.development.js -0.2% -0.1% 565.53 KB 564.36 KB 123.45 KB 123.34 KB NODE_DEV
ReactART-dev.js -0.2% -0.1% 631.56 KB 630.34 KB 134.42 KB 134.34 KB FB_WWW_DEV
ReactART-prod.js -0.1% -0.1% 237.23 KB 237.02 KB 42.13 KB 42.11 KB FB_WWW_PROD

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler-reflection.development.js 0.0% -0.0% 16.35 KB 16.35 KB 4.9 KB 4.9 KB NODE_DEV
react-reconciler-reflection.production.min.js 0.0% -0.1% 2.79 KB 2.79 KB 1.15 KB 1.15 KB NODE_PROD
react-reconciler.development.js -0.2% -0.1% 620.62 KB 619.45 KB 132.82 KB 132.72 KB NODE_DEV
react-reconciler.production.min.js -0.0% -0.1% 82.82 KB 82.79 KB 25.62 KB 25.61 KB NODE_PROD
react-reconciler.profiling.min.js -0.1% -0.0% 86.88 KB 86.77 KB 26.82 KB 26.81 KB NODE_PROFILING

ReactDOM: size: 0.0%, gzip: -0.0%

Size changes (stable)

Generated by 🚫 dangerJS against f580128

@stale
Copy link

stale bot commented Jan 9, 2022

This pull request has been automatically marked as stale. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated.

@stale stale bot added the Resolution: Stale Automatically closed due to inactivity label Jan 9, 2022
@sebmarkbage sebmarkbage deleted the branch facebook:master October 20, 2022 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Resolution: Stale Automatically closed due to inactivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants