|
1 |
| -# React 18 template ⚛️ |
2 |
| -> Faster as it should be. This template has stripped all tests and dust that is included with CRA (`create-react-app`) template. |
3 |
| -> |
4 |
| -> A very minimal and skimmed setup of React. Hope you liked it. ✌🏽 |
| 1 | +# react-esbuild-starter |
5 | 2 |
|
6 |
| -## Default package manager: Yarn (lighter than NPM) |
7 |
| -> You can use NPM too, just remove the `yarn.lock` in that case. |
| 3 | +Starter template for React and Typescript. |
| 4 | +Inspired by https://github.com/sikanhe/rescript-esbuild-starter |
8 | 5 |
|
| 6 | +It provides minimal yet 🔥 blazing fast ™ development boilerplate for rapid React prototyping. |
9 | 7 |
|
10 |
| -       |
| 8 | +- `yarn start` Starts typescript typechecking and esbuild in watch mode, and serves web page at localhost:5000. |
| 9 | +- `yarn build` Builds production bundle for browser, outputs bundle to dist/bundle.js with source map. |
| 10 | +- `yarn clean` Clean up assets produced by esbuild. |
11 | 11 |
|
12 |
| -[](https://github.com/prettier/prettier)   |
13 |
| -[](http://standardjs.com) |
| 12 | +All code bundling and transpilation is handled by esbuild. Its configuration is kept inside `esbuild.config.mjs`. Follow [esbuild docs](https://esbuild.github.io/getting-started/) to see all supported options. |
14 | 13 |
|
15 |
| -## ⚠️This template uses React 18-rc⚠️ |
16 |
| -Since React18 is the future and already in the release candidate, i felt confident of using the rc version of react and react-dom in the template. Not major changes would be made in `rc -> latest release`. |
| 14 | +### Caveats |
17 | 15 |
|
18 |
| -Please read the [docs](https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html) for more information about the changes from **React 17 to 18**. |
19 |
| - |
20 |
| -### P.S |
21 |
| -> React 18 uses a new Client Root API, documented below, same has been explained well in `App.js` inside the `src` folder. |
22 |
| -
|
23 |
| - |
24 |
| -```jsx |
25 |
| -// New ROOT API in React 18 ⚛️ |
26 |
| -import { createRoot } from 'react-dom/client'; |
27 |
| -const container = document.getElementById('app'); |
28 |
| -const root = createRoot(container); |
29 |
| -root.render(<App {...props} />); |
30 |
| -``` |
31 |
| - |
32 |
| -## Running the project on port 2000 |
33 |
| -```shell |
34 |
| -npm install |
35 |
| -npm run start |
36 |
| -``` |
37 |
| -> That's it ✌🏽 (Installing the dependencies might take time, depending upon your workstation's computing power and network bandwidth available). |
38 |
| -
|
39 |
| -**After `npm run start` open: [ReactApp🔗](http://127.0.0.1:2000) ** |
40 |
| - |
41 |
| ---- |
42 |
| - |
43 |
| -### Advanced Implementations ahead (skip if not needed) |
44 |
| - |
45 |
| -**Please checkout the branch as per your requirement, currently the branches are:** |
46 |
| - |
47 |
| -1. **NextJS with Tailwind** `nextjs-tailwind` -> https://github.com/nooobcoder/clean-react-app/tree/nextjs-tailwind |
48 |
| - |
49 |
| -2. **NextJS with TypeScript** `nextjs-typescript` -> https://github.com/nooobcoder/clean-react-app/tree/nextjs-typescript |
50 |
| - |
51 |
| -3. **React with Typescript (very strict typechecks)** `typescript-react-app` -> https://github.com/nooobcoder/clean-react-app/tree/typescript-react-app |
52 |
| - |
53 |
| ---- |
54 |
| - |
55 |
| -A very clean React App ⚛️ starter template by [Ankur Paul](https://github.com/nooobcoder) |
56 |
| - |
57 |
| ---- |
58 |
| - |
59 |
| - |
| 16 | +- No output file hashing |
| 17 | +- No test runner |
| 18 | +- Importing CSS in JS file is not supported in esbuild yet. It is currently in development https://github.com/evanw/esbuild/issues/20. In meantime either opt-in for some CSS-in-JS solution, or include styles directly in `www/index.html`. |
0 commit comments