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

Adds more scaffolding for experimental event API #15112

Merged
merged 17 commits into from
Mar 20, 2019

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented Mar 14, 2019

This PR is a follow up to #15108. This adds the rest of the experimental event API scaffolding logic. Like the previous PR, this is only intended for internal FB testing right now. I also added flags around everything, so bundle size shouldn't regress other than a few bytes (if it does, I've done something wrong with DCE).

I've also added relevant fiber tests to ensure the warnings fire as expected.

@sizebot
Copy link

sizebot commented Mar 14, 2019

ReactDOM: size: 🔺+0.1%, gzip: 🔺+0.1%

Details of bundled changes.

Comparing: daeda44...fc45944

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.development.js +0.8% +0.7% 789.93 KB 796.06 KB 179.37 KB 180.57 KB UMD_DEV
react-dom.production.min.js 🔺+0.1% 🔺+0.1% 104.97 KB 105.05 KB 33.91 KB 33.93 KB UMD_PROD
react-dom.profiling.min.js +0.1% +0.1% 107.95 KB 108.02 KB 34.6 KB 34.62 KB UMD_PROFILING
react-dom.development.js +0.8% +0.7% 784.32 KB 790.45 KB 177.81 KB 178.99 KB NODE_DEV
react-dom.production.min.js 🔺+0.1% 🔺+0.1% 104.94 KB 105.01 KB 33.43 KB 33.45 KB NODE_PROD
react-dom.profiling.min.js +0.1% +0.1% 108.04 KB 108.12 KB 34.04 KB 34.06 KB NODE_PROFILING
ReactDOM-dev.js +0.9% +0.7% 807.52 KB 814.4 KB 179.1 KB 180.34 KB FB_WWW_DEV
ReactDOM-prod.js 🔺+0.8% 🔺+0.6% 319.45 KB 322.05 KB 58.88 KB 59.21 KB FB_WWW_PROD
ReactDOM-profiling.js +0.7% +0.5% 324.73 KB 327.03 KB 60.17 KB 60.44 KB FB_WWW_PROFILING
react-dom-unstable-fire.development.js +0.8% +0.7% 790.28 KB 796.41 KB 179.5 KB 180.71 KB UMD_DEV
react-dom-unstable-fire.production.min.js 🔺+0.1% 🔺+0.1% 104.99 KB 105.06 KB 33.92 KB 33.94 KB UMD_PROD
react-dom-unstable-fire.profiling.min.js +0.1% +0.1% 107.96 KB 108.04 KB 34.6 KB 34.63 KB UMD_PROFILING
react-dom-unstable-fire.development.js +0.8% +0.7% 784.66 KB 790.8 KB 177.94 KB 179.12 KB NODE_DEV
react-dom-unstable-fire.production.min.js 🔺+0.1% 🔺+0.1% 104.96 KB 105.03 KB 33.44 KB 33.46 KB NODE_PROD
react-dom-unstable-fire.profiling.min.js +0.1% +0.1% 108.06 KB 108.13 KB 34.04 KB 34.06 KB NODE_PROFILING
ReactFire-dev.js +0.9% +0.7% 806.73 KB 813.61 KB 178.98 KB 180.23 KB FB_WWW_DEV
ReactFire-prod.js 🔺+0.8% 🔺+0.6% 308.04 KB 310.64 KB 56.49 KB 56.84 KB FB_WWW_PROD
ReactFire-profiling.js +0.7% +0.5% 313.37 KB 315.67 KB 57.81 KB 58.11 KB FB_WWW_PROFILING
react-dom-test-utils.development.js 0.0% 0.0% 47.49 KB 47.49 KB 12.98 KB 12.98 KB UMD_DEV
react-dom-test-utils.production.min.js 0.0% 🔺+0.1% 9.95 KB 9.95 KB 3.65 KB 3.66 KB UMD_PROD
react-dom-test-utils.development.js 0.0% 0.0% 47.21 KB 47.21 KB 12.91 KB 12.91 KB NODE_DEV
react-dom-test-utils.production.min.js 0.0% 🔺+0.1% 9.73 KB 9.73 KB 3.58 KB 3.59 KB NODE_PROD
react-dom-unstable-native-dependencies.development.js 0.0% 0.0% 60.53 KB 60.53 KB 15.8 KB 15.8 KB UMD_DEV
react-dom-unstable-native-dependencies.production.min.js 0.0% 🔺+0.1% 10.69 KB 10.69 KB 3.67 KB 3.67 KB UMD_PROD
react-dom-unstable-native-dependencies.development.js 0.0% 0.0% 60.2 KB 60.2 KB 15.67 KB 15.67 KB NODE_DEV
react-dom-unstable-native-dependencies.production.min.js 0.0% 0.0% 10.42 KB 10.42 KB 3.56 KB 3.57 KB NODE_PROD
react-dom-server.browser.development.js 0.0% 0.0% 133.51 KB 133.51 KB 35.3 KB 35.3 KB UMD_DEV
react-dom-server.browser.production.min.js 0.0% 0.0% 18.93 KB 18.93 KB 7.14 KB 7.14 KB UMD_PROD
react-dom-server.browser.development.js 0.0% 0.0% 129.64 KB 129.64 KB 34.36 KB 34.36 KB NODE_DEV
react-dom-server.browser.production.min.js 0.0% 0.0% 18.86 KB 18.86 KB 7.14 KB 7.14 KB NODE_PROD
ReactDOMServer-dev.js 0.0% 0.0% 131.86 KB 131.86 KB 34.06 KB 34.06 KB FB_WWW_DEV
ReactDOMServer-prod.js 0.0% 0.0% 45.67 KB 45.67 KB 10.56 KB 10.56 KB FB_WWW_PROD
react-dom-server.node.development.js 0.0% 0.0% 131.58 KB 131.58 KB 34.9 KB 34.9 KB NODE_DEV
react-dom-server.node.production.min.js 0.0% 0.0% 19.72 KB 19.72 KB 7.44 KB 7.44 KB NODE_PROD
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 3.66 KB 3.66 KB 1.45 KB 1.45 KB UMD_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% 🔺+0.1% 1.21 KB 1.21 KB 705 B 706 B UMD_PROD
react-dom-unstable-fizz.browser.development.js 0.0% +0.2% 3.49 KB 3.49 KB 1.41 KB 1.41 KB NODE_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% 🔺+0.3% 1.05 KB 1.05 KB 635 B 637 B NODE_PROD
react-dom-unstable-fizz.node.development.js 0.0% +0.1% 3.74 KB 3.74 KB 1.43 KB 1.43 KB NODE_DEV
react-dom-unstable-fizz.node.production.min.js 0.0% 🔺+0.2% 1.1 KB 1.1 KB 666 B 667 B NODE_PROD

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-art.development.js +0.5% +0.3% 560 KB 562.76 KB 121.4 KB 121.73 KB UMD_DEV
react-art.production.min.js 0.0% 🔺+0.1% 96.78 KB 96.8 KB 29.66 KB 29.68 KB UMD_PROD
react-art.development.js +0.6% +0.3% 490.9 KB 493.68 KB 104.01 KB 104.34 KB NODE_DEV
react-art.production.min.js 0.0% 🔺+0.1% 61.76 KB 61.78 KB 18.87 KB 18.88 KB NODE_PROD
ReactART-dev.js +0.6% +0.3% 500.41 KB 503.51 KB 103.25 KB 103.6 KB FB_WWW_DEV
ReactART-prod.js 🔺+0.8% 🔺+0.5% 194.53 KB 196.07 KB 33.02 KB 33.18 KB FB_WWW_PROD

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactNativeRenderer-dev.js +0.5% +0.3% 620.19 KB 623.37 KB 132.79 KB 133.21 KB RN_FB_DEV
ReactNativeRenderer-prod.js -0.0% -0.0% 245.59 KB 245.52 KB 42.92 KB 42.91 KB RN_FB_PROD
ReactNativeRenderer-profiling.js -0.0% 0.0% 251.82 KB 251.75 KB 44.26 KB 44.27 KB RN_FB_PROFILING
ReactNativeRenderer-dev.js +0.5% +0.3% 620.1 KB 623.29 KB 132.76 KB 133.17 KB RN_OSS_DEV
ReactNativeRenderer-prod.js -0.0% -0.0% 245.6 KB 245.53 KB 42.91 KB 42.91 KB RN_OSS_PROD
ReactNativeRenderer-profiling.js -0.0% 0.0% 251.84 KB 251.77 KB 44.26 KB 44.26 KB RN_OSS_PROFILING
ReactFabric-dev.js +0.5% +0.3% 610.62 KB 613.8 KB 130.47 KB 130.86 KB RN_FB_DEV
ReactFabric-prod.js -0.0% 0.0% 239.66 KB 239.6 KB 41.71 KB 41.72 KB RN_FB_PROD
ReactFabric-profiling.js -0.0% 0.0% 244.98 KB 244.92 KB 43.07 KB 43.08 KB RN_FB_PROFILING
ReactFabric-dev.js +0.5% +0.3% 610.52 KB 613.71 KB 130.43 KB 130.82 KB RN_OSS_DEV
ReactFabric-prod.js -0.0% 0.0% 239.67 KB 239.6 KB 41.71 KB 41.71 KB RN_OSS_PROD
ReactFabric-profiling.js -0.0% 0.0% 244.99 KB 244.93 KB 43.07 KB 43.08 KB RN_OSS_PROFILING

react-test-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-test-renderer.development.js +1.0% +0.8% 499.82 KB 504.95 KB 105.65 KB 106.45 KB UMD_DEV
react-test-renderer.production.min.js 🔺+0.1% 🔺+0.1% 62.71 KB 62.78 KB 19.08 KB 19.11 KB UMD_PROD
react-test-renderer.development.js +1.0% +0.8% 495.34 KB 500.47 KB 104.49 KB 105.29 KB NODE_DEV
react-test-renderer.production.min.js 🔺+0.1% 🔺+0.2% 62.39 KB 62.46 KB 18.92 KB 18.95 KB NODE_PROD
ReactTestRenderer-dev.js +1.1% +0.8% 505.81 KB 511.54 KB 104.21 KB 105.05 KB FB_WWW_DEV
react-test-renderer-shallow.development.js 0.0% -0.0% 38.98 KB 38.98 KB 9.81 KB 9.81 KB UMD_DEV
react-test-renderer-shallow.production.min.js 0.0% 🔺+0.1% 11.42 KB 11.42 KB 3.5 KB 3.51 KB UMD_PROD
react-test-renderer-shallow.development.js 0.0% 0.0% 33.2 KB 33.2 KB 8.41 KB 8.42 KB NODE_DEV
react-test-renderer-shallow.production.min.js 0.0% 🔺+0.1% 11.61 KB 11.61 KB 3.63 KB 3.63 KB NODE_PROD

react-noop-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-noop-renderer.development.js +21.7% +27.3% 26.21 KB 31.89 KB 6.2 KB 7.9 KB NODE_DEV
react-noop-renderer.production.min.js 🔺+4.8% 🔺+6.8% 9.67 KB 10.13 KB 3.09 KB 3.3 KB NODE_PROD
react-noop-renderer-persistent.development.js +21.6% +27.3% 26.33 KB 32 KB 6.22 KB 7.91 KB NODE_DEV
react-noop-renderer-persistent.production.min.js 🔺+4.8% 🔺+6.8% 9.69 KB 10.15 KB 3.1 KB 3.31 KB NODE_PROD
react-noop-renderer-server.development.js 0.0% +0.2% 1.83 KB 1.83 KB 875 B 877 B NODE_DEV
react-noop-renderer-server.production.min.js 0.0% 🔺+0.4% 813 B 813 B 489 B 491 B NODE_PROD

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler.development.js +0.6% +0.3% 489.38 KB 492.15 KB 102.6 KB 102.92 KB NODE_DEV
react-reconciler.production.min.js -0.2% -0.2% 62.89 KB 62.78 KB 18.73 KB 18.69 KB NODE_PROD
react-reconciler-persistent.development.js +0.6% +0.3% 487.37 KB 490.14 KB 101.79 KB 102.11 KB NODE_DEV
react-reconciler-persistent.production.min.js -0.2% -0.2% 62.91 KB 62.79 KB 18.73 KB 18.69 KB NODE_PROD
react-reconciler-reflection.development.js 0.0% 0.0% 15.79 KB 15.79 KB 4.91 KB 4.91 KB NODE_DEV
react-reconciler-reflection.production.min.js 0.0% 🔺+0.1% 2.37 KB 2.37 KB 1.07 KB 1.07 KB NODE_PROD

Generated by 🚫 dangerJS

@trueadm
Copy link
Contributor Author

trueadm commented Mar 15, 2019

I've addressed the feedback. I'll follow up on any other concerns in subsequent PRs. :)

Copy link
Collaborator

@sebmarkbage sebmarkbage left a comment

Choose a reason for hiding this comment

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

Would be good to have some just very basics tests for these cases. Not only does help expose bugs/regressions, but it's also documenting where you're going with this.

packages/react-reconciler/src/ReactFiberBeginWork.js Outdated Show resolved Hide resolved
packages/react-dom/src/client/ReactDOMHostConfig.js Outdated Show resolved Hide resolved
packages/react-reconciler/src/ReactFiberBeginWork.js Outdated Show resolved Hide resolved
@trueadm
Copy link
Contributor Author

trueadm commented Mar 16, 2019

@sebmarkbage I've added tests and moved all the logic checking into host context. This simplifies a bunch of cases and moves the checking logic into the renderer, which makes far more sense.

packages/react-dom/src/client/ReactDOMHostConfig.js Outdated Show resolved Hide resolved
packages/react-dom/src/shared/DOMNamespaces.js Outdated Show resolved Hide resolved
packages/react-reconciler/src/ReactFiberCompleteWork.js Outdated Show resolved Hide resolved
packages/react-reconciler/src/ReactFiberCompleteWork.js Outdated Show resolved Hide resolved
packages/react-dom/src/client/ReactDOMHostConfig.js Outdated Show resolved Hide resolved
packages/react-dom/src/client/ReactDOMHostConfig.js Outdated Show resolved Hide resolved
packages/react-dom/src/client/ReactDOMHostConfig.js Outdated Show resolved Hide resolved
Copy link
Collaborator

@sebmarkbage sebmarkbage left a comment

Choose a reason for hiding this comment

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

Hm. The mutation thing won't work with Suspense etc.

packages/react-dom/src/client/ReactDOMHostConfig.js Outdated Show resolved Hide resolved
@trueadm
Copy link
Contributor Author

trueadm commented Mar 19, 2019

@sebmarkbage I had to make the test internal because it writes to the feature flags to enable the events API. Tests that do this must always been internal it seems (according to comments in the config file for the test runner).

Copy link
Collaborator

@sebmarkbage sebmarkbage left a comment

Choose a reason for hiding this comment

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

Two minor nits but looks good to go otherwise.

packages/react-dom/src/shared/DOMNamespaces.js Outdated Show resolved Hide resolved
packages/shared/getElementFromTouchHitTarget.js Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants