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

More event system cleanup and scaffolding #18179

Merged
merged 1 commit into from
Mar 2, 2020

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented Feb 28, 2020

This PR is another step towards adding a forked modern event system that uses roots. Before we get to that stage, we need to do some cleanup and add some parts of the scaffolding.

Specifically, this PR does the following:

  • fork ensureListeningTo to accept modern/legacy events
  • wrap legacyTrapBubbledEvent calls in a flag, as we won't do these in the modern event system (we use the capture phase instead).
  • add dispatchEventForLegacyPluginEventSystem calls at DOMEventListener behind the flag, as the entrance point for dispatching modern event system events.
  • add listenToTopLevelEvent calls at ReactDOMEventReplaying behind the flag, as the entrance point for replaying modern event system events.
  • add DOMModernPluginEventSystem module. This doesn't do much for now, the rest of the code and tests will come in a follow up PR. It does register events accordingly however.
  • various small changes to Flow types and cleanup of DOMEventListener

Note: there should be no functional changes to the existing legacy event system.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 28, 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 64dc9a4:

Sandbox Source
blazing-frost-ihcob Configuration

@sizebot
Copy link

sizebot commented Feb 28, 2020

Details of bundled changes.

Comparing: 4ee592e...64dc9a4

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactDOM-profiling.js 0.0% -0.0% 405.88 KB 405.94 KB 73.87 KB 73.87 KB FB_WWW_PROFILING
react-dom-server.browser.production.min.js 0.0% 0.0% 19.99 KB 19.99 KB 7.39 KB 7.39 KB UMD_PROD
react-dom-unstable-native-dependencies.development.js 0.0% 0.0% 55.86 KB 55.86 KB 14.46 KB 14.46 KB NODE_DEV
react-dom.development.js +0.1% 0.0% 881.76 KB 882.42 KB 194.35 KB 194.42 KB UMD_DEV
react-dom-unstable-native-dependencies.production.min.js 0.0% 0.0% 9.99 KB 9.99 KB 3.37 KB 3.37 KB NODE_PROD
react-dom.production.min.js -0.0% -0.0% 115.85 KB 115.83 KB 37.07 KB 37.06 KB UMD_PROD
react-dom.profiling.min.js -0.0% -0.0% 119.38 KB 119.35 KB 38.29 KB 38.29 KB UMD_PROFILING
react-dom.development.js +0.1% 0.0% 839.2 KB 839.77 KB 191.97 KB 192.05 KB NODE_DEV
react-dom-server.node.development.js 0.0% 0.0% 128.85 KB 128.85 KB 34.41 KB 34.41 KB NODE_DEV
react-dom.production.min.js -0.0% 0.0% 115.93 KB 115.9 KB 36.44 KB 36.44 KB NODE_PROD
react-dom-server.node.production.min.js 0.0% 0.0% 20.31 KB 20.31 KB 7.51 KB 7.51 KB NODE_PROD
react-dom.profiling.min.js -0.0% 0.0% 119.61 KB 119.58 KB 37.5 KB 37.5 KB NODE_PROFILING
ReactDOM-dev.js +0.1% +0.1% 936.53 KB 937.05 KB 208.59 KB 208.74 KB FB_WWW_DEV
ReactDOM-prod.js 0.0% -0.0% 394.59 KB 394.65 KB 71.72 KB 71.71 KB FB_WWW_PROD
ReactDOMTesting-dev.js +0.1% +0.1% 895.88 KB 896.4 KB 200.12 KB 200.25 KB FB_WWW_DEV
ReactDOMTesting-prod.js 0.0% -0.0% 381.65 KB 381.71 KB 69.44 KB 69.44 KB FB_WWW_PROD
react-dom-server.browser.development.js 0.0% 0.0% 127.63 KB 127.63 KB 34.15 KB 34.15 KB NODE_DEV
react-dom-test-utils.development.js 0.0% 0.0% 53.77 KB 53.77 KB 14 KB 14 KB UMD_DEV
ReactDOMTesting-profiling.js 0.0% -0.0% 381.65 KB 381.71 KB 69.44 KB 69.44 KB FB_WWW_PROFILING
react-dom-test-utils.production.min.js 0.0% 🔺+0.1% 10.94 KB 10.94 KB 4.16 KB 4.16 KB UMD_PROD
ReactDOMServer-dev.js 0.0% 0.0% 137.46 KB 137.46 KB 35.02 KB 35.03 KB FB_WWW_DEV
react-dom-test-utils.production.min.js 0.0% -0.0% 10.79 KB 10.79 KB 4.09 KB 4.09 KB NODE_PROD
react-dom-unstable-native-dependencies.development.js 0.0% 0.0% 58.9 KB 58.9 KB 14.7 KB 14.7 KB UMD_DEV

ReactDOM: size: 0.0%, gzip: 0.0%

Size changes (stable)

Generated by 🚫 dangerJS against 64dc9a4

@sizebot
Copy link

sizebot commented Feb 28, 2020

Details of bundled changes.

Comparing: 4ee592e...64dc9a4

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.profiling.min.js -0.0% -0.0% 123.7 KB 123.67 KB 38.57 KB 38.56 KB NODE_PROFILING
react-dom-unstable-native-dependencies.development.js 0.0% 0.0% 58.91 KB 58.91 KB 14.7 KB 14.7 KB UMD_DEV
ReactDOM-dev.js +0.1% 0.0% 895.08 KB 895.6 KB 200.12 KB 200.19 KB FB_WWW_DEV
react-dom-unstable-native-dependencies.production.min.js 0.0% 0.0% 10.27 KB 10.27 KB 3.5 KB 3.5 KB UMD_PROD
ReactDOMServer-dev.js 0.0% 0.0% 136.61 KB 136.61 KB 34.88 KB 34.89 KB FB_WWW_DEV
react-dom-test-utils.development.js 0.0% 0.0% 53.78 KB 53.78 KB 14.01 KB 14.01 KB UMD_DEV
react-dom-test-utils.production.min.js 0.0% 0.0% 10.96 KB 10.96 KB 4.17 KB 4.17 KB UMD_PROD
ReactDOMTesting-dev.js +0.1% 0.0% 870.29 KB 870.81 KB 195 KB 195.08 KB FB_WWW_DEV
ReactDOMTesting-prod.js 0.0% 0.0% 368.76 KB 368.82 KB 67.41 KB 67.42 KB FB_WWW_PROD
react-dom-test-utils.development.js 0.0% 0.0% 49.56 KB 49.56 KB 13.52 KB 13.52 KB NODE_DEV
ReactDOMTesting-profiling.js 0.0% 0.0% 368.76 KB 368.82 KB 67.41 KB 67.42 KB FB_WWW_PROFILING
react-dom-server.node.development.js 0.0% 0.0% 130.36 KB 130.36 KB 34.63 KB 34.63 KB NODE_DEV
react-dom-test-utils.production.min.js 0.0% -0.0% 10.81 KB 10.81 KB 4.1 KB 4.1 KB NODE_PROD
react-dom.development.js +0.1% 0.0% 910.44 KB 911.11 KB 199.28 KB 199.35 KB UMD_DEV
react-dom-server.browser.development.js 0.0% 0.0% 136.12 KB 136.12 KB 34.78 KB 34.78 KB UMD_DEV
react-dom.production.min.js -0.0% 0.0% 119.75 KB 119.72 KB 38.22 KB 38.22 KB UMD_PROD
react-dom.profiling.min.js -0.0% 0.0% 123.4 KB 123.37 KB 39.39 KB 39.4 KB UMD_PROFILING
react-dom.development.js +0.1% 0.0% 866.69 KB 867.27 KB 196.87 KB 196.93 KB NODE_DEV
react-dom-server.browser.development.js 0.0% 0.0% 129.14 KB 129.14 KB 34.37 KB 34.37 KB NODE_DEV
react-dom.production.min.js -0.0% 0.0% 119.9 KB 119.87 KB 37.45 KB 37.45 KB NODE_PROD
ReactDOM-prod.js 0.0% 0.0% 370.74 KB 370.8 KB 67.5 KB 67.51 KB FB_WWW_PROD
ReactDOMServer-prod.js 0.0% 0.0% 46.68 KB 46.68 KB 10.84 KB 10.85 KB FB_WWW_PROD
ReactDOM-profiling.js 0.0% 0.0% 381.95 KB 382.01 KB 69.63 KB 69.63 KB FB_WWW_PROFILING
react-dom-unstable-native-dependencies.development.js 0.0% 0.0% 55.87 KB 55.87 KB 14.47 KB 14.47 KB NODE_DEV
react-dom-unstable-fizz.browser.development.js 0.0% -0.1% 3.35 KB 3.35 KB 1.27 KB 1.27 KB UMD_DEV

ReactDOM: size: 0.0%, gzip: 0.0%

Size changes (experimental)

Generated by 🚫 dangerJS against 64dc9a4

Copy link
Contributor

@threepointone threepointone left a comment

Choose a reason for hiding this comment

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

teeny tiny nits, but lgtm

packages/react-dom/src/client/ReactDOMComponent.js Outdated Show resolved Hide resolved
packages/react-dom/src/client/ReactDOMComponent.js Outdated Show resolved Hide resolved
scripts/error-codes/codes.json Outdated Show resolved Hide resolved
@trueadm trueadm merged commit 62861bb into facebook:master Mar 2, 2020
@trueadm trueadm deleted the infra-roots branch March 2, 2020 10:59
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.

4 participants