@vue/compiler-sfc 3.4.0-beta.2 → 3.4.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20258,6 +20258,7 @@ let __temp${any}, __restore${any}
20258
20258
  }
20259
20259
  const { code, ast, preamble, tips, errors } = compileTemplate({
20260
20260
  filename,
20261
+ ast: sfc.template.ast,
20261
20262
  source: sfc.template.content,
20262
20263
  inMap: sfc.template.map,
20263
20264
  ...options.templateOptions,
@@ -20559,7 +20560,7 @@ function isStaticNode(node) {
20559
20560
  return false;
20560
20561
  }
20561
20562
 
20562
- const version = "3.4.0-beta.2";
20563
+ const version = "3.4.0-beta.4";
20563
20564
  const parseCache = parseCache$1;
20564
20565
  const walk = estreeWalker.walk;
20565
20566
  const shouldTransformRef = () => false;
@@ -189,7 +189,7 @@ function normalizeClass(value) {
189
189
 
190
190
  const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot";
191
191
  const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view";
192
- const MATH_TAGS = "math,maction,annotation,annotation-xml,menclose,merror,mfenced,mfrac,mi,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,semantics,mspace,msqrt,mstyle,msub,msup,msubsup,mtable,mtd,mtext,mtr,munder,munderover";
192
+ const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics";
193
193
  const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
194
194
  const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
195
195
  const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
@@ -2316,7 +2316,7 @@ const errorMessages = {
2316
2316
  Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
2317
2317
  [45]: `Error parsing JavaScript expression: `,
2318
2318
  [46]: `<KeepAlive> expects exactly one child component.`,
2319
- [51]: `@vnode-* hooks in templates are deprecated. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support will be removed in 3.4.`,
2319
+ [51]: `@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.`,
2320
2320
  // generic errors
2321
2321
  [47]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
2322
2322
  [48]: `ES module mode is not supported in this build of compiler.`,
@@ -17032,12 +17032,23 @@ function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [
17032
17032
  } else if (node.type === "ObjectProperty" && parent.type === "ObjectPattern") {
17033
17033
  node.inPattern = true;
17034
17034
  } else if (isFunctionType(node)) {
17035
- walkFunctionParams(node, (id) => markScopeIdentifier(node, id, knownIds));
17035
+ if (node.scopeIds) {
17036
+ node.scopeIds.forEach((id) => markKnownIds(id, knownIds));
17037
+ } else {
17038
+ walkFunctionParams(
17039
+ node,
17040
+ (id) => markScopeIdentifier(node, id, knownIds)
17041
+ );
17042
+ }
17036
17043
  } else if (node.type === "BlockStatement") {
17037
- walkBlockDeclarations(
17038
- node,
17039
- (id) => markScopeIdentifier(node, id, knownIds)
17040
- );
17044
+ if (node.scopeIds) {
17045
+ node.scopeIds.forEach((id) => markKnownIds(id, knownIds));
17046
+ } else {
17047
+ walkBlockDeclarations(
17048
+ node,
17049
+ (id) => markScopeIdentifier(node, id, knownIds)
17050
+ );
17051
+ }
17041
17052
  }
17042
17053
  },
17043
17054
  leave(node, parent) {
@@ -17156,16 +17167,19 @@ function extractIdentifiers$1(param, nodes = []) {
17156
17167
  }
17157
17168
  return nodes;
17158
17169
  }
17159
- function markScopeIdentifier(node, child, knownIds) {
17160
- const { name } = child;
17161
- if (node.scopeIds && node.scopeIds.has(name)) {
17162
- return;
17163
- }
17170
+ function markKnownIds(name, knownIds) {
17164
17171
  if (name in knownIds) {
17165
17172
  knownIds[name]++;
17166
17173
  } else {
17167
17174
  knownIds[name] = 1;
17168
17175
  }
17176
+ }
17177
+ function markScopeIdentifier(node, child, knownIds) {
17178
+ const { name } = child;
17179
+ if (node.scopeIds && node.scopeIds.has(name)) {
17180
+ return;
17181
+ }
17182
+ markKnownIds(name, knownIds);
17169
17183
  (node.scopeIds || (node.scopeIds = /* @__PURE__ */ new Set())).add(name);
17170
17184
  }
17171
17185
  const isFunctionType = (node) => {
@@ -17370,7 +17384,7 @@ const isMemberExpressionNode = (path, context) => {
17370
17384
  plugins: context.expressionPlugins
17371
17385
  });
17372
17386
  ret = unwrapTSNode(ret);
17373
- return ret.type === "MemberExpression" || ret.type === "OptionalMemberExpression" || ret.type === "Identifier";
17387
+ return ret.type === "MemberExpression" || ret.type === "OptionalMemberExpression" || ret.type === "Identifier" && ret.name !== "undefined";
17374
17388
  } catch (e) {
17375
17389
  return false;
17376
17390
  }
@@ -48245,6 +48259,7 @@ let __temp${any}, __restore${any}
48245
48259
  }
48246
48260
  const { code, ast, preamble, tips, errors } = compileTemplate(__spreadProps(__spreadValues({
48247
48261
  filename,
48262
+ ast: sfc.template.ast,
48248
48263
  source: sfc.template.content,
48249
48264
  inMap: sfc.template.map
48250
48265
  }, options.templateOptions), {
@@ -48544,7 +48559,7 @@ function isStaticNode(node) {
48544
48559
  return false;
48545
48560
  }
48546
48561
 
48547
- const version = "3.4.0-beta.2";
48562
+ const version = "3.4.0-beta.4";
48548
48563
  const parseCache = parseCache$1;
48549
48564
  const walk = walk$2;
48550
48565
  const shouldTransformRef = () => false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/compiler-sfc",
3
- "version": "3.4.0-beta.2",
3
+ "version": "3.4.0-beta.4",
4
4
  "description": "@vue/compiler-sfc",
5
5
  "main": "dist/compiler-sfc.cjs.js",
6
6
  "module": "dist/compiler-sfc.esm-browser.js",
@@ -37,10 +37,10 @@
37
37
  "magic-string": "^0.30.5",
38
38
  "postcss": "^8.4.32",
39
39
  "source-map-js": "^1.0.2",
40
- "@vue/compiler-core": "3.4.0-beta.2",
41
- "@vue/compiler-ssr": "3.4.0-beta.2",
42
- "@vue/shared": "3.4.0-beta.2",
43
- "@vue/compiler-dom": "3.4.0-beta.2"
40
+ "@vue/compiler-core": "3.4.0-beta.4",
41
+ "@vue/compiler-ssr": "3.4.0-beta.4",
42
+ "@vue/compiler-dom": "3.4.0-beta.4",
43
+ "@vue/shared": "3.4.0-beta.4"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@babel/types": "^7.23.5",