babel-preset-react-app 10.0.0-next.98 → 10.1.0-next.14
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +1 -1
- package/create.js +19 -5
- package/package.json +18 -17
package/README.md
CHANGED
@@ -30,7 +30,7 @@ Then create a file named `.babelrc` with following contents in the root folder o
|
|
30
30
|
}
|
31
31
|
```
|
32
32
|
|
33
|
-
This preset uses the `useBuiltIns` option with [transform-object-rest-spread](
|
33
|
+
This preset uses the `useBuiltIns` option with [transform-object-rest-spread](https://babeljs.io/docs/plugins/transform-object-rest-spread/) and [transform-react-jsx](https://babeljs.io/docs/plugins/transform-react-jsx/), which assumes that `Object.assign` is available or polyfilled.
|
34
34
|
|
35
35
|
## Usage with Flow
|
36
36
|
|
package/create.js
CHANGED
@@ -54,10 +54,6 @@ module.exports = function (api, opts, env) {
|
|
54
54
|
);
|
55
55
|
}
|
56
56
|
|
57
|
-
var hasJsxRuntime = Boolean(
|
58
|
-
api.caller(caller => !!caller && caller.hasJsxRuntime)
|
59
|
-
);
|
60
|
-
|
61
57
|
if (!isEnvDevelopment && !isEnvProduction && !isEnvTest) {
|
62
58
|
throw new Error(
|
63
59
|
'Using `babel-preset-react-app` requires that you specify `NODE_ENV` or ' +
|
@@ -99,7 +95,7 @@ module.exports = function (api, opts, env) {
|
|
99
95
|
development: isEnvDevelopment || isEnvTest,
|
100
96
|
// Will use the native built-in instead of trying to polyfill
|
101
97
|
// behavior for any plugins that require one.
|
102
|
-
...(
|
98
|
+
...(opts.runtime !== 'automatic' ? { useBuiltIns: true } : {}),
|
103
99
|
runtime: opts.runtime || 'classic',
|
104
100
|
},
|
105
101
|
],
|
@@ -150,12 +146,30 @@ module.exports = function (api, opts, env) {
|
|
150
146
|
// class { handleClick = () => { } }
|
151
147
|
// Enable loose mode to use assignment instead of defineProperty
|
152
148
|
// See discussion in https://github.com/facebook/create-react-app/issues/4263
|
149
|
+
// Note:
|
150
|
+
// 'loose' mode configuration must be the same for
|
151
|
+
// * @babel/plugin-proposal-class-properties
|
152
|
+
// * @babel/plugin-proposal-private-methods
|
153
|
+
// * @babel/plugin-proposal-private-property-in-object
|
154
|
+
// (when they are enabled)
|
153
155
|
[
|
154
156
|
require('@babel/plugin-proposal-class-properties').default,
|
155
157
|
{
|
156
158
|
loose: true,
|
157
159
|
},
|
158
160
|
],
|
161
|
+
[
|
162
|
+
require('@babel/plugin-proposal-private-methods').default,
|
163
|
+
{
|
164
|
+
loose: true,
|
165
|
+
},
|
166
|
+
],
|
167
|
+
[
|
168
|
+
require('@babel/plugin-proposal-private-property-in-object').default,
|
169
|
+
{
|
170
|
+
loose: true,
|
171
|
+
},
|
172
|
+
],
|
159
173
|
// Adds Numeric Separators
|
160
174
|
require('@babel/plugin-proposal-numeric-separator').default,
|
161
175
|
// Polyfills the runtime needed for async/await, generators, and friends
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "babel-preset-react-app",
|
3
|
-
"version": "10.
|
3
|
+
"version": "10.1.0-next.14+9802941f",
|
4
4
|
"description": "Babel preset used by Create React App",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -21,21 +21,22 @@
|
|
21
21
|
"test.js"
|
22
22
|
],
|
23
23
|
"dependencies": {
|
24
|
-
"@babel/core": "7.
|
25
|
-
"@babel/plugin-proposal-class-properties": "7.
|
26
|
-
"@babel/plugin-proposal-decorators": "7.
|
27
|
-
"@babel/plugin-proposal-nullish-coalescing-operator": "7.
|
28
|
-
"@babel/plugin-proposal-numeric-separator": "7.
|
29
|
-
"@babel/plugin-proposal-optional-chaining": "7.
|
30
|
-
"@babel/plugin-
|
31
|
-
"@babel/plugin-transform-
|
32
|
-
"@babel/plugin-transform-
|
33
|
-
"@babel/
|
34
|
-
"@babel/preset-
|
35
|
-
"@babel/preset-
|
36
|
-
"@babel/
|
37
|
-
"babel
|
38
|
-
"babel-plugin-
|
24
|
+
"@babel/core": "^7.16.0",
|
25
|
+
"@babel/plugin-proposal-class-properties": "^7.16.0",
|
26
|
+
"@babel/plugin-proposal-decorators": "^7.16.4",
|
27
|
+
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0",
|
28
|
+
"@babel/plugin-proposal-numeric-separator": "^7.16.0",
|
29
|
+
"@babel/plugin-proposal-optional-chaining": "^7.16.0",
|
30
|
+
"@babel/plugin-proposal-private-methods": "^7.16.0",
|
31
|
+
"@babel/plugin-transform-flow-strip-types": "^7.16.0",
|
32
|
+
"@babel/plugin-transform-react-display-name": "^7.16.0",
|
33
|
+
"@babel/plugin-transform-runtime": "^7.16.4",
|
34
|
+
"@babel/preset-env": "^7.16.4",
|
35
|
+
"@babel/preset-react": "^7.16.0",
|
36
|
+
"@babel/preset-typescript": "^7.16.0",
|
37
|
+
"@babel/runtime": "^7.16.3",
|
38
|
+
"babel-plugin-macros": "^3.1.0",
|
39
|
+
"babel-plugin-transform-react-remove-prop-types": "^0.4.24"
|
39
40
|
},
|
40
|
-
"gitHead": "
|
41
|
+
"gitHead": "9802941ff049a28da2682801bc182a29761b71f4"
|
41
42
|
}
|