babel-preset-react-app-new 0.0.4 → 1.0.0

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/create.js CHANGED
@@ -97,67 +97,8 @@ module.exports = function (api, opts, env) {
97
97
  isTypeScriptEnabled && [require('@babel/preset-typescript').default]
98
98
  ].filter(Boolean),
99
99
  plugins: [
100
- // Strip flow types before any other transform, emulating the behavior
101
- // order as-if the browser supported all of the succeeding features
102
- // https://github.com/facebook/create-react-app/pull/5182
103
- // We will conditionally enable this plugin below in overrides as it clashes with
104
- // @babel/plugin-proposal-decorators when using TypeScript.
105
- // https://github.com/facebook/create-react-app/issues/5741
106
- isFlowEnabled && [require('@babel/plugin-transform-flow-strip-types').default, false],
107
- // Experimental macros support. Will be documented after it's had some time
108
- // in the wild.
109
- require('babel-plugin-macros'),
110
- // Disabled as it's handled automatically by preset-env, and `selectiveLoose` isn't
111
- // yet merged into babel: https://github.com/babel/babel/pull/9486
112
- // Related: https://github.com/facebook/create-react-app/pull/8215
113
- // [
114
- // require('@babel/plugin-transform-destructuring').default,
115
- // {
116
- // // Use loose mode for performance:
117
- // // https://github.com/facebook/create-react-app/issues/5602
118
- // loose: false,
119
- // selectiveLoose: [
120
- // 'useState',
121
- // 'useEffect',
122
- // 'useContext',
123
- // 'useReducer',
124
- // 'useCallback',
125
- // 'useMemo',
126
- // 'useRef',
127
- // 'useImperativeHandle',
128
- // 'useLayoutEffect',
129
- // 'useDebugValue',
130
- // ],
131
- // },
132
- // ],
133
100
  [require('@babel/plugin-proposal-decorators').default, { legacy: true }],
134
- // class { handleClick = () => { } }
135
- // Enable loose mode to use assignment instead of defineProperty
136
- // See discussion in https://github.com/facebook/create-react-app/issues/4263
137
- // Note:
138
- // 'loose' mode configuration must be the same for
139
- // * @babel/plugin-proposal-class-properties
140
- // * @babel/plugin-proposal-private-methods
141
- // * @babel/plugin-proposal-private-property-in-object
142
- // (when they are enabled)
143
- [
144
- require('@babel/plugin-proposal-class-properties').default,
145
- {
146
- loose: true
147
- }
148
- ],
149
- [
150
- require('@babel/plugin-proposal-private-methods').default,
151
- {
152
- loose: true
153
- }
154
- ],
155
- [
156
- require('@babel/plugin-proposal-private-property-in-object').default,
157
- {
158
- loose: true
159
- }
160
- ],
101
+
161
102
  // Polyfills the runtime needed for async/await, generators, and friends
162
103
  // https://babeljs.io/docs/en/babel-plugin-transform-runtime
163
104
  [
@@ -179,20 +120,7 @@ module.exports = function (api, opts, env) {
179
120
  // https://github.com/babel/babel/blob/090c364a90fe73d36a30707fc612ce037bdbbb24/packages/babel-plugin-transform-runtime/src/index.js#L35-L42
180
121
  absoluteRuntime: absoluteRuntimePath
181
122
  }
182
- ],
183
- isEnvProduction && [
184
- // Remove PropTypes from production build
185
- require('babel-plugin-transform-react-remove-prop-types').default,
186
- {
187
- removeImport: true
188
- }
189
123
  ]
190
- ].filter(Boolean),
191
- overrides: [
192
- isFlowEnabled && {
193
- exclude: /\.tsx?$/,
194
- plugins: [require('@babel/plugin-transform-flow-strip-types').default]
195
- }
196
124
  ].filter(Boolean)
197
125
  };
198
126
  };
package/dependencies.js CHANGED
@@ -96,31 +96,6 @@ module.exports = function (api, opts) {
96
96
  ]
97
97
  ].filter(Boolean),
98
98
  plugins: [
99
- // Disabled as it's handled automatically by preset-env, and `selectiveLoose` isn't
100
- // yet merged into babel: https://github.com/babel/babel/pull/9486
101
- // Related: https://github.com/facebook/create-react-app/pull/8215
102
- // [
103
- // require('@babel/plugin-transform-destructuring').default,
104
- // {
105
- // // Use loose mode for performance:
106
- // // https://github.com/facebook/create-react-app/issues/5602
107
- // loose: false,
108
- // selectiveLoose: [
109
- // 'useState',
110
- // 'useEffect',
111
- // 'useContext',
112
- // 'useReducer',
113
- // 'useCallback',
114
- // 'useMemo',
115
- // 'useRef',
116
- // 'useImperativeHandle',
117
- // 'useLayoutEffect',
118
- // 'useDebugValue',
119
- // ],
120
- // },
121
- // ],
122
- // Polyfills the runtime needed for async/await, generators, and friends
123
- // https://babeljs.io/docs/en/babel-plugin-transform-runtime
124
99
  [
125
100
  require('@babel/plugin-transform-runtime').default,
126
101
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babel-preset-react-app-new",
3
- "version": "0.0.4",
3
+ "version": "1.0.0",
4
4
  "description": "Babel preset used by Create React App",
5
5
  "repository": {
6
6
  "type": "git",
@@ -21,22 +21,12 @@
21
21
  "test.js"
22
22
  ],
23
23
  "dependencies": {
24
- "@babel/core": "^7.22.9",
25
- "@babel/plugin-proposal-class-properties": "^7.18.6",
26
- "@babel/plugin-proposal-decorators": "^7.22.7",
27
- "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
28
- "@babel/plugin-proposal-numeric-separator": "^7.18.6",
29
- "@babel/plugin-proposal-optional-chaining": "^7.21.0",
30
- "@babel/plugin-proposal-private-property-in-object": "^7.21.11",
31
- "@babel/plugin-proposal-private-methods": "^7.18.6",
32
- "@babel/plugin-transform-flow-strip-types": "^7.22.5",
33
- "@babel/plugin-transform-react-display-name": "^7.22.5",
34
- "@babel/plugin-transform-runtime": "^7.22.9",
35
- "@babel/preset-env": "^7.22.9",
36
- "@babel/preset-react": "^7.22.5",
37
- "@babel/preset-typescript": "^7.22.5",
38
- "@babel/runtime": "^7.22.6",
39
- "babel-plugin-macros": "^3.1.0",
40
- "babel-plugin-transform-react-remove-prop-types": "^0.4.24"
24
+ "@babel/core": "^7.24.5",
25
+ "@babel/plugin-proposal-decorators": "^7.24.1",
26
+ "@babel/plugin-transform-runtime": "^7.24.3",
27
+ "@babel/preset-env": "^7.24.5",
28
+ "@babel/preset-react": "^7.24.1",
29
+ "@babel/preset-typescript": "^7.24.1",
30
+ "@babel/runtime": "^7.24.5"
41
31
  }
42
32
  }