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

@vue/babel-plugin-jsx

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vue/babel-plugin-jsx - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

3

dist/index.d.ts

@@ -27,3 +27,4 @@ import * as t from '@babel/types';

Program: {
enter(path: NodePath, state: State): void;
enter(path: NodePath<t.Program>, state: State): void;
exit(path: NodePath<t.Program>): void;
};

@@ -30,0 +31,0 @@ JSXFragment: {

@@ -121,3 +121,26 @@ "use strict";

},
exit(path) {
const body = path.get('body');
const specifiersMap = new Map();
body.filter((nodePath) => t.isImportDeclaration(nodePath.node)
&& nodePath.node.source.value === 'vue')
.forEach((nodePath) => {
const { specifiers } = nodePath.node;
let shouldRemove = false;
specifiers.forEach((specifier) => {
if (!specifier.loc && t.isImportSpecifier(specifier) && t.isIdentifier(specifier.imported)) {
specifiersMap.set(specifier.imported.name, specifier);
shouldRemove = true;
}
});
if (shouldRemove) {
nodePath.remove();
}
});
const specifiers = [...specifiersMap.keys()].map((imported) => specifiersMap.get(imported));
if (specifiers.length) {
path.unshiftContainer('body', t.importDeclaration(specifiers, t.stringLiteral('vue')));
}
},
} }),
});
{
"name": "@vue/babel-plugin-jsx",
"version": "1.0.1",
"version": "1.0.2",
"description": "Babel plugin for Vue 3.0 JSX",

@@ -31,3 +31,3 @@ "author": "Amour1688 <lcz_1996@foxmail.com>",

"@babel/types": "^7.0.0",
"@vue/babel-helper-vue-transform-on": "^1.0.0",
"@vue/babel-helper-vue-transform-on": "^1.0.2",
"camelcase": "^6.0.0",

@@ -34,0 +34,0 @@ "html-tags": "^3.1.0",

@@ -67,3 +67,3 @@ # Babel Plugin JSX for Vue 3.0

Whether to enable `object slots` (mentioned below the document) syntax". It might be useful in JSX, but it will add a lot of `_isSlot` condition expressions which increases your bundle size. And `v-slots` is still available even if `enableObjectSlots` is turned off.
Whether to enable `object slots` (mentioned below the document) syntax". It might be useful in JSX, but it will add a lot of `_isSlot` condition expressions which increase your bundle size. And `v-slots` is still available even if `enableObjectSlots` is turned off.

@@ -70,0 +70,0 @@ ## Syntax

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