Skip to content

Commit

Permalink
docs(readme): update pkg cra-universal readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Antony Budianto authored May 2, 2022
1 parent 33cfa3f commit 4dda869
Showing 1 changed file with 56 additions and 9 deletions.
65 changes: 56 additions & 9 deletions packages/cra-universal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@

### 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)

<p align="center">
<img width="500" height="350" alt="zero" src="https://user-images.githubusercontent.com/7658554/42420108-261a1c5a-82eb-11e8-8ac0-ce2e0245e0ff.png">
</p>

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

Expand All @@ -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
Expand All @@ -38,7 +37,24 @@ cd myapp
yarn add -D cra-universal

# Install peer dependency
yarn add @cra-express/core
yarn add @cra-express/core [email protected]
```

## Existing Projects

```sh

# Install new cra-universal
yarn add -D cra-universal

# Install peer dependency
yarn add @cra-express/core [email protected]

# 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
Expand All @@ -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(<App />);

// after
ReactDOM.hydrate(...)
ReactDOM.hydrateRoot(document.getElementById('root'), <App />);
```

## Development
Expand All @@ -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
Expand All @@ -94,6 +111,36 @@ If you like this project, please kindly support it by becoming a patron at my [P

- Stan Day ([email protected])

## Contributors

### Code Contributors

This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
<a href="https://github.com/antonybudianto/cra-universal/graphs/contributors"><img src="https://opencollective.com/cra-universal/contributors.svg?width=890&button=false" /></a>

### Financial Contributors

Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/cra-universal/contribute)]

#### Individuals

<a href="https://opencollective.com/cra-universal"><img src="https://opencollective.com/cra-universal/individuals.svg?width=890"></a>

#### 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)]

<a href="https://opencollective.com/cra-universal/organization/0/website"><img src="https://opencollective.com/cra-universal/organization/0/avatar.svg"></a>
<a href="https://opencollective.com/cra-universal/organization/1/website"><img src="https://opencollective.com/cra-universal/organization/1/avatar.svg"></a>
<a href="https://opencollective.com/cra-universal/organization/2/website"><img src="https://opencollective.com/cra-universal/organization/2/avatar.svg"></a>
<a href="https://opencollective.com/cra-universal/organization/3/website"><img src="https://opencollective.com/cra-universal/organization/3/avatar.svg"></a>
<a href="https://opencollective.com/cra-universal/organization/4/website"><img src="https://opencollective.com/cra-universal/organization/4/avatar.svg"></a>
<a href="https://opencollective.com/cra-universal/organization/5/website"><img src="https://opencollective.com/cra-universal/organization/5/avatar.svg"></a>
<a href="https://opencollective.com/cra-universal/organization/6/website"><img src="https://opencollective.com/cra-universal/organization/6/avatar.svg"></a>
<a href="https://opencollective.com/cra-universal/organization/7/website"><img src="https://opencollective.com/cra-universal/organization/7/avatar.svg"></a>
<a href="https://opencollective.com/cra-universal/organization/8/website"><img src="https://opencollective.com/cra-universal/organization/8/avatar.svg"></a>
<a href="https://opencollective.com/cra-universal/organization/9/website"><img src="https://opencollective.com/cra-universal/organization/9/avatar.svg"></a>

## License

MIT

0 comments on commit 4dda869

Please sign in to comment.