metro-react-native-babel-preset
Advanced tools
Comparing version 0.69.1 to 0.70.0
{ | ||
"name": "metro-react-native-babel-preset", | ||
"version": "0.69.1", | ||
"version": "0.70.0", | ||
"description": "Babel preset for React Native applications", | ||
@@ -41,3 +41,2 @@ "main": "src/index.js", | ||
"@babel/plugin-transform-flow-strip-types": "^7.0.0", | ||
"@babel/plugin-transform-for-of": "^7.0.0", | ||
"@babel/plugin-transform-function-name": "^7.0.0", | ||
@@ -51,3 +50,2 @@ "@babel/plugin-transform-literals": "^7.0.0", | ||
"@babel/plugin-transform-react-jsx-source": "^7.0.0", | ||
"@babel/plugin-transform-regenerator": "^7.0.0", | ||
"@babel/plugin-transform-async-to-generator": "^7.0.0", | ||
@@ -54,0 +52,0 @@ "@babel/plugin-transform-runtime": "^7.0.0", |
@@ -23,3 +23,3 @@ /** | ||
const defaultPluginsBeforeRegenerator = [ | ||
const defaultPlugins = [ | ||
[require("@babel/plugin-syntax-flow")], | ||
@@ -36,4 +36,2 @@ [require("@babel/plugin-transform-block-scoping")], | ||
...passthroughSyntaxPlugins, | ||
]; | ||
const defaultPluginsAfterRegenerator = [ | ||
[require("@babel/plugin-transform-unicode-regex")], | ||
@@ -45,11 +43,7 @@ ]; | ||
(options && options.unstable_transformProfile) || "default"; | ||
const isHermesStable = transformProfile === "hermes-stable"; // Temporarily treating canary profile as "ES5 Hermes". | ||
// TODO(jsx): Restore check for transformProfile === 'hermes-canary' | ||
const isHermesCanary = false; | ||
const isHermesStable = transformProfile === "hermes-stable"; | ||
const isHermesCanary = transformProfile === "hermes-canary"; | ||
const isHermes = isHermesStable || isHermesCanary; | ||
const isNull = src == null; | ||
const hasClass = isNull || src.indexOf("class") !== -1; | ||
const hasForOf = | ||
isNull || (src.indexOf("for") !== -1 && src.indexOf("of") !== -1); | ||
const extraPlugins = []; | ||
@@ -140,8 +134,3 @@ | ||
]); | ||
if (isHermes) { | ||
extraPlugins.push([ | ||
require("@babel/plugin-transform-async-to-generator"), | ||
]); | ||
} | ||
extraPlugins.push([require("@babel/plugin-transform-async-to-generator")]); | ||
} | ||
@@ -155,11 +144,2 @@ | ||
if (!isHermes && hasForOf) { | ||
extraPlugins.push([ | ||
require("@babel/plugin-transform-for-of"), | ||
{ | ||
loose: true, | ||
}, | ||
]); | ||
} | ||
if ( | ||
@@ -197,2 +177,7 @@ isNull || | ||
if (!options || options.enableBabelRuntime !== false) { | ||
// Allows configuring a specific runtime version to optimize output | ||
const isVersion = | ||
typeof (options === null || options === void 0 | ||
? void 0 | ||
: options.enableBabelRuntime) === "string"; | ||
extraPlugins.push([ | ||
@@ -203,2 +188,5 @@ require("@babel/plugin-transform-runtime"), | ||
regenerator: !isHermes, | ||
...(isVersion && { | ||
version: options.enableBabelRuntime, | ||
}), | ||
}, | ||
@@ -218,7 +206,3 @@ ]); | ||
{ | ||
plugins: [ | ||
...defaultPluginsBeforeRegenerator, | ||
isHermes ? null : require("@babel/plugin-transform-regenerator"), | ||
...defaultPluginsAfterRegenerator, | ||
].filter(Boolean), | ||
plugins: defaultPlugins, | ||
}, | ||
@@ -225,0 +209,0 @@ { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39
14653
355
+ Addedbrowserslist@4.24.0(transitive)
+ Addedcaniuse-lite@1.0.30001664(transitive)
+ Addedelectron-to-chromium@1.5.29(transitive)
+ Addedupdate-browserslist-db@1.1.1(transitive)
- Removed@babel/plugin-transform-for-of@7.24.7(transitive)
- Removed@babel/plugin-transform-regenerator@7.24.7(transitive)
- Removed@babel/runtime@7.25.6(transitive)
- Removedbrowserslist@4.23.3(transitive)
- Removedcaniuse-lite@1.0.30001663(transitive)
- Removedelectron-to-chromium@1.5.27(transitive)
- Removedregenerator-runtime@0.14.1(transitive)
- Removedregenerator-transform@0.15.2(transitive)
- Removedupdate-browserslist-db@1.1.0(transitive)