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.4.1 to 3.4.2

dist/babel-plugin-transform-vue-jsx.min.js

6

index.js

@@ -28,3 +28,3 @@ var esutils = require('esutils')

},
'ObjectExpression|ClassDeclaration' (path) {
'Program' (path) {
path.traverse({

@@ -151,6 +151,6 @@ 'ObjectMethod|ClassMethod' (path) {

// add prop merging helper
file.addImport('babel-helper-vue-jsx-merge-props', 'default', '_mergeJSXProps')
var helper = file.addImport('babel-helper-vue-jsx-merge-props', 'default', '_mergeJSXProps')
// spread it
attribs = t.callExpression(
t.identifier('_mergeJSXProps'),
helper,
[t.arrayExpression(objs)]

@@ -157,0 +157,0 @@ )

{
"name": "babel-plugin-transform-vue-jsx",
"version": "3.4.1",
"version": "3.4.2",
"description": "Babel plugin for Vue 2.0 JSX",
"main": "index.js",
"unpkg": "dist/babel-plugin-transform-vue-jsx.min.js",
"files": [
"index.js",
"lib"
"lib",
"dist"
],

@@ -13,3 +15,5 @@ "scripts": {

"test": "npm run lint && mocha --compilers js:babel-register",
"dev": "cd example && webpack --watch"
"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'",
"prepubish": "npm run build"
},

@@ -16,0 +20,0 @@ "repository": {

@@ -58,5 +58,6 @@ # babel-plugin-transform-vue-jsx [![CircleCI](https://img.shields.io/circleci/project/vuejs/babel-plugin-transform-vue-jsx.svg?maxAge=2592000)](https://circleci.com/gh/vuejs/babel-plugin-transform-vue-jsx)

Starting with version 3.4.0 we automatically inject `const h = this.$createElement` in any method and getter declared in ES2015 syntax that has JSX so you can drop the `(h)` parameter.
Starting with version 3.4.0 we automatically inject `const h = this.$createElement` in any method and getter (not functions or arrow functions) declared in ES2015 syntax that has JSX so you can drop the `(h)` parameter.
``` js
Vue.component('jsx-example', {

@@ -68,8 +69,16 @@ render () { // h will be injected

return <div id="foo">bar</div>
},
someOtherMethod: () => { // h will not be injected
return <div id="foo">bar</div>
}
})
@Component
class App extends Vue {
get computed () { // h will be injected
return <div id="foo">bar</div>
}
}
```
**Important** `h` does not inject into functions or arrow functions, it works only in ES2015 Method Properties declaration.
### Difference from React JSX

@@ -76,0 +85,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