-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
Add react-dom-unstable-native-dependencies #10138
Conversation
react-native-web and react-primitives currently access a few internals for shimming DOM events into native ones. Changes in react@16 packaging hide these internals completely. This change adds a submodule to react-dom, unstable-native-dependencies that includes the necessary modules to continue enabling that method of dom-native event injection.
It would be useful if we wanted to use these modules in www too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small changes.
@@ -0,0 +1,7 @@ | |||
'use strict'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since there's a new file we need to add it to whitelist in package.json, or it would get ignored on publish.
scripts/rollup/bundles.js
Outdated
@@ -125,6 +125,34 @@ const bundles = [ | |||
'src/shared/**/*.js', | |||
], | |||
}, | |||
/* React DOM internals required for shimming react-native apps into the react-dom renderer */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe let's say "required for react-native-web" for explicitness.
Is there a smoke test we can add? Otherwise I'm worried we'll break it. |
In order to get some sort of smoke testing on react-dom-unstable-native-dependencies, update ResponderEventPlugin-test to use the "public" interfaces provided by react-dom and the new react-dom/unstable-native dependencies Also adds the missing references in package.json as well as missing files required for unittests to do imports correctrly Also exports injectComponentTree() which is required for the unittests to re-set the shared component state between runs.
Still trying to figure out the fbEntry business. When I add it and try to build, I get the following unhandled error when trying to build:
Any ideas? |
Please |
LGTM, thank you for driving this! |
I really appreciate this. Thank you! |
react-native-web and react-primitives currently access a few internals
for shimming DOM events into native ones. Changes in react@16 packaging
hide these internals, which has made it difficult for these projects to upgrade.
change adds a submodule to react-dom, unstable-native-dependencies that
includes the necessary modules to continue enabling that method of
dom-native event injection.
The bundle config is currently a bit of dogscience. The one thing I really changes were:
which was required to inject the shared ComponentTree into this module.