zilverline / react-tap-event-plugin

Instant TapEvents for React
http://facebook.github.io/react/
MIT License
1.07k stars 110 forks source link

Update for React 16 (Fiber) #102

Closed djfarly closed 7 years ago

djfarly commented 7 years ago

Hey, first of all thanks for the project. ;)

The current alpha of react 16 uses flat bundles (currently 16.0.0-alpha.13). Therefore there are no more react-dom/lib/* exports. There is a note in the fiber umbrella issue explicitly mentioning react-tap-event-plugin:

Maybe: Switch to flat bundles (no more react-dom/lib/*, internals are truly private) Decide: after flat bundles, how does one create a custom Fiber renderer? Decide: plan forward for popular projects depending on internals (react-native-web, react-tap-event-plugin) EventPluginHub is "dangerously" exported from flat bundle for tap event plugin

As far as i can see tap event plugin uses more exports from /lib than just EventPluginHub. Namely:

React DOM currently exports:

reactdomexports

What would be the path forwards? 🙈 Is there some way to help?

For reference heres the output of the webpack build:

``` ERROR in ./node_modules/react-tap-event-plugin/src/injectTapEventPlugin.js Module not found: Error: Can't resolve 'react-dom/lib/EventPluginHub' in '[…]/node_modules/react-tap-event-plugin/src' @ ./node_modules/react-tap-event-plugin/src/injectTapEventPlugin.js 23:2-41 @ dll vendor ERROR in ./node_modules/react-tap-event-plugin/src/TapEventPlugin.js Module not found: Error: Can't resolve 'react-dom/lib/EventConstants' in '[…]/node_modules/react-tap-event-plugin/src' @ ./node_modules/react-tap-event-plugin/src/TapEventPlugin.js 22:21-60 @ ./node_modules/react-tap-event-plugin/src/injectTapEventPlugin.js @ dll vendor ERROR in ./node_modules/react-tap-event-plugin/src/TapEventPlugin.js Module not found: Error: Can't resolve 'react-dom/lib/EventPluginUtils' in '[…]/node_modules/react-tap-event-plugin/src' @ ./node_modules/react-tap-event-plugin/src/TapEventPlugin.js 23:23-64 @ ./node_modules/react-tap-event-plugin/src/injectTapEventPlugin.js @ dll vendor ERROR in ./node_modules/react-tap-event-plugin/src/TapEventPlugin.js Module not found: Error: Can't resolve 'react-dom/lib/EventPropagators' in '[…]/node_modules/react-tap-event-plugin/src' @ ./node_modules/react-tap-event-plugin/src/TapEventPlugin.js 24:23-64 @ ./node_modules/react-tap-event-plugin/src/injectTapEventPlugin.js @ dll vendor ERROR in ./node_modules/react-tap-event-plugin/src/TapEventPlugin.js Module not found: Error: Can't resolve 'react-dom/lib/SyntheticUIEvent' in '[…]/node_modules/react-tap-event-plugin/src' @ ./node_modules/react-tap-event-plugin/src/TapEventPlugin.js 25:23-64 @ ./node_modules/react-tap-event-plugin/src/injectTapEventPlugin.js @ dll vendor ERROR in ./node_modules/react-tap-event-plugin/src/TapEventPlugin.js Module not found: Error: Can't resolve 'react-dom/lib/ViewportMetrics' in '[…]/node_modules/react-tap-event-plugin/src' @ ./node_modules/react-tap-event-plugin/src/TapEventPlugin.js 27:22-62 @ ./node_modules/react-tap-event-plugin/src/injectTapEventPlugin.js @ dll vendor ```
spidergears commented 7 years ago

Got this issue with react-16.0.0-alpha.12 Module not found: Error: Can't resolve 'react-dom/lib/EventPluginHub' in '[…]/node_modules/react-tap-event-plugin/src'

What's the way fwd?

KirillSuhodolov commented 7 years ago

Have same issues with react 16.alpha

cyrus-za commented 7 years ago

Got the same issue with 15.6.1

works fine in dev but can't build. Using next.js

"scripts": {
    "dev": "next",
    "build": "next build",
    "start": "next start",
}
cyrus-za commented 7 years ago

Seems like my issue is related to https://github.com/zilverline/react-tap-event-plugin/issues/99

bsbechtel commented 7 years ago

This issue has been open since June, but there isn't any recent activity on it. Has anyone proposed a path forward or come up with an alternative solution now that React 16 has been released? Thanks

s0meone commented 7 years ago

I've updated the plugin to version 3.0.0, to be compatible with React 16. I had to copy a big chunk of React internals to keep it working. This solution will probably not last for future versions. React is making it harder and harder to keep this plugin going.

Please test the latest commit in your application and let me know the results so I can publish to npm.

maierson commented 7 years ago

This solution will probably not last for future versions.

react-fastclick works for us as a replacement.

// index.jsx
import * as initFastClick from "react-fastclick";
initFastClick();
GuillaumeCisco commented 7 years ago

Works great @s0meone , thanks ;)

bsbechtel commented 7 years ago

@s0meone I'm still seeing an error regarding the EventPluginHub: screen shot 2017-09-28 at 9 29 29 am

chenop commented 7 years ago

Hi, Thanks for maintaining this! Any update regarding a new version that support React 16?