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

Enable modern event system and delete dead code #19230

Merged
merged 1 commit into from Jul 1, 2020
Merged

Conversation

@gaearon
Copy link
Member

gaearon commented Jul 1, 2020

In #19228, I forked legacy event system folder for DOM and Native.
In this PR, I am removing the enableModernEventSystem flag altogether:

  • In DOM fork, I am removing all its falsy branches and consider enableModernEventSystem = true.
  • In Native, we remove all its truthy branches and consider enableModernEventSystem = false.

This enables us to remove a bunch of files and codepaths in DOM. There's more to do there but this is already fairly invasive so I will send the rest as follow-ups.

You should review without whitespace. https://github.com/facebook/react/pull/19230/files?diff=split&w=1

@codesandbox
Copy link

codesandbox bot commented Jul 1, 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 d04cd4d:

Sandbox Source
confident-sutherland-295iw Configuration
ReactDOM = require('react-dom');
Scheduler = require('scheduler');
});

// @gate experimental
it('flushes pending interactive work before extracting event handler', () => {
container = document.createElement('div');
const root = ReactDOM.unstable_createRoot(container);
const root = ReactDOM.createRoot(container);

This comment has been minimized.

Copy link
@gaearon

gaearon Jul 1, 2020

Author Member

I didn't change this one. Git just thinks I renamed it whereas I actually deleted old test.

Kind of confusing why it uses unprefixed name. I thought that doesn't work anymore.

@sizebot
Copy link

sizebot commented Jul 1, 2020

Details of bundled changes.

Comparing: e3f4eb7...d04cd4d

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.development.js -1.4% -1.4% 925.54 KB 912.92 KB 210.55 KB 207.58 KB NODE_DEV
ReactDOMForked-prod.js -0.2% 🔺+0.1% 395.83 KB 395.19 KB 73.44 KB 73.54 KB FB_WWW_PROD
react-dom-server.node.development.js 0.0% -0.0% 138.65 KB 138.65 KB 36.67 KB 36.67 KB NODE_DEV
react-dom.production.min.js -1.5% -0.8% 126.87 KB 124.93 KB 40.36 KB 40.04 KB NODE_PROD
ReactDOMForked-profiling.js -0.2% +0.1% 406.37 KB 405.72 KB 75.21 KB 75.31 KB FB_WWW_PROFILING
react-dom-server.browser.development.js 0.0% -0.0% 144.83 KB 144.83 KB 36.87 KB 36.87 KB UMD_DEV
react-dom-test-utils.production.min.js -24.8% -21.7% 13.18 KB 9.92 KB 4.9 KB 3.84 KB UMD_PROD
ReactDOMTesting-dev.js -1.3% -1.4% 955.04 KB 942.16 KB 214.78 KB 211.7 KB FB_WWW_DEV
react-dom-test-utils.development.js -22.7% -19.9% 70.62 KB 54.59 KB 19.72 KB 15.79 KB NODE_DEV
ReactDOMTesting-prod.js -0.4% -0.2% 395.13 KB 393.5 KB 74.55 KB 74.4 KB FB_WWW_PROD
react-dom-test-utils.production.min.js -25.1% -21.8% 13.06 KB 9.78 KB 4.8 KB 3.76 KB NODE_PROD
react-dom-unstable-fizz.browser.development.js 0.0% -0.1% 5.36 KB 5.36 KB 1.8 KB 1.8 KB UMD_DEV
react-dom-unstable-fizz.node.production.min.js 0.0% -0.3% 1.17 KB 1.17 KB 667 B 665 B NODE_PROD
react-dom-unstable-fizz.browser.production.min.js 0.0% -0.3% 1.2 KB 1.2 KB 706 B 704 B UMD_PROD
ReactTestUtils-dev.js -5.6% -5.5% 51.28 KB 48.4 KB 14.38 KB 13.59 KB FB_WWW_DEV
react-dom-unstable-fizz.browser.development.js 0.0% -0.1% 4.87 KB 4.87 KB 1.7 KB 1.7 KB NODE_DEV
react-dom.development.js -1.4% -1.5% 972.54 KB 959.01 KB 213.29 KB 210.14 KB UMD_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% -0.3% 1.01 KB 1.01 KB 617 B 615 B NODE_PROD
react-dom.production.min.js -1.5% -1.4% 126.65 KB 124.71 KB 41.26 KB 40.7 KB UMD_PROD
react-dom.profiling.min.js -1.5% -1.2% 130.62 KB 128.67 KB 42.43 KB 41.93 KB UMD_PROFILING
ReactDOMForked-dev.js -0.0% +0.2% 974.64 KB 974.49 KB 217.73 KB 218.15 KB FB_WWW_DEV
react-dom.profiling.min.js -1.5% -0.7% 131 KB 129.06 KB 41.54 KB 41.25 KB NODE_PROFILING
ReactDOM-dev.js -0.0% +0.2% 981.75 KB 981.59 KB 219.03 KB 219.43 KB FB_WWW_DEV
ReactDOM-prod.js -0.2% 🔺+0.1% 396.03 KB 395.38 KB 73.45 KB 73.55 KB FB_WWW_PROD
ReactDOM-profiling.js -0.2% +0.1% 406.56 KB 405.92 KB 75.22 KB 75.33 KB FB_WWW_PROFILING
react-dom-server.browser.production.min.js 0.0% -0.0% 20.26 KB 20.26 KB 7.51 KB 7.51 KB NODE_PROD
react-dom-test-utils.development.js -21.9% -19.5% 75.82 KB 59.2 KB 20.22 KB 16.29 KB UMD_DEV

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactNativeRenderer-dev.js -0.1% -0.0% 685.03 KB 684.6 KB 148.2 KB 148.13 KB RN_FB_DEV
ReactFabric-dev.js -0.1% -0.0% 665.75 KB 665.32 KB 143.55 KB 143.49 KB RN_FB_DEV
ReactNativeRenderer-dev.js -0.1% -0.0% 680.15 KB 679.72 KB 147.44 KB 147.38 KB RN_OSS_DEV
ReactFabric-profiling.js 0.0% -0.0% 277.36 KB 277.36 KB 49.23 KB 49.23 KB RN_FB_PROFILING
ReactNativeRenderer-profiling.js 0.0% -0.0% 283.65 KB 283.65 KB 50.49 KB 50.49 KB RN_OSS_PROFILING
ReactNativeRenderer-prod.js 0.0% -0.0% 272.1 KB 272.1 KB 48.27 KB 48.27 KB RN_FB_PROD
ReactNativeRenderer-profiling.js 0.0% -0.0% 283.6 KB 283.6 KB 50.47 KB 50.47 KB RN_FB_PROFILING
ReactFabric-dev.js -0.1% -0.0% 660.86 KB 660.43 KB 142.78 KB 142.72 KB RN_OSS_DEV
ReactFabric-profiling.js 0.0% -0.0% 277.4 KB 277.4 KB 49.24 KB 49.24 KB RN_OSS_PROFILING

ReactDOM: size: -24.8%, gzip: -21.7%

Size changes (experimental)

Generated by 🚫 dangerJS against d04cd4d

@sizebot
Copy link

sizebot commented Jul 1, 2020

Details of bundled changes.

Comparing: e3f4eb7...d04cd4d

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.development.js -1.4% -1.4% 895.11 KB 882.49 KB 204.97 KB 202.07 KB NODE_DEV
ReactDOMForked-prod.js -0.2% 0.0% 407.02 KB 406.38 KB 75.28 KB 75.29 KB FB_WWW_PROD
react-dom-server.node.development.js 0.0% -0.0% 137.14 KB 137.14 KB 36.46 KB 36.46 KB NODE_DEV
react-dom.production.min.js -1.6% -0.8% 122.4 KB 120.47 KB 39.06 KB 38.75 KB NODE_PROD
ReactDOMForked-profiling.js -0.2% 0.0% 417.61 KB 416.98 KB 77.06 KB 77.07 KB FB_WWW_PROFILING
react-dom-test-utils.production.min.js -24.8% -21.7% 13.17 KB 9.91 KB 4.89 KB 3.83 KB UMD_PROD
ReactDOMTesting-dev.js -1.1% -1.3% 980.83 KB 970.18 KB 220.42 KB 217.59 KB FB_WWW_DEV
react-dom-test-utils.development.js -22.7% -19.9% 70.61 KB 54.58 KB 19.71 KB 15.78 KB NODE_DEV
ReactDOMTesting-prod.js -0.0% 0.0% 407.1 KB 407.03 KB 76.51 KB 76.53 KB FB_WWW_PROD
react-dom-test-utils.production.min.js -25.1% -21.8% 13.05 KB 9.77 KB 4.8 KB 3.75 KB NODE_PROD
ReactTestUtils-dev.js -5.6% -5.5% 51.28 KB 48.4 KB 14.37 KB 13.59 KB FB_WWW_DEV
react-dom.development.js -1.4% -1.5% 940.75 KB 927.23 KB 207.65 KB 204.53 KB UMD_DEV
react-dom.production.min.js -1.6% -1.4% 122.26 KB 120.31 KB 39.95 KB 39.4 KB UMD_PROD
react-dom.profiling.min.js -1.5% -1.2% 126.17 KB 124.23 KB 41.11 KB 40.6 KB UMD_PROFILING
ReactDOMForked-dev.js -0.0% -0.1% 1000.19 KB 1000.03 KB 223.55 KB 223.29 KB FB_WWW_DEV
react-dom.profiling.min.js -1.5% -0.8% 126.48 KB 124.55 KB 40.29 KB 39.98 KB NODE_PROFILING
ReactDOM-dev.js -0.0% -0.1% 1007.3 KB 1007.14 KB 224.83 KB 224.57 KB FB_WWW_DEV
ReactDOM-prod.js -0.2% 0.0% 407.21 KB 406.58 KB 75.29 KB 75.31 KB FB_WWW_PROD
react-dom-server.browser.development.js 0.0% -0.0% 135.87 KB 135.87 KB 36.21 KB 36.21 KB NODE_DEV
ReactDOM-profiling.js -0.2% 0.0% 417.81 KB 417.17 KB 77.07 KB 77.08 KB FB_WWW_PROFILING
ReactDOMServer-dev.js 0.0% -0.0% 146.97 KB 146.97 KB 37.38 KB 37.38 KB FB_WWW_DEV
ReactDOMServer-prod.js 0.0% -0.0% 47.44 KB 47.44 KB 11.11 KB 11.11 KB FB_WWW_PROD
react-dom-test-utils.development.js -21.9% -19.5% 75.81 KB 59.19 KB 20.22 KB 16.28 KB UMD_DEV

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactNativeRenderer-dev.js -0.1% -0.0% 680.14 KB 679.71 KB 147.43 KB 147.37 KB RN_OSS_DEV
ReactNativeRenderer-profiling.js 0.0% -0.0% 283.64 KB 283.64 KB 50.48 KB 50.48 KB RN_OSS_PROFILING
ReactFabric-dev.js -0.1% -0.0% 660.85 KB 660.42 KB 142.77 KB 142.72 KB RN_OSS_DEV
ReactFabric-profiling.js 0.0% -0.0% 277.38 KB 277.38 KB 49.24 KB 49.23 KB RN_OSS_PROFILING

ReactDOM: size: -24.8%, gzip: -21.7%

Size changes (stable)

Generated by 🚫 dangerJS against d04cd4d

Copy link
Member

trueadm left a comment

It looks good apart from packages/react-native-renderer/src/legacy-events/SyntheticEvent.js , where I think you muddled up the conditions. Update: Ignore.

@gaearon
Copy link
Member Author

gaearon commented Jul 1, 2020

Hmm. I'm not sure I follow. The native renderer uses the legacy system, right? We don't yet remove pooling on RN either.

@trueadm
trueadm approved these changes Jul 1, 2020
Copy link
Member

trueadm left a comment

Ah , ignore me. I got confused by which file.

@gaearon gaearon merged commit 9fba65e into facebook:master Jul 1, 2020
32 checks passed
32 checks passed
Facebook CLA Check Contributor License Agreement is valid!
Details
ci/circleci: RELEASE_CHANNEL_stable_yarn_build Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_yarn_lint_build Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_yarn_test Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_yarn_test_build Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_yarn_test_build_prod Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_yarn_test_dom_fixtures Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_yarn_test_persistent Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_yarn_test_prod Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_yarn_test_prod_www Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_yarn_test_prod_www_variant Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_yarn_test_www Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_yarn_test_www_variant Your tests passed on CircleCI!
Details
ci/circleci: process_artifacts Your tests passed on CircleCI!
Details
ci/circleci: process_artifacts_experimental Your tests passed on CircleCI!
Details
ci/circleci: setup Your tests passed on CircleCI!
Details
ci/circleci: sizebot_experimental Your tests passed on CircleCI!
Details
ci/circleci: sizebot_stable Your tests passed on CircleCI!
Details
ci/circleci: yarn_build Your tests passed on CircleCI!
Details
ci/circleci: yarn_flow Your tests passed on CircleCI!
Details
ci/circleci: yarn_lint Your tests passed on CircleCI!
Details
ci/circleci: yarn_lint_build Your tests passed on CircleCI!
Details
ci/circleci: yarn_test Your tests passed on CircleCI!
Details
ci/circleci: yarn_test_build Your tests passed on CircleCI!
Details
ci/circleci: yarn_test_build_devtools Your tests passed on CircleCI!
Details
ci/circleci: yarn_test_build_prod Your tests passed on CircleCI!
Details
ci/circleci: yarn_test_prod Your tests passed on CircleCI!
Details
ci/circleci: yarn_test_prod_www Your tests passed on CircleCI!
Details
ci/circleci: yarn_test_prod_www_variant Your tests passed on CircleCI!
Details
ci/circleci: yarn_test_www Your tests passed on CircleCI!
Details
ci/circleci: yarn_test_www_variant Your tests passed on CircleCI!
Details
ci/codesandbox Building packages succeeded.
Details
@gaearon gaearon deleted the gaearon:modern branch Jul 1, 2020
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.