@vue/reactivity-transform
Advanced tools
Comparing version 3.2.26 to 3.2.27
@@ -141,29 +141,3 @@ 'use strict'; | ||
if (stmt.type === 'VariableDeclaration') { | ||
if (stmt.declare) | ||
continue; | ||
for (const decl of stmt.declarations) { | ||
let refCall; | ||
const isCall = decl.init && | ||
decl.init.type === 'CallExpression' && | ||
decl.init.callee.type === 'Identifier'; | ||
if (isCall && | ||
(refCall = isRefCreationCall(decl.init.callee.name))) { | ||
processRefDeclaration(refCall, decl.id, decl.init); | ||
} | ||
else { | ||
const isProps = isRoot && | ||
isCall && | ||
decl.init.callee.name === 'defineProps'; | ||
for (const id of compilerCore.extractIdentifiers(decl.id)) { | ||
if (isProps) { | ||
// for defineProps destructure, only exclude them since they | ||
// are already passed in as knownProps | ||
excludedIds.add(id); | ||
} | ||
else { | ||
registerBinding(id); | ||
} | ||
} | ||
} | ||
} | ||
walkVariableDeclaration(stmt, isRoot); | ||
} | ||
@@ -176,4 +150,36 @@ else if (stmt.type === 'FunctionDeclaration' || | ||
} | ||
else if ((stmt.type === 'ForOfStatement' || stmt.type === 'ForInStatement') && | ||
stmt.left.type === 'VariableDeclaration') { | ||
walkVariableDeclaration(stmt.left); | ||
} | ||
} | ||
} | ||
function walkVariableDeclaration(stmt, isRoot = false) { | ||
if (stmt.declare) { | ||
return; | ||
} | ||
for (const decl of stmt.declarations) { | ||
let refCall; | ||
const isCall = decl.init && | ||
decl.init.type === 'CallExpression' && | ||
decl.init.callee.type === 'Identifier'; | ||
if (isCall && | ||
(refCall = isRefCreationCall(decl.init.callee.name))) { | ||
processRefDeclaration(refCall, decl.id, decl.init); | ||
} | ||
else { | ||
const isProps = isRoot && isCall && decl.init.callee.name === 'defineProps'; | ||
for (const id of compilerCore.extractIdentifiers(decl.id)) { | ||
if (isProps) { | ||
// for defineProps destructure, only exclude them since they | ||
// are already passed in as knownProps | ||
excludedIds.add(id); | ||
} | ||
else { | ||
registerBinding(id); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
function processRefDeclaration(method, id, call) { | ||
@@ -506,3 +512,3 @@ excludedIds.add(call.callee); | ||
function warn(msg) { | ||
console.warn(`\x1b[1m\x1b[33m[@vue/ref-transform]\x1b[0m\x1b[33m ${msg}\x1b[0m\n`); | ||
console.warn(`\x1b[1m\x1b[33m[@vue/reactivity-transform]\x1b[0m\x1b[33m ${msg}\x1b[0m\n`); | ||
} | ||
@@ -509,0 +515,0 @@ |
{ | ||
"name": "@vue/reactivity-transform", | ||
"version": "3.2.26", | ||
"version": "3.2.27", | ||
"description": "@vue/reactivity-transform", | ||
@@ -32,4 +32,4 @@ "main": "dist/reactivity-transform.cjs.js", | ||
"@babel/parser": "^7.16.4", | ||
"@vue/compiler-core": "3.2.26", | ||
"@vue/shared": "3.2.26", | ||
"@vue/compiler-core": "3.2.27", | ||
"@vue/shared": "3.2.27", | ||
"estree-walker": "^2.0.2", | ||
@@ -36,0 +36,0 @@ "magic-string": "^0.25.7" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25990
536
+ Added@vue/compiler-core@3.2.27(transitive)
+ Added@vue/shared@3.2.27(transitive)
- Removed@vue/compiler-core@3.2.26(transitive)
- Removed@vue/shared@3.2.26(transitive)
Updated@vue/compiler-core@3.2.27
Updated@vue/shared@3.2.27