react-native-dom icon indicating copy to clipboard operation
react-native-dom copied to clipboard

Writing full page component

Open naqvitalha opened this issue 6 years ago • 8 comments

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?

naqvitalha avatar May 22 '18 04:05 naqvitalha

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.

vincentriemer avatar May 22 '18 12:05 vincentriemer

How big are the bundle sizes right now?

naqvitalha avatar May 24 '18 03:05 naqvitalha

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

vincentriemer avatar May 24 '18 03:05 vincentriemer

Will bundle sizes eventually be smaller?

drejohnson avatar May 25 '18 07:05 drejohnson

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

vincentriemer avatar May 25 '18 10:05 vincentriemer

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

naqvitalha avatar May 25 '18 13:05 naqvitalha

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

vincentriemer avatar May 25 '18 13:05 vincentriemer

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

drejohnson avatar May 25 '18 19:05 drejohnson