vincentriemer / react-native-dom

An experimental, comprehensive port of React Native to the web.
https://rntester.now.sh
MIT License
3.25k stars 73 forks source link

Writing full page component #41

Open naqvitalha opened 6 years ago

naqvitalha commented 6 years ago

We have an exiting PWA, there are some routes that render components using RNW.

Is it possible to write an NPM module that is a full page size component and import in an existing PWA and run it using RND? Or, differently put how to integrate with an existing PWA such that few pages render with RND?

vincentriemer commented 6 years ago

While it's certainly a possibility, due to the massive bundle sizes produced from this project I don't think it's going to be a priority to support incremental adoption for the time being.

naqvitalha commented 6 years ago

How big are the bundle sizes right now?

vincentriemer commented 6 years ago

Hello world clocks in at around....500kb....gzipped (lol)

drejohnson commented 6 years ago

Will bundle sizes eventually be smaller?

vincentriemer commented 6 years ago

Hopefully yeah, I think the biggest win could come from metro adding DCE/tree shaking, but it would be also cool if we could investigate if it would be possible to do tree shaking across a web worker

naqvitalha commented 6 years ago

Why not make the production build with webpack? Dev experience can still be great using metro.

vincentriemer commented 6 years ago

Webpack would need to understand the haste @providesModule annotations because that's how this project selectively overrides core components.

EDIT: Not to mention the asset loading behavior which is very react-native/metro specific

drejohnson commented 6 years ago

Found this tool for building react-native apps with webpack: https://github.com/callstack/haul