diff --git a/packages/cra-universal/README.md b/packages/cra-universal/README.md index 346b04a..a28405a 100644 --- a/packages/cra-universal/README.md +++ b/packages/cra-universal/README.md @@ -2,8 +2,7 @@ ### Create React App Universal CLI -[![npm version](https://badge.fury.io/js/cra-universal.svg)](https://badge.fury.io/js/cra-universal) -[![Build Status](https://travis-ci.org/antonybudianto/cra-universal.svg?branch=master)](https://travis-ci.org/antonybudianto/cra-universal) [![Greenkeeper badge](https://badges.greenkeeper.io/antonybudianto/cra-universal.svg)](https://greenkeeper.io/) +[![Financial Contributors on Open Collective](https://opencollective.com/cra-universal/all/badge.svg?label=financial+contributors)](https://opencollective.com/cra-universal) [![npm version](https://badge.fury.io/js/cra-universal.svg)](https://badge.fury.io/js/cra-universal)

zero @@ -11,7 +10,7 @@ Create React App companion for universal app. No eject, zero config with customization, supports string and node stream API -> [Live Demo](https://cra-universal.now.sh/) | [Official Doc](https://antonybudianto.github.io/cra-universal) +> [Live Demo](https://codesandbox.io/s/cra-universal-demo-9wnwb7) | [Official Doc](https://antonybudianto.github.io/cra-universal) ## Features @@ -24,7 +23,7 @@ Create React App companion for universal app. No eject, zero config with customi ## Prerequisites -- Node >= 8.6 recommended +- Node >= 14.17.5 LTS recommended - npx is required ## Installation @@ -38,7 +37,24 @@ cd myapp yarn add -D cra-universal # Install peer dependency -yarn add @cra-express/core +yarn add @cra-express/core express@4.18.1 +``` + +## Existing Projects + +```sh + +# Install new cra-universal +yarn add -D cra-universal + +# Install peer dependency +yarn add @cra-express/core express@4.18.1 + +# init custom server (optional) +yarn run cra-universal init + +#This will copy ./templates/server into the current directory (it should be run on CRA client root) + ``` ## Client code change @@ -47,10 +63,11 @@ Please update your render method on `src/index.js` ```js // before -ReactDOM.render(...) +const root = ReactDOM.createRoot(document.getElementById('root')); +root.render(); // after -ReactDOM.hydrate(...) +ReactDOM.hydrateRoot(document.getElementById('root'), ); ``` ## Development @@ -71,8 +88,8 @@ npx cra-universal build # This command will build both client and server and put them into `./dist` # Run locally: -# $ node --preserve-symlinks dist/server/bundle.js -# You only need `--preserve-symlinks` on local, since we only do symlinks on development. +# $ cd dist && npm i +# $ npm run serve ``` ## Deployment @@ -94,6 +111,36 @@ If you like this project, please kindly support it by becoming a patron at my [P - Stan Day (stan@auraside.com) +## Contributors + +### Code Contributors + +This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]. + + +### Financial Contributors + +Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/cra-universal/contribute)] + +#### Individuals + + + +#### Organizations + +Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/cra-universal/contribute)] + + + + + + + + + + + + ## License MIT