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 experimental event API scaffolding #15108

Merged

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented Mar 14, 2019

Summary

This PR adds some scaffolding to React needed for the event API experiment that we're testing out internally at Facebook. The API will be behind a enableEventAPI flag to ensure the logic is kept in isolation.

This scaffolding in this PR doesn't add any functionality. This PR inserts placeholders, symbols for the new fibers, functions and tags/types in preparation for follow up PRs that add the implementations. In the interests of making this experimental event API easier to review and consume, I've opted to create lots of smaller PRs.

This PR is only one part of the work to add the event API, so expect other PRs that expand on this and fill in the implementations. #15036 is the previous part of work.

I plan on writing up an RFC explaining this event API, along with how the internals work (such as the new symbols) once we've had a chance to iron out some details internally.

@trueadm trueadm changed the title Adds event API Symbols and placeholder functions Adds experimental event API scaffolding Mar 14, 2019
@philipp-spiess
Copy link
Contributor

Now I'm really curious about what you've worked on internally at Facebook.

@aweary
Copy link
Contributor

aweary commented Mar 14, 2019

@philipp-spiess https://www.facebook.com/careers/ 😉

@sizebot
Copy link

sizebot commented Mar 14, 2019

React: size: 0.0%, gzip: -0.0%

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

Details of bundled changes.

Comparing: 679402a...34d0cc9

react

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react.development.js +0.3% +0.3% 99.75 KB 100.08 KB 25.93 KB 26.01 KB UMD_DEV
react.production.min.js 0.0% -0.0% 12.34 KB 12.34 KB 4.74 KB 4.74 KB UMD_PROD
react.profiling.min.js 0.0% -0.0% 14.49 KB 14.49 KB 5.26 KB 5.26 KB UMD_PROFILING
react.development.js +0.5% +0.5% 62.3 KB 62.62 KB 16.83 KB 16.92 KB NODE_DEV
react.production.min.js 0.0% -0.1% 6.7 KB 6.7 KB 2.77 KB 2.77 KB NODE_PROD
React-dev.js +0.5% +0.4% 59.44 KB 59.71 KB 15.8 KB 15.86 KB FB_WWW_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% 779.13 KB 779.68 KB 177.56 KB 177.67 KB UMD_DEV
react-dom.production.min.js 🔺+0.1% 0.0% 105.11 KB 105.18 KB 34.11 KB 34.12 KB UMD_PROD
react-dom.profiling.min.js +0.1% +0.1% 108.11 KB 108.18 KB 34.77 KB 34.8 KB UMD_PROFILING
react-dom.development.js +0.1% +0.1% 773.52 KB 774.07 KB 176.05 KB 176.17 KB NODE_DEV
react-dom.production.min.js 🔺+0.1% 🔺+0.1% 105.09 KB 105.16 KB 33.6 KB 33.62 KB NODE_PROD
react-dom.profiling.min.js +0.1% 0.0% 108.2 KB 108.28 KB 34.21 KB 34.23 KB NODE_PROFILING
ReactDOM-dev.js +0.1% 0.0% 796.54 KB 796.97 KB 177.2 KB 177.28 KB FB_WWW_DEV
ReactDOM-prod.js 🔺+0.1% 0.0% 322.89 KB 323.11 KB 59.15 KB 59.17 KB FB_WWW_PROD
ReactDOM-profiling.js +0.1% +0.1% 328.82 KB 329.04 KB 60.43 KB 60.48 KB FB_WWW_PROFILING
react-dom-unstable-fire.development.js +0.1% +0.1% 779.47 KB 780.03 KB 177.7 KB 177.82 KB UMD_DEV
react-dom-unstable-fire.production.min.js 🔺+0.1% 0.0% 105.12 KB 105.19 KB 34.12 KB 34.13 KB UMD_PROD
react-dom-unstable-fire.profiling.min.js +0.1% +0.1% 108.13 KB 108.2 KB 34.78 KB 34.8 KB UMD_PROFILING
react-dom-unstable-fire.development.js +0.1% +0.1% 773.86 KB 774.42 KB 176.19 KB 176.31 KB NODE_DEV
react-dom-unstable-fire.production.min.js 🔺+0.1% 🔺+0.1% 105.1 KB 105.17 KB 33.61 KB 33.63 KB NODE_PROD
react-dom-unstable-fire.profiling.min.js +0.1% +0.1% 108.22 KB 108.29 KB 34.22 KB 34.24 KB NODE_PROFILING
ReactFire-dev.js +0.1% 0.0% 795.75 KB 796.18 KB 177.15 KB 177.22 KB FB_WWW_DEV
ReactFire-prod.js 🔺+0.1% 🔺+0.1% 311.43 KB 311.65 KB 56.77 KB 56.8 KB FB_WWW_PROD
ReactFire-profiling.js +0.1% +0.1% 317.45 KB 317.67 KB 58.08 KB 58.11 KB FB_WWW_PROFILING
react-dom-test-utils.development.js 0.0% -0.0% 47.06 KB 47.06 KB 12.99 KB 12.99 KB UMD_DEV
react-dom-test-utils.production.min.js 0.0% -0.1% 10.27 KB 10.27 KB 3.8 KB 3.8 KB UMD_PROD
react-dom-test-utils.development.js 0.0% -0.0% 46.78 KB 46.78 KB 12.92 KB 12.92 KB NODE_DEV
react-dom-test-utils.production.min.js 0.0% -0.1% 10.05 KB 10.05 KB 3.73 KB 3.73 KB NODE_PROD
react-dom-unstable-native-dependencies.development.js 0.0% -0.0% 60.61 KB 60.61 KB 15.92 KB 15.92 KB UMD_DEV
react-dom-unstable-native-dependencies.production.min.js 0.0% -0.1% 11.01 KB 11.01 KB 3.81 KB 3.81 KB UMD_PROD
react-dom-unstable-native-dependencies.development.js 0.0% -0.0% 60.28 KB 60.28 KB 15.79 KB 15.78 KB NODE_DEV
react-dom-unstable-native-dependencies.production.min.js 0.0% -0.1% 10.75 KB 10.75 KB 3.71 KB 3.71 KB NODE_PROD
react-dom-server.browser.development.js +0.1% +0.1% 129.86 KB 129.93 KB 34.61 KB 34.63 KB UMD_DEV
react-dom-server.browser.production.min.js 0.0% -0.0% 19.19 KB 19.19 KB 7.28 KB 7.28 KB UMD_PROD
react-dom-server.browser.development.js +0.1% +0.1% 125.99 KB 126.06 KB 33.68 KB 33.71 KB NODE_DEV
react-dom-server.browser.production.min.js 0.0% -0.0% 19.12 KB 19.12 KB 7.28 KB 7.28 KB NODE_PROD
ReactDOMServer-dev.js 0.0% -0.0% 127.04 KB 127.04 KB 33.09 KB 33.09 KB FB_WWW_DEV
ReactDOMServer-prod.js 0.0% -0.0% 45.62 KB 45.62 KB 10.6 KB 10.6 KB FB_WWW_PROD
react-dom-server.node.development.js +0.1% +0.1% 128.05 KB 128.12 KB 34.23 KB 34.25 KB NODE_DEV
react-dom-server.node.production.min.js 0.0% -0.0% 19.99 KB 19.99 KB 7.59 KB 7.58 KB NODE_PROD
react-dom-unstable-fizz.browser.development.js 0.0% -0.1% 3.63 KB 3.63 KB 1.44 KB 1.44 KB UMD_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% -0.3% 1.21 KB 1.21 KB 707 B 705 B UMD_PROD
react-dom-unstable-fizz.browser.development.js 0.0% -0.1% 3.45 KB 3.45 KB 1.39 KB 1.39 KB NODE_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% -0.3% 1.05 KB 1.05 KB 638 B 636 B NODE_PROD
react-dom-unstable-fizz.node.development.js 0.0% -0.1% 3.7 KB 3.7 KB 1.42 KB 1.42 KB NODE_DEV
react-dom-unstable-fizz.node.production.min.js 0.0% -0.4% 1.1 KB 1.1 KB 669 B 666 B NODE_PROD

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-art.development.js +0.1% +0.1% 552.03 KB 552.58 KB 120.08 KB 120.19 KB UMD_DEV
react-art.production.min.js 🔺+0.1% 🔺+0.1% 96.94 KB 97.02 KB 29.88 KB 29.9 KB UMD_PROD
react-art.development.js +0.1% +0.1% 482.93 KB 483.48 KB 102.75 KB 102.87 KB NODE_DEV
react-art.production.min.js 🔺+0.1% 🔺+0.1% 61.86 KB 61.94 KB 18.99 KB 19.01 KB NODE_PROD
ReactART-dev.js +0.1% +0.1% 492.03 KB 492.47 KB 101.94 KB 102.01 KB FB_WWW_DEV
ReactART-prod.js 🔺+0.1% 🔺+0.1% 195.39 KB 195.61 KB 33.21 KB 33.25 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.1% +0.1% 617.76 KB 618.2 KB 132.21 KB 132.28 KB RN_FB_DEV
ReactNativeRenderer-prod.js 🔺+0.1% 🔺+0.1% 245.47 KB 245.69 KB 42.92 KB 42.95 KB RN_FB_PROD
ReactNativeRenderer-profiling.js +0.1% +0.1% 251.7 KB 251.92 KB 44.27 KB 44.3 KB RN_FB_PROFILING
ReactNativeRenderer-dev.js +0.1% +0.1% 617.68 KB 618.12 KB 132.18 KB 132.24 KB RN_OSS_DEV
ReactNativeRenderer-prod.js 🔺+0.1% 🔺+0.1% 245.48 KB 245.71 KB 42.91 KB 42.95 KB RN_OSS_PROD
ReactNativeRenderer-profiling.js +0.1% +0.1% 251.72 KB 251.94 KB 44.27 KB 44.3 KB RN_OSS_PROFILING
ReactFabric-dev.js +0.1% +0.1% 608.19 KB 608.63 KB 129.89 KB 129.96 KB RN_FB_DEV
ReactFabric-prod.js 🔺+0.1% 🔺+0.1% 239.57 KB 239.76 KB 41.72 KB 41.75 KB RN_FB_PROD
ReactFabric-profiling.js +0.1% +0.1% 244.89 KB 245.08 KB 43.09 KB 43.11 KB RN_FB_PROFILING
ReactFabric-dev.js +0.1% +0.1% 608.1 KB 608.54 KB 129.85 KB 129.91 KB RN_OSS_DEV
ReactFabric-prod.js 🔺+0.1% 🔺+0.1% 239.57 KB 239.77 KB 41.71 KB 41.74 KB RN_OSS_PROD
ReactFabric-profiling.js +0.1% +0.1% 244.9 KB 245.09 KB 43.08 KB 43.11 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 +0.1% +0.1% 491.91 KB 492.39 KB 104.42 KB 104.52 KB UMD_DEV
react-test-renderer.production.min.js 🔺+0.1% 🔺+0.1% 62.86 KB 62.94 KB 19.32 KB 19.33 KB UMD_PROD
react-test-renderer.development.js +0.1% +0.1% 487.42 KB 487.9 KB 103.27 KB 103.37 KB NODE_DEV
react-test-renderer.production.min.js 🔺+0.1% 🔺+0.1% 62.51 KB 62.59 KB 19.07 KB 19.09 KB NODE_PROD
ReactTestRenderer-dev.js +0.1% +0.1% 497.34 KB 497.78 KB 102.87 KB 102.94 KB FB_WWW_DEV
react-test-renderer-shallow.development.js 0.0% -0.0% 37.2 KB 37.2 KB 9.5 KB 9.5 KB UMD_DEV
react-test-renderer-shallow.production.min.js 0.0% -0.0% 11.12 KB 11.12 KB 3.35 KB 3.35 KB UMD_PROD
react-test-renderer-shallow.development.js 0.0% -0.0% 31.5 KB 31.5 KB 8.14 KB 8.14 KB NODE_DEV
react-test-renderer-shallow.production.min.js 0.0% -0.1% 11.77 KB 11.77 KB 3.66 KB 3.65 KB NODE_PROD

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler.development.js +0.2% +0.2% 481.09 KB 481.9 KB 101.28 KB 101.46 KB NODE_DEV
react-reconciler.production.min.js 🔺+0.3% 🔺+0.3% 62.91 KB 63.11 KB 18.85 KB 18.91 KB NODE_PROD
react-reconciler-persistent.development.js +0.2% +0.2% 479.23 KB 479.96 KB 100.53 KB 100.68 KB NODE_DEV
react-reconciler-persistent.production.min.js 🔺+0.3% 🔺+0.3% 62.92 KB 63.12 KB 18.85 KB 18.91 KB NODE_PROD
react-reconciler-reflection.development.js 0.0% -0.0% 15.76 KB 15.76 KB 4.98 KB 4.98 KB NODE_DEV
react-reconciler-reflection.production.min.js 0.0% -0.2% 2.7 KB 2.7 KB 1.23 KB 1.22 KB NODE_PROD

Generated by 🚫 dangerJS

@trueadm trueadm merged commit 0c03a47 into facebook:master Mar 14, 2019
@trueadm trueadm deleted the add-event-api-symbols-and-placeholders branch March 14, 2019 17:02
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.

Can you do a follow up to wrap in feature flags?

NMinhNguyen referenced this pull request in enzymejs/react-shallow-renderer Jan 29, 2020
* Adds experimental event API scaffolding
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.

8 participants