yahoo / fluxible

A pluggable container for universal flux applications.

Home Page:http://fluxible.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[fluxible-addons-react] batchedUpdatePlugin breaks compatibility with react-native

malaman opened this issue · comments

Hello,
fluxible-addons-react has inherits as a dependency.
inherits uses node.js util.inerits function to work in non-browser enviroments.
We are trying to integrate fluxibe/fluxible-addons-react with react-native and usage of the node.utils breaks integration with react-native.
I've changed inherits module to custom inherits without node imports and integration seems to work fine.
Could you please change this in the fluxible-addons-react package?

@malaman which version of fluxible-addons-react are you using? We actually depend on the "inherits" modules:

fluxible-addons-react: 0.2.8
I can address issue to inherits repository, but i have doubts they will change something for the react-native compatibility of fluxible-addons-react.

Oh I see, we can probably find another inherits version on npm that satisifies react-native and doesn't use the native one. You are welcome to open a PR if you want.

Ok. I will look for alternatives and open PR, if I find something.

surprised this is an issue

thanks to facebook/react-native#2208, react-native should fallback to the browser field of packages if one is specified.

I would check if explicitly adding a react-native field to the inherits package.json that points to the browser impl fixes it for you and if so PR-ing that change to inherits.

Hi again,
I've made additional debugs of the issue.
The reason of errors is not the inherits module, but batchedUpdatePlugin in the fluxible-addons-react.
If i've commented batchedUpdatePlugin from the module.exports in the fluxible-addons-react/index.js, and receive no errors.
I've prepared basic example of integration:
https://github.com/malaman/fluxible-react-native

Currently we import connectToStores and provideContext directly from source files as workaround for batchedUpdatePlugin issue.

import connectToStores from 'fluxible-addons-react/connectToStores';
import provideContext from 'fluxible-addons-react/provideContext';

I've updated example repository (https://github.com/malaman/fluxible-react-native) in case if someone will face same issue.