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

babel-plugin-transform-vue-jsx

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-vue-jsx - npm Package Compare versions

Comparing version 3.5.1 to 3.6.0

26

index.js
var esutils = require('esutils')
var groupProps = require('./lib/group-props')
var mustUseProp = require('./lib/must-use-prop')
var addDefault = require('@babel/helper-module-imports').addDefault
var isInsideJsxExpression = function (t, path) {
if (!path.parentPath) {
return false
}
if (t.isJSXExpressionContainer(path.parentPath)) {
return true
}
return isInsideJsxExpression(t, path.parentPath)
}
module.exports = function (babel) {

@@ -51,2 +62,6 @@ var t = babel.types

}
// do nothing if this method is a part of JSX expression
if (isInsideJsxExpression(t, path)) {
return
}
const isRender = path.node.key.name === 'render'

@@ -117,8 +132,5 @@ // inject h otherwise

if (attribs.length) {
attribs = buildOpeningElementAttributes(attribs, file)
} else {
attribs = t.nullLiteral()
attribs = buildOpeningElementAttributes(attribs, path)
args.push(attribs)
}
args.push(attribs)
return t.callExpression(t.identifier('h'), args)

@@ -152,3 +164,3 @@ }

function buildOpeningElementAttributes (attribs, file) {
function buildOpeningElementAttributes (attribs, path) {
var _props = []

@@ -185,3 +197,3 @@ var objs = []

// add prop merging helper
var helper = file.addImport('babel-helper-vue-jsx-merge-props', 'default', '_mergeJSXProps')
var helper = addDefault(path, 'babel-helper-vue-jsx-merge-props', { nameHint: '_mergeJSXProps' })
// spread it

@@ -188,0 +200,0 @@ attribs = t.callExpression(

var makeMap = require('./make-map')
var isTopLevel = makeMap('class,staticClass,style,key,ref,refInFor,slot,scopedSlots')
var isNestable = makeMap('domProps,on,nativeOn,hook')
var nestableRE = /^(domProps|on|nativeOn|hook)([\-_A-Z])/
var nestableRE = /^(props|domProps|on|nativeOn|hook)([\-_A-Z])/
var dirRE = /^v-/

@@ -6,0 +5,0 @@ var xlinkRE = /^xlink([A-Z])/

{
"name": "babel-plugin-transform-vue-jsx",
"version": "3.5.1",
"version": "3.6.0",
"description": "Babel plugin for Vue 2.0 JSX",

@@ -14,6 +14,6 @@ "main": "index.js",

"lint": "eslint index.js",
"test": "npm run lint && mocha --compilers js:babel-register",
"test": "npm run lint && mocha --require @babel/register",
"dev": "cd example && webpack --watch",
"build": "webpack -p index.js dist/babel-plugin-transform-vue-jsx.min.js --target=web --output-library=babel-plugin-transform-vue-jsx --output-library-target=umd --module-bind 'js=babel-loader'",
"prepublish": "npm run build"
"build": "webpack -d",
"prepublishOnly": "npm run build"
},

@@ -42,9 +42,9 @@ "repository": {

"devDependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"@babel/core": "^7.0.0-beta.40",
"@babel/helper-module-imports": "^7.0.0-beta.40",
"@babel/preset-env": "^7.0.0-beta.40",
"@babel/register": "^7.0.0-beta.40",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-loader": "^7.1.2",
"babel-loader": "8.0.0-beta.0",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-preset-es2015": "^6.24.1",
"babel-register": "^6.26.0",
"chai": "^4.1.2",

@@ -55,4 +55,4 @@ "eslint": "^4.16.0",

"vue": "^2.5.13",
"webpack": "^3.10.0"
"webpack": "^3.11.0"
}
}

Sorry, the diff of this file is too big to display

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