Skip to content
This repository has been archived by the owner on Jan 26, 2020. It is now read-only.

issues when importing react-native-web from multiple bundles #78

Open
alidcast opened this issue Dec 23, 2018 · 2 comments
Open

issues when importing react-native-web from multiple bundles #78

alidcast opened this issue Dec 23, 2018 · 2 comments

Comments

@alidcast
Copy link
Owner

alidcast commented Dec 23, 2018

support for react-native-web is done (same API, just import @roguejs/app/client.native and @roguejs/app/server.native) however, there's an issue with server-rendering critial css if you're using webpack (which most people are, specially since we recommend rogue with razzle) because it doesn't use require.cache when compiling to the Node.js target, instead it uses it's own installed modules cache which causes problems with singleton states if the code comes from multiple bundles

this issue was discovered with react-native-web/nextjs, for details see:
necolas/react-native-web#1079
https://spectrum.chat/next-js/general/singleton-issue-when-transpiling-local-modules~ba78d3a3-4ab3-48ef-9b77-956642dfbdb1?m=MTUzNjY3MTEzMDI0NQ==

for now, we'll recommend setting up programmatically. you can just look at packages/app/native-web to see how, but i'll also add it to the examples

@alidcast alidcast changed the title add support for react-native-web webpack caching issues when importing react-native-web from multiple bundles Dec 23, 2018
@alidcast
Copy link
Owner Author

I opened up an issue in razzle: jaredpalmer/razzle#868

@alidcast
Copy link
Owner Author

looks like the above is actually a separate issue, and the issue is we were importing react-native-web rather than react-native which I'm guessing result in two different runtimes

but when we import react-native, it causes an error likely becuase the babl plugin doesnt work with transpiled files

TypeError: (0 , _unstableNativeDependencies.injectEventPluginsByName) is not a function

@alidcast alidcast changed the title webpack caching issues when importing react-native-web from multiple bundles issues when importing react-native-web from multiple bundles Dec 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant