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

Remove injectComponentTree from unstable-native-dependencies, add EventPluginHub #13598

Merged

Conversation

aweary
Copy link
Contributor

@aweary aweary commented Sep 8, 2018

Resolves #13589

injectComponentTree was exposed for react-native-web, but wasn't actually being used by the project. There don't appear to be any call sites for injectComponentTree in www either (FB Internal).

RNW is using EventPluginHub through ReactDOM's secret internals, but that was removed in #13539

This removes the unused injectComponentTree export, refactors the ResponderEventPlugin test so it doesn't depend on it, and also adds EventPluginHub to the exports to unbreak RNW with 16.5

cc @necolas

EventPluginHub

injectComponentTree was exposed for react-native-web, but wasn't
actually being used by the project. They were using EventPluginHub
through ReactDOM's secret internals, but that was removed in facebook#13539

This removes the unused injectComponentTree export, refactors the
ResponderEventPlugin test so it doesn't depend on it, and also adds
EventPluginHub to the exports to unbreak react-native-web
@pull-bot
Copy link

pull-bot commented Sep 8, 2018

Details of bundled changes.

Comparing: b87aabd...e9ade0f

schedule

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
schedule.development.js n/a n/a 0 B 19.17 KB 0 B 5.74 KB UMD_DEV
schedule.production.min.js n/a n/a 0 B 3.16 KB 0 B 1.53 KB UMD_PROD

Generated by 🚫 dangerJS

@gaearon
Copy link
Collaborator

gaearon commented Sep 8, 2018

I think this might be insufficient because it's likely RNW actually needs EventPluginHub from inside of ReactDOM rather than a copy of it that would get bundled with this entry point. Need testing to verify.

@aweary
Copy link
Contributor Author

aweary commented Sep 8, 2018

I think you're right. In that case we can just add it back to ReactDOM secret internals, and re-export it?

@gaearon
Copy link
Collaborator

gaearon commented Sep 8, 2018

Yeah but that can increase the bundle size. At least let's just export the smallest unit we can (that method alone).

Copy link
Collaborator

@gaearon gaearon left a comment

Choose a reason for hiding this comment

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

Please test that this fixes RNW

@aweary aweary force-pushed the event-plugin-hub-unstable-native-deps branch from 2913463 to e9ade0f Compare September 8, 2018 16:58
@aweary
Copy link
Contributor Author

aweary commented Sep 8, 2018

With these changes to React Native for Web I verified that the reproducing example from necolas/react-native-web#1096 no longer throws with a local build form this branch.

I also verified the same with the examples application in the RNW repo.

@gaearon
Copy link
Collaborator

gaearon commented Sep 8, 2018

Coolio

@gaearon
Copy link
Collaborator

gaearon commented Sep 13, 2018

Should be fixed in 16.5.1

@msand
Copy link

msand commented Sep 14, 2018

@aweary Great work! Could you make a pr with the changes to rnw?

Simek pushed a commit to Simek/react that referenced this pull request Oct 25, 2018
…ntPluginHub (facebook#13598)

* Remove injectComponentTree from unstable-native-dependencies, add
EventPluginHub

injectComponentTree was exposed for react-native-web, but wasn't
actually being used by the project. They were using EventPluginHub
through ReactDOM's secret internals, but that was removed in facebook#13539

This removes the unused injectComponentTree export, refactors the
ResponderEventPlugin test so it doesn't depend on it, and also adds
EventPluginHub to the exports to unbreak react-native-web

* Re-export injectEventPluginsByName from ReactDOM internals
jetoneza pushed a commit to jetoneza/react that referenced this pull request Jan 23, 2019
…ntPluginHub (facebook#13598)

* Remove injectComponentTree from unstable-native-dependencies, add
EventPluginHub

injectComponentTree was exposed for react-native-web, but wasn't
actually being used by the project. They were using EventPluginHub
through ReactDOM's secret internals, but that was removed in facebook#13539

This removes the unused injectComponentTree export, refactors the
ResponderEventPlugin test so it doesn't depend on it, and also adds
EventPluginHub to the exports to unbreak react-native-web

* Re-export injectEventPluginsByName from ReactDOM internals
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