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

Update for React 16 (Fiber) #102

Closed
djfarly opened this issue Jun 19, 2017 · 10 comments
Closed

Update for React 16 (Fiber) #102

djfarly opened this issue Jun 19, 2017 · 10 comments

Comments

@djfarly
Copy link

djfarly commented Jun 19, 2017

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/lib/EventPluginHub
  • react-dom/lib/EventConstants
  • react-dom/lib/EventPluginUtils
  • react-dom/lib/EventPropagators
  • react-dom/lib/SyntheticUIEvent
  • react-dom/lib/ViewportMetrics

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
Copy link

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
Copy link

Have same issues with react 16.alpha

@cyrus-za
Copy link

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
Copy link

Seems like my issue is related to #99

@bsbechtel
Copy link

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
Copy link

s0meone commented Sep 28, 2017

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.

@s0meone s0meone closed this as completed Sep 28, 2017
@maierson
Copy link

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
Copy link

Works great @s0meone , thanks ;)

@bsbechtel
Copy link

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

@chenop
Copy link

chenop commented Oct 10, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants