You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Avoid source map generation for faster builds](#avoid-source-map-generation-for-faster-builds)
25
25
-[Change the port of the dev environment](#change-the-port-of-the-dev-environment)
26
26
-[Import SVGs as ReactComponent](#import-svgs-as-reactcomponent)
27
+
-[Use plain JavaScript instead of TypeScript](#use-plain-javascript-instead-of-typescript)
27
28
-[Caveats](#caveats)
28
29
-[Todo](#todo)
29
30
-[Changelog](#changelog)
@@ -50,9 +51,9 @@ This project has out-of-the-box support for the following things:
50
51
51
52
- General Setup
52
53
- 🔥 Babel 7
53
-
-🔥 Webpack 4
54
+
-📦 Webpack 4
54
55
- 🔥 ESLint 5 (with a set of custom rules which may be mostly identical to AirBnB with some personal flavor added)
55
-
- 🔥 Flow Type
56
+
- 🔥 TypeScript (via Babel)
56
57
- 🔥 Prettier
57
58
- 🔥 Jest 24
58
59
- ✅ Server Side Rendering with Express
@@ -168,6 +169,18 @@ Then you can use it in JSX like `<div><Logo /></div>`.
168
169
169
170
[Here is a video](https://egghead.io/lessons/react-add-svgs-as-react-components-with-create-react-app-2-0) that explains that a bit more.
170
171
172
+
### Use plain JavaScript instead of TypeScript
173
+
174
+
You can just do it™. Really. Name your files `.js` instead of `.ts`/`.tsx` and you should not be bothered by TypeScript anymore. If you want to _fully_ remove TypeScript:
175
+
176
+
- remove the `@babel/typescript` preset from `babel.config.js`
- uninstall all dependencies beginning with `@types/`
179
+
- delete `tsconfig.json` and `src/global.d.ts`
180
+
- remove `wiremore/typescript` from the `extends` section in `.eslintrc.js`
181
+
- remove all types from all files if there still are any
182
+
- remove `tsConfig` option from `.dependency-cruiser.js`
183
+
171
184
## Caveats
172
185
173
186
-~~[1] MiniCSSExtractPlugin doesn't play nicely with consecutive builds in Webpack's watchmode yet ([Github issue here](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/23)). So I'm using ExtractTextWebpackPlugin until this is fixed~~ Fixed! [490e6e9](https://github.com/manuelbieh/react-ssr-setup/commit/490e6e95fc811b0ce42d1bbc1252d3f26c4bd1ab)
@@ -184,7 +197,7 @@ Then you can use it in JSX like `<div><Logo /></div>`.
184
197
-[x]~~Add `react-loadable` or `react-universal-component` (or both, still investigating what makes most sense). **Update:**`react-loadable` is out due to [questionable license change](https://github.com/jamiebuilds/react-loadable/commit/c3272b3132e4fe25937c3610b7cd0dd2da48c5e9)~~ Just use React.lazy which was introduced in React 16.6.
185
198
-[x] Improve server side template
186
199
-[x] Add (and use) `react-helmet`
187
-
-[ ] Add/improve server side chunk loading
200
+
-[ ]~~Add/improve server side chunk loading~~ - Wait for the new React Fizz Renderer to land
188
201
-[x] Add test setup using Jest
189
202
-[ ] Add `optimize-css-assets-webpack-plugin` and `postcss-safe-parser` similar to how CRA 2 is doing it
190
203
-[x] Modify ~~`svg-loader`~~`babel-loader` so SVGs can be imported as React component (see CRA 2)
0 commit comments