Commit 746d9bb
authored
Create React App v2 support (codesandbox#1124)
Adds a check to the React template for v2, if it is indeed v2 it will add:
- CSS Modules + Sass (+module) versions of the transpilers.
- Babel 7 transpiler with `env` and `react` presets and `babel-plugin-macros` plugin (am I missing anything?), we preload `babel-plugin-macros` in the transpiler.
- A browser compatible `svgr-loader` which along with default export of file public path will also export `ReactComponent`.
Along with this update I improved how our workers load to prefer hot workers over cold ones. This has a speed improvement for React since the babel worker now needs all project files for React (because of `macros`) and loading takes a while when the worker is cold.
I also add a prebundled `@babel/runtime` for efficiency, I removed the prebundled `babel-runtime` in favor of dynamically downloading/loading it using the bundler. It turns out you never need all files for `babel-runtime` and shipping it with the bundler only increases parse/download time without being of much use.
Note to self, release server `b475c4e` with this.
Test sandbox: http://pr1124.cs.lbogdan.tk/s/z3rwnzm6p41 parent 93808ad commit 746d9bb
File tree
256 files changed
+654
-1121
lines changed- packages/app
- config
- src/sandbox
- eval
- loaders
- babel-runtime
- core-js
- array
- error
- json
- math
- number
- object
- reflect
- regexp
- string
- symbol
- system
- helpers
- regenerator
- presets
- create-react-app
- transpilers
- babel
- worker
- svgr
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
256 files changed
+654
-1121
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
213 | 222 | | |
214 | 223 | | |
215 | 224 | | |
| |||
266 | 275 | | |
267 | 276 | | |
268 | 277 | | |
269 | | - | |
| 278 | + | |
270 | 279 | | |
271 | 280 | | |
272 | 281 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
104 | 105 | | |
105 | 106 | | |
106 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
113 | 112 | | |
114 | 113 | | |
115 | 114 | | |
| 115 | + | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
268 | 273 | | |
269 | 274 | | |
270 | 275 | | |
| |||
Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 0 additions & 1 deletion
This file was deleted.
0 commit comments