Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@babel/plugin-transform-react-constant-elements

Package Overview
Dependencies
Maintainers
4
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-transform-react-constant-elements - npm Package Compare versions

Comparing version 8.0.0-alpha.12 to 8.0.0-alpha.13

2

lib/index.d.ts

@@ -6,4 +6,4 @@ import * as _babel_core from '@babel/core';

}
declare const _default: (api: _babel_core.PluginAPI, options: Options, dirname: string) => _babel_core.PluginObject<object & _babel_core.PluginPass>;
declare const _default: (api: _babel_core.PluginAPI, options: Options, dirname: string) => _babel_core.PluginObject<object & _babel_core.PluginPass<object>>;
export { type Options, _default as default };

@@ -5,3 +5,3 @@ import { declare } from '@babel/helper-plugin-utils';

var index = declare((api, options) => {
api.assertVersion("8.0.0-alpha.12");
api.assertVersion("8.0.0-alpha.13");
const {

@@ -119,13 +119,18 @@ allowMutablePropsOnTags

visitor: {
JSXElement(path) {
"JSXElement|JSXFragment"(path) {
if (HOISTED.has(path.node)) return;
const name = path.node.openingElement.name;
let mutablePropsAllowed = false;
if (allowMutablePropsOnTags != null) {
let lastSegment = name;
while (types.isJSXMemberExpression(lastSegment)) {
lastSegment = lastSegment.property;
let name;
if (path.isJSXElement()) {
name = path.node.openingElement.name;
if (allowMutablePropsOnTags != null) {
let lastSegment = name;
while (types.isJSXMemberExpression(lastSegment)) {
lastSegment = lastSegment.property;
}
const elementName = lastSegment.name;
mutablePropsAllowed = allowMutablePropsOnTags.includes(elementName);
}
const elementName = lastSegment.name;
mutablePropsAllowed = allowMutablePropsOnTags.includes(elementName);
} else {
name = path.node;
}

@@ -167,3 +172,3 @@ let jsxScope;

`;
if (path.parentPath.isJSXElement() || path.parentPath.isJSXAttribute()) {
if (path.parentPath.isJSXElement() || path.parentPath.isJSXAttribute() || path.parentPath.isJSXFragment()) {
replacement = types.jsxExpressionContainer(replacement);

@@ -170,0 +175,0 @@ }

{
"name": "@babel/plugin-transform-react-constant-elements",
"version": "8.0.0-alpha.12",
"version": "8.0.0-alpha.13",
"description": "Treat React JSX elements as value types and hoist them to the highest scope",

@@ -20,13 +20,13 @@ "repository": {

"dependencies": {
"@babel/helper-plugin-utils": "^8.0.0-alpha.12"
"@babel/helper-plugin-utils": "^8.0.0-alpha.13"
},
"peerDependencies": {
"@babel/core": "^8.0.0-alpha.12"
"@babel/core": "^8.0.0-alpha.13"
},
"devDependencies": {
"@babel/core": "^8.0.0-alpha.12",
"@babel/helper-plugin-test-runner": "^8.0.0-alpha.12"
"@babel/core": "^8.0.0-alpha.13",
"@babel/helper-plugin-test-runner": "^8.0.0-alpha.13"
},
"engines": {
"node": "^18.20.0 || ^20.10.0 || >=21.0.0"
"node": "^18.20.0 || ^20.17.0 || >=22.8.0"
},

@@ -33,0 +33,0 @@ "author": "The Babel Team (https://babel.dev/team)",

Sorry, the diff of this file is not supported yet

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