babel-preset-react-app 5.0.0 → 5.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2013-present, Facebook, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -3,8 +3,8 @@
3
3
  This package includes the Babel preset used by [Create React App](https://github.com/facebook/create-react-app).<br>
4
4
  Please refer to its documentation:
5
5
 
6
- * [Getting Started](https://github.com/facebook/create-react-app/blob/master/README.md#getting-started) – How to create a new app.
7
- * [User Guide](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md) – How to develop apps bootstrapped with Create React App.
6
+ - [Getting Started](https://github.com/facebook/create-react-app/blob/master/README.md#getting-started) – How to create a new app.
7
+ - [User Guide](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md) – How to develop apps bootstrapped with Create React App.
8
8
 
9
9
  ## Usage in Create React App Projects
10
10
 
package/create.js CHANGED
@@ -82,6 +82,8 @@ module.exports = function(api, opts, env) {
82
82
  useBuiltIns: false,
83
83
  // Do not transform modules to CJS
84
84
  modules: false,
85
+ // Exclude transforms that make all code slower
86
+ exclude: ['transform-typeof-symbol'],
85
87
  },
86
88
  ],
87
89
  [
@@ -95,9 +97,13 @@ module.exports = function(api, opts, env) {
95
97
  useBuiltIns: true,
96
98
  },
97
99
  ],
98
- isFlowEnabled && [require('@babel/preset-flow').default],
99
100
  ].filter(Boolean),
100
101
  plugins: [
102
+ // Strip flow types before any other transform, emulating the behavior
103
+ // order as-if the browser supported all of the succeeding features
104
+ // https://github.com/facebook/create-react-app/pull/5182
105
+ isFlowEnabled &&
106
+ require('@babel/plugin-transform-flow-strip-types').default,
101
107
  // Experimental macros support. Will be documented after it's had some time
102
108
  // in the wild.
103
109
  require('babel-plugin-macros'),
@@ -152,7 +158,7 @@ module.exports = function(api, opts, env) {
152
158
  require('@babel/plugin-syntax-dynamic-import').default,
153
159
  isEnvTest &&
154
160
  // Transform dynamic import to require
155
- require('babel-plugin-transform-dynamic-import').default,
161
+ require('babel-plugin-dynamic-import-node'),
156
162
  ].filter(Boolean),
157
163
  };
158
164
  };
package/dependencies.js CHANGED
@@ -76,6 +76,8 @@ module.exports = function(api, opts) {
76
76
  },
77
77
  // Do not transform modules to CJS
78
78
  modules: false,
79
+ // Exclude transforms that make all code slower
80
+ exclude: ['transform-typeof-symbol'],
79
81
  },
80
82
  ],
81
83
  (isEnvProduction || isEnvDevelopment) && [
@@ -95,6 +97,8 @@ module.exports = function(api, opts) {
95
97
  useBuiltIns: false,
96
98
  // Do not transform modules to CJS
97
99
  modules: false,
100
+ // Exclude transforms that make all code slower
101
+ exclude: ['transform-typeof-symbol'],
98
102
  },
99
103
  ],
100
104
  ].filter(Boolean),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babel-preset-react-app",
3
- "version": "5.0.0",
3
+ "version": "5.0.4",
4
4
  "description": "Babel preset used by Create React App",
5
5
  "repository": "facebook/create-react-app",
6
6
  "license": "MIT",
@@ -23,16 +23,16 @@
23
23
  "@babel/plugin-syntax-dynamic-import": "7.0.0",
24
24
  "@babel/plugin-transform-classes": "7.1.0",
25
25
  "@babel/plugin-transform-destructuring": "7.0.0",
26
+ "@babel/plugin-transform-flow-strip-types": "7.0.0",
26
27
  "@babel/plugin-transform-react-constant-elements": "7.0.0",
27
28
  "@babel/plugin-transform-react-display-name": "7.0.0",
28
29
  "@babel/plugin-transform-runtime": "7.1.0",
29
30
  "@babel/preset-env": "7.1.0",
30
- "@babel/preset-flow": "7.0.0",
31
31
  "@babel/preset-react": "7.0.0",
32
32
  "@babel/runtime": "7.0.0",
33
33
  "babel-loader": "8.0.4",
34
+ "babel-plugin-dynamic-import-node": "2.2.0",
34
35
  "babel-plugin-macros": "2.4.2",
35
- "babel-plugin-transform-dynamic-import": "2.1.0",
36
36
  "babel-plugin-transform-react-remove-prop-types": "0.4.18"
37
37
  }
38
38
  }