Socket
Socket
Sign inDemoInstall

metro-react-native-babel-preset

Package Overview
Dependencies
Maintainers
2
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metro-react-native-babel-preset - npm Package Compare versions

Comparing version 0.69.1 to 0.70.0

4

package.json
{
"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 @@ {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc