HenrikJoreteg / redux-bundler

Compose a Redux store out of smaller bundles of functionality.
https://reduxbundler.com
583 stars 46 forks source link

support for react-native #15

Closed quarkcore closed 6 years ago

quarkcore commented 6 years ago

would it be possible to also have support for react native?

atm following error prevents from proper build: E/ReactNativeJS: Can't find variable: self

maybe related to: https://github.com/facebook/react-native/issues/1419

the polyfill provided in the thread either doesnt seem to solve this issue.

HenrikJoreteg commented 6 years ago

@quarkcore it sounds like that is the issue. It's fairly important to me that redux-bundler keeps working in a web worker, which is why it looks for self instead of window.

As long as the very first piece of code that ran was global.self = global it seems like that would fix this no?

quarkcore commented 6 years ago

@HenrikJoreteg yeah! your suggestion seems to work. even the polyfill mentioned above trys to do the same..

maybe this should go in the docs or somewhere?

HenrikJoreteg commented 6 years ago

@quarkcore I wonder if perhaps it just wasn't ending up first in the source somehow. Anyway, glad it worked. If you'd submit a pull request adding a note about this to the docs, that'd be great. The /docs folder is just a bunch of markdown files, and it re-builds the doc site with each merge to master.