A boilerplate for cross-platform React project - which let you run your React Native App on Native Mobile (iOs, Android), Native Windows and Web (Browser).
Extending React Native's initial structure using react-native-web and UI components form react-universal-ui.
- Boost up build speed (first time build massively faster)
- Allow skip common chunks (
yarn web-vendorstep) which always required onlegacyversion (however it is still highly recommended to use) - Improves
climessage,hot-loaderfor Browserdevelopment-server - Update to latest version of React, React Native ;)
- Most up to date
iOsandAndroidproject template (byreact-native-cli) - Official Windows support!
git clone https://github.com/cloudle/react-universal-ui-boilerplate.git
cd react-universal-ui-boilerplate
yarn install
yarn vendor
yarn web
Run yarn vendor once before run our yarn web make our development server rebuild faster (should be under 200 milliseconds)!
That really save our time and brain energy :p.
*note: yarn vendor cache our common library (e.g react, react-dom) into reusable chunks, that also mean it won't get update when we install newer version of those packages (see webpack.vendor.js for more information) - and we must re-run yarn vendor anytime those common libraries got updated.
Structure of this boilerplate including supports to run on Windows (Native).
It's pretty straight forward to add Windows build to our project (boilerplate) by follow the instruction by Microsoft here..
yarn vendorbuild common chunks to reuse to boost our rebuild time ;)yarn weblaunch our development server.yarn bundlerelease our production build underwebdirectory.yarn ios,yarn androidquick alias which launch ouriOsorAndroidemulator.yarn test,yarn start