@vue/compiler-core 3.3.0-alpha.4 → 3.3.0-alpha.6

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.
@@ -342,6 +342,20 @@ function createReturnStatement(returns) {
342
342
  loc: locStub
343
343
  };
344
344
  }
345
+ function getVNodeHelper(ssr, isComponent) {
346
+ return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE;
347
+ }
348
+ function getVNodeBlockHelper(ssr, isComponent) {
349
+ return ssr || isComponent ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK;
350
+ }
351
+ function convertToBlock(node, { helper, removeHelper, inSSR }) {
352
+ if (!node.isBlock) {
353
+ node.isBlock = true;
354
+ removeHelper(getVNodeHelper(inSSR, node.isComponent));
355
+ helper(OPEN_BLOCK);
356
+ helper(getVNodeBlockHelper(inSSR, node.isComponent));
357
+ }
358
+ }
345
359
 
346
360
  const isStaticExp = (p) => p.type === 4 && p.isStatic;
347
361
  const isBuiltInType = (tag, expected) => tag === expected || tag === shared.hyphenate(expected);
@@ -524,12 +538,6 @@ function isTemplateNode(node) {
524
538
  function isSlotOutlet(node) {
525
539
  return node.type === 1 && node.tagType === 2;
526
540
  }
527
- function getVNodeHelper(ssr, isComponent) {
528
- return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE;
529
- }
530
- function getVNodeBlockHelper(ssr, isComponent) {
531
- return ssr || isComponent ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK;
532
- }
533
541
  const propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);
534
542
  function getUnnormalizedProps(props, callPath = []) {
535
543
  if (props && !shared.isString(props) && props.type === 14) {
@@ -662,14 +670,6 @@ function getMemoedVNodeCall(node) {
662
670
  return node;
663
671
  }
664
672
  }
665
- function makeBlock(node, { helper, removeHelper, inSSR }) {
666
- if (!node.isBlock) {
667
- node.isBlock = true;
668
- removeHelper(getVNodeHelper(inSSR, node.isComponent));
669
- helper(OPEN_BLOCK);
670
- helper(getVNodeBlockHelper(inSSR, node.isComponent));
671
- }
672
- }
673
673
 
674
674
  const deprecationData = {
675
675
  ["COMPILER_IS_ON_ELEMENT"]: {
@@ -1959,7 +1959,7 @@ function createRootCodegen(root, context) {
1959
1959
  if (isSingleElementRoot(root, child) && child.codegenNode) {
1960
1960
  const codegenNode = child.codegenNode;
1961
1961
  if (codegenNode.type === 13) {
1962
- makeBlock(codegenNode, context);
1962
+ convertToBlock(codegenNode, context);
1963
1963
  }
1964
1964
  root.codegenNode = codegenNode;
1965
1965
  } else {
@@ -2827,7 +2827,7 @@ function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [
2827
2827
  estreeWalker.walk(root, {
2828
2828
  enter(node, parent) {
2829
2829
  parent && parentStack.push(parent);
2830
- if (parent && parent.type.startsWith("TS") && parent.type !== "TSAsExpression" && parent.type !== "TSNonNullExpression" && parent.type !== "TSTypeAssertion") {
2830
+ if (parent && parent.type.startsWith("TS") && !TS_NODE_TYPES.includes(parent.type)) {
2831
2831
  return this.skip();
2832
2832
  }
2833
2833
  if (node.type === "Identifier") {
@@ -2971,6 +2971,13 @@ const isFunctionType = (node) => {
2971
2971
  };
2972
2972
  const isStaticProperty = (node) => node && (node.type === "ObjectProperty" || node.type === "ObjectMethod") && !node.computed;
2973
2973
  const isStaticPropertyKey = (node, parent) => isStaticProperty(parent) && parent.key === node;
2974
+ function getImportedName(specifier) {
2975
+ if (specifier.type === "ImportSpecifier")
2976
+ return specifier.imported.type === "Identifier" ? specifier.imported.name : specifier.imported.value;
2977
+ else if (specifier.type === "ImportNamespaceSpecifier")
2978
+ return "*";
2979
+ return "default";
2980
+ }
2974
2981
  function isReferenced(node, parent, grandparent) {
2975
2982
  switch (parent.type) {
2976
2983
  case "MemberExpression":
@@ -3058,6 +3065,28 @@ function isReferenced(node, parent, grandparent) {
3058
3065
  }
3059
3066
  return true;
3060
3067
  }
3068
+ const TS_NODE_TYPES = [
3069
+ "TSAsExpression",
3070
+ // foo as number
3071
+ "TSTypeAssertion",
3072
+ // (<number>foo)
3073
+ "TSNonNullExpression",
3074
+ // foo!
3075
+ "TSInstantiationExpression",
3076
+ // foo<string>
3077
+ "TSSatisfiesExpression"
3078
+ // foo satisfies T
3079
+ ];
3080
+ function unwrapTSNode(node) {
3081
+ if (TS_NODE_TYPES.includes(node.type)) {
3082
+ return unwrapTSNode(node.expression);
3083
+ } else {
3084
+ return node;
3085
+ }
3086
+ }
3087
+ function isCallOf(node, test) {
3088
+ return !!(node && test && node.type === "CallExpression" && node.callee.type === "Identifier" && (typeof test === "string" ? node.callee.name === test : test(node.callee.name)));
3089
+ }
3061
3090
 
3062
3091
  const isLiteralWhitelisted = /* @__PURE__ */ shared.makeMap("true,false,null,this");
3063
3092
  const transformExpression = (node, context) => {
@@ -3098,7 +3127,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
3098
3127
  const isAssignmentLVal = parent && parent.type === "AssignmentExpression" && parent.left === id;
3099
3128
  const isUpdateArg = parent && parent.type === "UpdateExpression" && parent.argument === id;
3100
3129
  const isDestructureAssignment = parent && isInDestructureAssignment(parent, parentStack);
3101
- if (type === "setup-const" || type === "setup-reactive-const" || localVars[raw]) {
3130
+ if (isConst(type) || type === "setup-reactive-const" || localVars[raw]) {
3102
3131
  return raw;
3103
3132
  } else if (type === "setup-ref") {
3104
3133
  return `${raw}.value`;
@@ -3142,6 +3171,8 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
3142
3171
  return `$setup.${raw}`;
3143
3172
  } else if (type === "props-aliased") {
3144
3173
  return `$props['${bindingMetadata.__propsAliases[raw]}']`;
3174
+ } else if (type === "literal-const") {
3175
+ return raw;
3145
3176
  } else if (type) {
3146
3177
  return `$${type}.${raw}`;
3147
3178
  }
@@ -3155,7 +3186,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
3155
3186
  const isAllowedGlobal = shared.isGloballyWhitelisted(rawExp);
3156
3187
  const isLiteral = isLiteralWhitelisted(rawExp);
3157
3188
  if (!asParams && !isScopeVarReference && !isAllowedGlobal && !isLiteral) {
3158
- if (bindingMetadata[node.content] === "setup-const") {
3189
+ if (isConst(bindingMetadata[node.content])) {
3159
3190
  node.constType = 1;
3160
3191
  }
3161
3192
  node.content = rewriteIdentifier(rawExp);
@@ -3271,6 +3302,9 @@ function stringifyExpression(exp) {
3271
3302
  return exp.children.map(stringifyExpression).join("");
3272
3303
  }
3273
3304
  }
3305
+ function isConst(type) {
3306
+ return type === "setup-const" || type === "literal-const";
3307
+ }
3274
3308
 
3275
3309
  const transformIf = createStructuralDirectiveTransform(
3276
3310
  /^(if|else|else-if)$/,
@@ -3454,7 +3488,7 @@ function createChildrenCodegenNode(branch, keyIndex, context) {
3454
3488
  const ret = firstChild.codegenNode;
3455
3489
  const vnodeCall = getMemoedVNodeCall(ret);
3456
3490
  if (vnodeCall.type === 13) {
3457
- makeBlock(vnodeCall, context);
3491
+ convertToBlock(vnodeCall, context);
3458
3492
  }
3459
3493
  injectProp(vnodeCall, keyProperty, context);
3460
3494
  return ret;
@@ -4239,7 +4273,7 @@ function resolveSetupReference(name, context) {
4239
4273
  return PascalName;
4240
4274
  }
4241
4275
  };
4242
- const fromConst = checkType("setup-const") || checkType("setup-reactive-const");
4276
+ const fromConst = checkType("setup-const") || checkType("setup-reactive-const") || checkType("literal-const");
4243
4277
  if (fromConst) {
4244
4278
  return context.inline ? (
4245
4279
  // in inline mode, const setup bindings (e.g. imports) can be used as-is
@@ -5241,7 +5275,7 @@ const transformMemo = (node, context) => {
5241
5275
  const codegenNode = node.codegenNode || context.currentNode.codegenNode;
5242
5276
  if (codegenNode && codegenNode.type === 13) {
5243
5277
  if (node.tagType !== 1) {
5244
- makeBlock(codegenNode, context);
5278
+ convertToBlock(codegenNode, context);
5245
5279
  }
5246
5280
  node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [
5247
5281
  dir.exp,
@@ -5360,6 +5394,7 @@ exports.TELEPORT = TELEPORT;
5360
5394
  exports.TO_DISPLAY_STRING = TO_DISPLAY_STRING;
5361
5395
  exports.TO_HANDLERS = TO_HANDLERS;
5362
5396
  exports.TO_HANDLER_KEY = TO_HANDLER_KEY;
5397
+ exports.TS_NODE_TYPES = TS_NODE_TYPES;
5363
5398
  exports.UNREF = UNREF;
5364
5399
  exports.WITH_CTX = WITH_CTX;
5365
5400
  exports.WITH_DIRECTIVES = WITH_DIRECTIVES;
@@ -5373,6 +5408,7 @@ exports.buildDirectiveArgs = buildDirectiveArgs;
5373
5408
  exports.buildProps = buildProps;
5374
5409
  exports.buildSlots = buildSlots;
5375
5410
  exports.checkCompatEnabled = checkCompatEnabled;
5411
+ exports.convertToBlock = convertToBlock;
5376
5412
  exports.createArrayExpression = createArrayExpression;
5377
5413
  exports.createAssignmentExpression = createAssignmentExpression;
5378
5414
  exports.createBlockStatement = createBlockStatement;
@@ -5401,6 +5437,7 @@ exports.findProp = findProp;
5401
5437
  exports.generate = generate;
5402
5438
  exports.getBaseTransformPreset = getBaseTransformPreset;
5403
5439
  exports.getConstantType = getConstantType;
5440
+ exports.getImportedName = getImportedName;
5404
5441
  exports.getInnerRange = getInnerRange;
5405
5442
  exports.getMemoedVNodeCall = getMemoedVNodeCall;
5406
5443
  exports.getVNodeBlockHelper = getVNodeBlockHelper;
@@ -5410,6 +5447,7 @@ exports.hasScopeRef = hasScopeRef;
5410
5447
  exports.helperNameMap = helperNameMap;
5411
5448
  exports.injectProp = injectProp;
5412
5449
  exports.isBuiltInType = isBuiltInType;
5450
+ exports.isCallOf = isCallOf;
5413
5451
  exports.isCoreComponent = isCoreComponent;
5414
5452
  exports.isFunctionType = isFunctionType;
5415
5453
  exports.isInDestructureAssignment = isInDestructureAssignment;
@@ -5427,7 +5465,6 @@ exports.isTemplateNode = isTemplateNode;
5427
5465
  exports.isText = isText$1;
5428
5466
  exports.isVSlot = isVSlot;
5429
5467
  exports.locStub = locStub;
5430
- exports.makeBlock = makeBlock;
5431
5468
  exports.noopDirectiveTransform = noopDirectiveTransform;
5432
5469
  exports.processExpression = processExpression;
5433
5470
  exports.processFor = processFor;
@@ -5446,6 +5483,7 @@ exports.transformExpression = transformExpression;
5446
5483
  exports.transformModel = transformModel;
5447
5484
  exports.transformOn = transformOn;
5448
5485
  exports.traverseNode = traverseNode;
5486
+ exports.unwrapTSNode = unwrapTSNode;
5449
5487
  exports.walkBlockDeclarations = walkBlockDeclarations;
5450
5488
  exports.walkFunctionParams = walkFunctionParams;
5451
5489
  exports.walkIdentifiers = walkIdentifiers;
@@ -341,6 +341,20 @@ function createReturnStatement(returns) {
341
341
  loc: locStub
342
342
  };
343
343
  }
344
+ function getVNodeHelper(ssr, isComponent) {
345
+ return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE;
346
+ }
347
+ function getVNodeBlockHelper(ssr, isComponent) {
348
+ return ssr || isComponent ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK;
349
+ }
350
+ function convertToBlock(node, { helper, removeHelper, inSSR }) {
351
+ if (!node.isBlock) {
352
+ node.isBlock = true;
353
+ removeHelper(getVNodeHelper(inSSR, node.isComponent));
354
+ helper(OPEN_BLOCK);
355
+ helper(getVNodeBlockHelper(inSSR, node.isComponent));
356
+ }
357
+ }
344
358
 
345
359
  const isStaticExp = (p) => p.type === 4 && p.isStatic;
346
360
  const isBuiltInType = (tag, expected) => tag === expected || tag === shared.hyphenate(expected);
@@ -523,12 +537,6 @@ function isTemplateNode(node) {
523
537
  function isSlotOutlet(node) {
524
538
  return node.type === 1 && node.tagType === 2;
525
539
  }
526
- function getVNodeHelper(ssr, isComponent) {
527
- return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE;
528
- }
529
- function getVNodeBlockHelper(ssr, isComponent) {
530
- return ssr || isComponent ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK;
531
- }
532
540
  const propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);
533
541
  function getUnnormalizedProps(props, callPath = []) {
534
542
  if (props && !shared.isString(props) && props.type === 14) {
@@ -661,14 +669,6 @@ function getMemoedVNodeCall(node) {
661
669
  return node;
662
670
  }
663
671
  }
664
- function makeBlock(node, { helper, removeHelper, inSSR }) {
665
- if (!node.isBlock) {
666
- node.isBlock = true;
667
- removeHelper(getVNodeHelper(inSSR, node.isComponent));
668
- helper(OPEN_BLOCK);
669
- helper(getVNodeBlockHelper(inSSR, node.isComponent));
670
- }
671
- }
672
672
 
673
673
  const deprecationData = {
674
674
  ["COMPILER_IS_ON_ELEMENT"]: {
@@ -1904,7 +1904,7 @@ function createRootCodegen(root, context) {
1904
1904
  if (isSingleElementRoot(root, child) && child.codegenNode) {
1905
1905
  const codegenNode = child.codegenNode;
1906
1906
  if (codegenNode.type === 13) {
1907
- makeBlock(codegenNode, context);
1907
+ convertToBlock(codegenNode, context);
1908
1908
  }
1909
1909
  root.codegenNode = codegenNode;
1910
1910
  } else {
@@ -2756,7 +2756,7 @@ function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [
2756
2756
  estreeWalker.walk(root, {
2757
2757
  enter(node, parent) {
2758
2758
  parent && parentStack.push(parent);
2759
- if (parent && parent.type.startsWith("TS") && parent.type !== "TSAsExpression" && parent.type !== "TSNonNullExpression" && parent.type !== "TSTypeAssertion") {
2759
+ if (parent && parent.type.startsWith("TS") && !TS_NODE_TYPES.includes(parent.type)) {
2760
2760
  return this.skip();
2761
2761
  }
2762
2762
  if (node.type === "Identifier") {
@@ -2900,6 +2900,13 @@ const isFunctionType = (node) => {
2900
2900
  };
2901
2901
  const isStaticProperty = (node) => node && (node.type === "ObjectProperty" || node.type === "ObjectMethod") && !node.computed;
2902
2902
  const isStaticPropertyKey = (node, parent) => isStaticProperty(parent) && parent.key === node;
2903
+ function getImportedName(specifier) {
2904
+ if (specifier.type === "ImportSpecifier")
2905
+ return specifier.imported.type === "Identifier" ? specifier.imported.name : specifier.imported.value;
2906
+ else if (specifier.type === "ImportNamespaceSpecifier")
2907
+ return "*";
2908
+ return "default";
2909
+ }
2903
2910
  function isReferenced(node, parent, grandparent) {
2904
2911
  switch (parent.type) {
2905
2912
  case "MemberExpression":
@@ -2987,6 +2994,28 @@ function isReferenced(node, parent, grandparent) {
2987
2994
  }
2988
2995
  return true;
2989
2996
  }
2997
+ const TS_NODE_TYPES = [
2998
+ "TSAsExpression",
2999
+ // foo as number
3000
+ "TSTypeAssertion",
3001
+ // (<number>foo)
3002
+ "TSNonNullExpression",
3003
+ // foo!
3004
+ "TSInstantiationExpression",
3005
+ // foo<string>
3006
+ "TSSatisfiesExpression"
3007
+ // foo satisfies T
3008
+ ];
3009
+ function unwrapTSNode(node) {
3010
+ if (TS_NODE_TYPES.includes(node.type)) {
3011
+ return unwrapTSNode(node.expression);
3012
+ } else {
3013
+ return node;
3014
+ }
3015
+ }
3016
+ function isCallOf(node, test) {
3017
+ return !!(node && test && node.type === "CallExpression" && node.callee.type === "Identifier" && (typeof test === "string" ? node.callee.name === test : test(node.callee.name)));
3018
+ }
2990
3019
 
2991
3020
  const isLiteralWhitelisted = /* @__PURE__ */ shared.makeMap("true,false,null,this");
2992
3021
  const transformExpression = (node, context) => {
@@ -3027,7 +3056,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
3027
3056
  const isAssignmentLVal = parent && parent.type === "AssignmentExpression" && parent.left === id;
3028
3057
  const isUpdateArg = parent && parent.type === "UpdateExpression" && parent.argument === id;
3029
3058
  const isDestructureAssignment = parent && isInDestructureAssignment(parent, parentStack);
3030
- if (type === "setup-const" || type === "setup-reactive-const" || localVars[raw]) {
3059
+ if (isConst(type) || type === "setup-reactive-const" || localVars[raw]) {
3031
3060
  return raw;
3032
3061
  } else if (type === "setup-ref") {
3033
3062
  return `${raw}.value`;
@@ -3071,6 +3100,8 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
3071
3100
  return `$setup.${raw}`;
3072
3101
  } else if (type === "props-aliased") {
3073
3102
  return `$props['${bindingMetadata.__propsAliases[raw]}']`;
3103
+ } else if (type === "literal-const") {
3104
+ return raw;
3074
3105
  } else if (type) {
3075
3106
  return `$${type}.${raw}`;
3076
3107
  }
@@ -3084,7 +3115,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
3084
3115
  const isAllowedGlobal = shared.isGloballyWhitelisted(rawExp);
3085
3116
  const isLiteral = isLiteralWhitelisted(rawExp);
3086
3117
  if (!asParams && !isScopeVarReference && !isAllowedGlobal && !isLiteral) {
3087
- if (bindingMetadata[node.content] === "setup-const") {
3118
+ if (isConst(bindingMetadata[node.content])) {
3088
3119
  node.constType = 1;
3089
3120
  }
3090
3121
  node.content = rewriteIdentifier(rawExp);
@@ -3200,6 +3231,9 @@ function stringifyExpression(exp) {
3200
3231
  return exp.children.map(stringifyExpression).join("");
3201
3232
  }
3202
3233
  }
3234
+ function isConst(type) {
3235
+ return type === "setup-const" || type === "literal-const";
3236
+ }
3203
3237
 
3204
3238
  const transformIf = createStructuralDirectiveTransform(
3205
3239
  /^(if|else|else-if)$/,
@@ -3373,7 +3407,7 @@ function createChildrenCodegenNode(branch, keyIndex, context) {
3373
3407
  const ret = firstChild.codegenNode;
3374
3408
  const vnodeCall = getMemoedVNodeCall(ret);
3375
3409
  if (vnodeCall.type === 13) {
3376
- makeBlock(vnodeCall, context);
3410
+ convertToBlock(vnodeCall, context);
3377
3411
  }
3378
3412
  injectProp(vnodeCall, keyProperty, context);
3379
3413
  return ret;
@@ -4144,7 +4178,7 @@ function resolveSetupReference(name, context) {
4144
4178
  return PascalName;
4145
4179
  }
4146
4180
  };
4147
- const fromConst = checkType("setup-const") || checkType("setup-reactive-const");
4181
+ const fromConst = checkType("setup-const") || checkType("setup-reactive-const") || checkType("literal-const");
4148
4182
  if (fromConst) {
4149
4183
  return context.inline ? (
4150
4184
  // in inline mode, const setup bindings (e.g. imports) can be used as-is
@@ -5120,7 +5154,7 @@ const transformMemo = (node, context) => {
5120
5154
  const codegenNode = node.codegenNode || context.currentNode.codegenNode;
5121
5155
  if (codegenNode && codegenNode.type === 13) {
5122
5156
  if (node.tagType !== 1) {
5123
- makeBlock(codegenNode, context);
5157
+ convertToBlock(codegenNode, context);
5124
5158
  }
5125
5159
  node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [
5126
5160
  dir.exp,
@@ -5239,6 +5273,7 @@ exports.TELEPORT = TELEPORT;
5239
5273
  exports.TO_DISPLAY_STRING = TO_DISPLAY_STRING;
5240
5274
  exports.TO_HANDLERS = TO_HANDLERS;
5241
5275
  exports.TO_HANDLER_KEY = TO_HANDLER_KEY;
5276
+ exports.TS_NODE_TYPES = TS_NODE_TYPES;
5242
5277
  exports.UNREF = UNREF;
5243
5278
  exports.WITH_CTX = WITH_CTX;
5244
5279
  exports.WITH_DIRECTIVES = WITH_DIRECTIVES;
@@ -5252,6 +5287,7 @@ exports.buildDirectiveArgs = buildDirectiveArgs;
5252
5287
  exports.buildProps = buildProps;
5253
5288
  exports.buildSlots = buildSlots;
5254
5289
  exports.checkCompatEnabled = checkCompatEnabled;
5290
+ exports.convertToBlock = convertToBlock;
5255
5291
  exports.createArrayExpression = createArrayExpression;
5256
5292
  exports.createAssignmentExpression = createAssignmentExpression;
5257
5293
  exports.createBlockStatement = createBlockStatement;
@@ -5280,6 +5316,7 @@ exports.findProp = findProp;
5280
5316
  exports.generate = generate;
5281
5317
  exports.getBaseTransformPreset = getBaseTransformPreset;
5282
5318
  exports.getConstantType = getConstantType;
5319
+ exports.getImportedName = getImportedName;
5283
5320
  exports.getInnerRange = getInnerRange;
5284
5321
  exports.getMemoedVNodeCall = getMemoedVNodeCall;
5285
5322
  exports.getVNodeBlockHelper = getVNodeBlockHelper;
@@ -5289,6 +5326,7 @@ exports.hasScopeRef = hasScopeRef;
5289
5326
  exports.helperNameMap = helperNameMap;
5290
5327
  exports.injectProp = injectProp;
5291
5328
  exports.isBuiltInType = isBuiltInType;
5329
+ exports.isCallOf = isCallOf;
5292
5330
  exports.isCoreComponent = isCoreComponent;
5293
5331
  exports.isFunctionType = isFunctionType;
5294
5332
  exports.isInDestructureAssignment = isInDestructureAssignment;
@@ -5306,7 +5344,6 @@ exports.isTemplateNode = isTemplateNode;
5306
5344
  exports.isText = isText$1;
5307
5345
  exports.isVSlot = isVSlot;
5308
5346
  exports.locStub = locStub;
5309
- exports.makeBlock = makeBlock;
5310
5347
  exports.noopDirectiveTransform = noopDirectiveTransform;
5311
5348
  exports.processExpression = processExpression;
5312
5349
  exports.processFor = processFor;
@@ -5325,6 +5362,7 @@ exports.transformExpression = transformExpression;
5325
5362
  exports.transformModel = transformModel;
5326
5363
  exports.transformOn = transformOn;
5327
5364
  exports.traverseNode = traverseNode;
5365
+ exports.unwrapTSNode = unwrapTSNode;
5328
5366
  exports.walkBlockDeclarations = walkBlockDeclarations;
5329
5367
  exports.walkFunctionParams = walkFunctionParams;
5330
5368
  exports.walkIdentifiers = walkIdentifiers;
@@ -1,18 +1,18 @@
1
1
  import { ParserPlugin } from '@babel/parser';
2
2
  import { RawSourceMap, SourceMapGenerator } from 'source-map';
3
- import { Node as Node$1, Identifier, Function, BlockStatement as BlockStatement$1, Program, ObjectProperty } from '@babel/types';
3
+ import { Node as Node$1, Identifier, Function, BlockStatement as BlockStatement$1, Program, ObjectProperty, ImportSpecifier, ImportDefaultSpecifier, ImportNamespaceSpecifier, CallExpression as CallExpression$1 } from '@babel/types';
4
4
  export { generateCodeFrame } from '@vue/shared';
5
5
 
6
- export type OptionalOptions = 'whitespace' | 'isNativeTag' | 'isBuiltInComponent' | keyof CompilerCompatOptions;
7
- export type MergedParserOptions = Omit<Required<ParserOptions>, OptionalOptions> & Pick<ParserOptions, OptionalOptions>;
8
- declare const enum TextModes {
6
+ type OptionalOptions = 'whitespace' | 'isNativeTag' | 'isBuiltInComponent' | keyof CompilerCompatOptions;
7
+ type MergedParserOptions = Omit<Required<ParserOptions>, OptionalOptions> & Pick<ParserOptions, OptionalOptions>;
8
+ export declare const enum TextModes {
9
9
  DATA = 0,
10
10
  RCDATA = 1,
11
11
  RAWTEXT = 2,
12
12
  CDATA = 3,
13
13
  ATTRIBUTE_VALUE = 4
14
14
  }
15
- export interface ParserContext {
15
+ interface ParserContext {
16
16
  options: MergedParserOptions;
17
17
  readonly originalSource: string;
18
18
  source: string;
@@ -23,15 +23,15 @@ export interface ParserContext {
23
23
  inVPre: boolean;
24
24
  onWarn: NonNullable<ErrorHandlingOptions['onWarn']>;
25
25
  }
26
- declare function baseParse(content: string, options?: ParserOptions): RootNode;
26
+ export declare function baseParse(content: string, options?: ParserOptions): RootNode;
27
27
 
28
- export type CompilerCompatConfig = Partial<Record<CompilerDeprecationTypes, boolean | 'suppress-warning'>> & {
28
+ type CompilerCompatConfig = Partial<Record<CompilerDeprecationTypes, boolean | 'suppress-warning'>> & {
29
29
  MODE?: 2 | 3;
30
30
  };
31
- export interface CompilerCompatOptions {
31
+ interface CompilerCompatOptions {
32
32
  compatConfig?: CompilerCompatConfig;
33
33
  }
34
- declare const enum CompilerDeprecationTypes {
34
+ export declare const enum CompilerDeprecationTypes {
35
35
  COMPILER_IS_ON_ELEMENT = "COMPILER_IS_ON_ELEMENT",
36
36
  COMPILER_V_BIND_SYNC = "COMPILER_V_BIND_SYNC",
37
37
  COMPILER_V_BIND_PROP = "COMPILER_V_BIND_PROP",
@@ -42,18 +42,18 @@ declare const enum CompilerDeprecationTypes {
42
42
  COMPILER_INLINE_TEMPLATE = "COMPILER_INLINE_TEMPLATE",
43
43
  COMPILER_FILTERS = "COMPILER_FILTER"
44
44
  }
45
- declare function checkCompatEnabled(key: CompilerDeprecationTypes, context: ParserContext | TransformContext, loc: SourceLocation | null, ...args: any[]): boolean;
46
- declare function warnDeprecation(key: CompilerDeprecationTypes, context: ParserContext | TransformContext, loc: SourceLocation | null, ...args: any[]): void;
45
+ export declare function checkCompatEnabled(key: CompilerDeprecationTypes, context: ParserContext | TransformContext, loc: SourceLocation | null, ...args: any[]): boolean;
46
+ export declare function warnDeprecation(key: CompilerDeprecationTypes, context: ParserContext | TransformContext, loc: SourceLocation | null, ...args: any[]): void;
47
47
 
48
48
  export type NodeTransform = (node: RootNode | TemplateChildNode, context: TransformContext) => void | (() => void) | (() => void)[];
49
49
  export type DirectiveTransform = (dir: DirectiveNode, node: ElementNode, context: TransformContext, augmentor?: (ret: DirectiveTransformResult) => DirectiveTransformResult) => DirectiveTransformResult;
50
- export interface DirectiveTransformResult {
50
+ interface DirectiveTransformResult {
51
51
  props: Property[];
52
52
  needRuntime?: boolean | symbol;
53
53
  ssrTagParts?: TemplateLiteral['elements'];
54
54
  }
55
55
  export type StructuralDirectiveTransform = (node: ElementNode, dir: DirectiveNode, context: TransformContext) => void | (() => void);
56
- export interface ImportItem {
56
+ interface ImportItem {
57
57
  exp: string | ExpressionNode;
58
58
  path: string;
59
59
  }
@@ -93,79 +93,79 @@ export interface TransformContext extends Required<Omit<TransformOptions, 'filen
93
93
  constantCache: Map<TemplateChildNode, ConstantTypes>;
94
94
  filters?: Set<string>;
95
95
  }
96
- declare function createTransformContext(root: RootNode, { filename, prefixIdentifiers, hoistStatic, cacheHandlers, nodeTransforms, directiveTransforms, transformHoist, isBuiltInComponent, isCustomElement, expressionPlugins, scopeId, slotted, ssr, inSSR, ssrCssVars, bindingMetadata, inline, isTS, onError, onWarn, compatConfig }: TransformOptions): TransformContext;
97
- declare function transform(root: RootNode, options: TransformOptions): void;
98
- declare function traverseNode(node: RootNode | TemplateChildNode, context: TransformContext): void;
99
- declare function createStructuralDirectiveTransform(name: string | RegExp, fn: StructuralDirectiveTransform): NodeTransform;
96
+ export declare function createTransformContext(root: RootNode, { filename, prefixIdentifiers, hoistStatic, cacheHandlers, nodeTransforms, directiveTransforms, transformHoist, isBuiltInComponent, isCustomElement, expressionPlugins, scopeId, slotted, ssr, inSSR, ssrCssVars, bindingMetadata, inline, isTS, onError, onWarn, compatConfig }: TransformOptions): TransformContext;
97
+ export declare function transform(root: RootNode, options: TransformOptions): void;
98
+ export declare function traverseNode(node: RootNode | TemplateChildNode, context: TransformContext): void;
99
+ export declare function createStructuralDirectiveTransform(name: string | RegExp, fn: StructuralDirectiveTransform): NodeTransform;
100
100
 
101
- declare function processFor(node: ElementNode, dir: DirectiveNode, context: TransformContext, processCodegen?: (forNode: ForNode) => (() => void) | undefined): (() => void) | undefined;
102
- export interface ForParseResult {
101
+ export declare function processFor(node: ElementNode, dir: DirectiveNode, context: TransformContext, processCodegen?: (forNode: ForNode) => (() => void) | undefined): (() => void) | undefined;
102
+ interface ForParseResult {
103
103
  source: ExpressionNode;
104
104
  value: ExpressionNode | undefined;
105
105
  key: ExpressionNode | undefined;
106
106
  index: ExpressionNode | undefined;
107
107
  }
108
- declare function createForLoopParams({ value, key, index }: ForParseResult, memoArgs?: ExpressionNode[]): ExpressionNode[];
108
+ export declare function createForLoopParams({ value, key, index }: ForParseResult, memoArgs?: ExpressionNode[]): ExpressionNode[];
109
109
 
110
- declare const FRAGMENT: unique symbol;
111
- declare const TELEPORT: unique symbol;
112
- declare const SUSPENSE: unique symbol;
113
- declare const KEEP_ALIVE: unique symbol;
114
- declare const BASE_TRANSITION: unique symbol;
115
- declare const OPEN_BLOCK: unique symbol;
116
- declare const CREATE_BLOCK: unique symbol;
117
- declare const CREATE_ELEMENT_BLOCK: unique symbol;
118
- declare const CREATE_VNODE: unique symbol;
119
- declare const CREATE_ELEMENT_VNODE: unique symbol;
120
- declare const CREATE_COMMENT: unique symbol;
121
- declare const CREATE_TEXT: unique symbol;
122
- declare const CREATE_STATIC: unique symbol;
123
- declare const RESOLVE_COMPONENT: unique symbol;
124
- declare const RESOLVE_DYNAMIC_COMPONENT: unique symbol;
125
- declare const RESOLVE_DIRECTIVE: unique symbol;
126
- declare const RESOLVE_FILTER: unique symbol;
127
- declare const WITH_DIRECTIVES: unique symbol;
128
- declare const RENDER_LIST: unique symbol;
129
- declare const RENDER_SLOT: unique symbol;
130
- declare const CREATE_SLOTS: unique symbol;
131
- declare const TO_DISPLAY_STRING: unique symbol;
132
- declare const MERGE_PROPS: unique symbol;
133
- declare const NORMALIZE_CLASS: unique symbol;
134
- declare const NORMALIZE_STYLE: unique symbol;
135
- declare const NORMALIZE_PROPS: unique symbol;
136
- declare const GUARD_REACTIVE_PROPS: unique symbol;
137
- declare const TO_HANDLERS: unique symbol;
138
- declare const CAMELIZE: unique symbol;
139
- declare const CAPITALIZE: unique symbol;
140
- declare const TO_HANDLER_KEY: unique symbol;
141
- declare const SET_BLOCK_TRACKING: unique symbol;
142
- declare const PUSH_SCOPE_ID: unique symbol;
143
- declare const POP_SCOPE_ID: unique symbol;
144
- declare const WITH_CTX: unique symbol;
145
- declare const UNREF: unique symbol;
146
- declare const IS_REF: unique symbol;
147
- declare const WITH_MEMO: unique symbol;
148
- declare const IS_MEMO_SAME: unique symbol;
149
- declare const helperNameMap: Record<symbol, string>;
150
- declare function registerRuntimeHelpers(helpers: Record<symbol, string>): void;
110
+ export declare const FRAGMENT: unique symbol;
111
+ export declare const TELEPORT: unique symbol;
112
+ export declare const SUSPENSE: unique symbol;
113
+ export declare const KEEP_ALIVE: unique symbol;
114
+ export declare const BASE_TRANSITION: unique symbol;
115
+ export declare const OPEN_BLOCK: unique symbol;
116
+ export declare const CREATE_BLOCK: unique symbol;
117
+ export declare const CREATE_ELEMENT_BLOCK: unique symbol;
118
+ export declare const CREATE_VNODE: unique symbol;
119
+ export declare const CREATE_ELEMENT_VNODE: unique symbol;
120
+ export declare const CREATE_COMMENT: unique symbol;
121
+ export declare const CREATE_TEXT: unique symbol;
122
+ export declare const CREATE_STATIC: unique symbol;
123
+ export declare const RESOLVE_COMPONENT: unique symbol;
124
+ export declare const RESOLVE_DYNAMIC_COMPONENT: unique symbol;
125
+ export declare const RESOLVE_DIRECTIVE: unique symbol;
126
+ export declare const RESOLVE_FILTER: unique symbol;
127
+ export declare const WITH_DIRECTIVES: unique symbol;
128
+ export declare const RENDER_LIST: unique symbol;
129
+ export declare const RENDER_SLOT: unique symbol;
130
+ export declare const CREATE_SLOTS: unique symbol;
131
+ export declare const TO_DISPLAY_STRING: unique symbol;
132
+ export declare const MERGE_PROPS: unique symbol;
133
+ export declare const NORMALIZE_CLASS: unique symbol;
134
+ export declare const NORMALIZE_STYLE: unique symbol;
135
+ export declare const NORMALIZE_PROPS: unique symbol;
136
+ export declare const GUARD_REACTIVE_PROPS: unique symbol;
137
+ export declare const TO_HANDLERS: unique symbol;
138
+ export declare const CAMELIZE: unique symbol;
139
+ export declare const CAPITALIZE: unique symbol;
140
+ export declare const TO_HANDLER_KEY: unique symbol;
141
+ export declare const SET_BLOCK_TRACKING: unique symbol;
142
+ export declare const PUSH_SCOPE_ID: unique symbol;
143
+ export declare const POP_SCOPE_ID: unique symbol;
144
+ export declare const WITH_CTX: unique symbol;
145
+ export declare const UNREF: unique symbol;
146
+ export declare const IS_REF: unique symbol;
147
+ export declare const WITH_MEMO: unique symbol;
148
+ export declare const IS_MEMO_SAME: unique symbol;
149
+ export declare const helperNameMap: Record<symbol, string>;
150
+ export declare function registerRuntimeHelpers(helpers: Record<symbol, string>): void;
151
151
 
152
- declare const transformElement: NodeTransform;
153
- declare function resolveComponentType(node: ComponentNode, context: TransformContext, ssr?: boolean): string | symbol | CallExpression;
152
+ export declare const transformElement: NodeTransform;
153
+ export declare function resolveComponentType(node: ComponentNode, context: TransformContext, ssr?: boolean): string | symbol | CallExpression;
154
154
  export type PropsExpression = ObjectExpression | CallExpression | ExpressionNode;
155
- declare function buildProps(node: ElementNode, context: TransformContext, props: (DirectiveNode | AttributeNode)[] | undefined, isComponent: boolean, isDynamicComponent: boolean, ssr?: boolean): {
155
+ export declare function buildProps(node: ElementNode, context: TransformContext, props: (DirectiveNode | AttributeNode)[] | undefined, isComponent: boolean, isDynamicComponent: boolean, ssr?: boolean): {
156
156
  props: PropsExpression | undefined;
157
157
  directives: DirectiveNode[];
158
158
  patchFlag: number;
159
159
  dynamicPropNames: string[];
160
160
  shouldUseBlock: boolean;
161
161
  };
162
- declare function buildDirectiveArgs(dir: DirectiveNode, context: TransformContext): ArrayExpression;
162
+ export declare function buildDirectiveArgs(dir: DirectiveNode, context: TransformContext): ArrayExpression;
163
163
 
164
164
  export type Namespace = number;
165
- declare const enum Namespaces {
165
+ export declare const enum Namespaces {
166
166
  HTML = 0
167
167
  }
168
- declare const enum NodeTypes {
168
+ export declare const enum NodeTypes {
169
169
  ROOT = 0,
170
170
  ELEMENT = 1,
171
171
  TEXT = 2,
@@ -194,7 +194,7 @@ declare const enum NodeTypes {
194
194
  JS_SEQUENCE_EXPRESSION = 25,
195
195
  JS_RETURN_STATEMENT = 26
196
196
  }
197
- declare const enum ElementTypes {
197
+ export declare const enum ElementTypes {
198
198
  ELEMENT = 0,
199
199
  COMPONENT = 1,
200
200
  SLOT = 2,
@@ -289,7 +289,7 @@ export interface DirectiveNode extends Node {
289
289
  * Higher levels implies lower levels. e.g. a node that can be stringified
290
290
  * can always be hoisted and skipped for patch.
291
291
  */
292
- declare const enum ConstantTypes {
292
+ export declare const enum ConstantTypes {
293
293
  NOT_CONSTANT = 0,
294
294
  CAN_SKIP_PATCH = 1,
295
295
  CAN_HOIST = 2,
@@ -419,7 +419,7 @@ export interface MemoExpression extends CallExpression {
419
419
  callee: typeof WITH_MEMO;
420
420
  arguments: [ExpressionNode, MemoFactory, string, string];
421
421
  }
422
- export interface MemoFactory extends FunctionExpression {
422
+ interface MemoFactory extends FunctionExpression {
423
423
  returns: BlockCodegenNode;
424
424
  }
425
425
  export type SSRCodegenNode = BlockStatement | TemplateLiteral | IfStatement | AssignmentExpression | ReturnStatement | SequenceExpression;
@@ -519,26 +519,29 @@ export interface ForRenderListExpression extends CallExpression {
519
519
  export interface ForIteratorExpression extends FunctionExpression {
520
520
  returns: BlockCodegenNode;
521
521
  }
522
- declare const locStub: SourceLocation;
523
- declare function createRoot(children: TemplateChildNode[], loc?: SourceLocation): RootNode;
524
- declare function createVNodeCall(context: TransformContext | null, tag: VNodeCall['tag'], props?: VNodeCall['props'], children?: VNodeCall['children'], patchFlag?: VNodeCall['patchFlag'], dynamicProps?: VNodeCall['dynamicProps'], directives?: VNodeCall['directives'], isBlock?: VNodeCall['isBlock'], disableTracking?: VNodeCall['disableTracking'], isComponent?: VNodeCall['isComponent'], loc?: SourceLocation): VNodeCall;
525
- declare function createArrayExpression(elements: ArrayExpression['elements'], loc?: SourceLocation): ArrayExpression;
526
- declare function createObjectExpression(properties: ObjectExpression['properties'], loc?: SourceLocation): ObjectExpression;
527
- declare function createObjectProperty(key: Property['key'] | string, value: Property['value']): Property;
528
- declare function createSimpleExpression(content: SimpleExpressionNode['content'], isStatic?: SimpleExpressionNode['isStatic'], loc?: SourceLocation, constType?: ConstantTypes): SimpleExpressionNode;
529
- declare function createInterpolation(content: InterpolationNode['content'] | string, loc: SourceLocation): InterpolationNode;
530
- declare function createCompoundExpression(children: CompoundExpressionNode['children'], loc?: SourceLocation): CompoundExpressionNode;
531
- export type InferCodegenNodeType<T> = T extends typeof RENDER_SLOT ? RenderSlotCall : CallExpression;
532
- declare function createCallExpression<T extends CallExpression['callee']>(callee: T, args?: CallExpression['arguments'], loc?: SourceLocation): InferCodegenNodeType<T>;
533
- declare function createFunctionExpression(params: FunctionExpression['params'], returns?: FunctionExpression['returns'], newline?: boolean, isSlot?: boolean, loc?: SourceLocation): FunctionExpression;
534
- declare function createConditionalExpression(test: ConditionalExpression['test'], consequent: ConditionalExpression['consequent'], alternate: ConditionalExpression['alternate'], newline?: boolean): ConditionalExpression;
535
- declare function createCacheExpression(index: number, value: JSChildNode, isVNode?: boolean): CacheExpression;
536
- declare function createBlockStatement(body: BlockStatement['body']): BlockStatement;
537
- declare function createTemplateLiteral(elements: TemplateLiteral['elements']): TemplateLiteral;
538
- declare function createIfStatement(test: IfStatement['test'], consequent: IfStatement['consequent'], alternate?: IfStatement['alternate']): IfStatement;
539
- declare function createAssignmentExpression(left: AssignmentExpression['left'], right: AssignmentExpression['right']): AssignmentExpression;
540
- declare function createSequenceExpression(expressions: SequenceExpression['expressions']): SequenceExpression;
541
- declare function createReturnStatement(returns: ReturnStatement['returns']): ReturnStatement;
522
+ export declare const locStub: SourceLocation;
523
+ export declare function createRoot(children: TemplateChildNode[], loc?: SourceLocation): RootNode;
524
+ export declare function createVNodeCall(context: TransformContext | null, tag: VNodeCall['tag'], props?: VNodeCall['props'], children?: VNodeCall['children'], patchFlag?: VNodeCall['patchFlag'], dynamicProps?: VNodeCall['dynamicProps'], directives?: VNodeCall['directives'], isBlock?: VNodeCall['isBlock'], disableTracking?: VNodeCall['disableTracking'], isComponent?: VNodeCall['isComponent'], loc?: SourceLocation): VNodeCall;
525
+ export declare function createArrayExpression(elements: ArrayExpression['elements'], loc?: SourceLocation): ArrayExpression;
526
+ export declare function createObjectExpression(properties: ObjectExpression['properties'], loc?: SourceLocation): ObjectExpression;
527
+ export declare function createObjectProperty(key: Property['key'] | string, value: Property['value']): Property;
528
+ export declare function createSimpleExpression(content: SimpleExpressionNode['content'], isStatic?: SimpleExpressionNode['isStatic'], loc?: SourceLocation, constType?: ConstantTypes): SimpleExpressionNode;
529
+ export declare function createInterpolation(content: InterpolationNode['content'] | string, loc: SourceLocation): InterpolationNode;
530
+ export declare function createCompoundExpression(children: CompoundExpressionNode['children'], loc?: SourceLocation): CompoundExpressionNode;
531
+ type InferCodegenNodeType<T> = T extends typeof RENDER_SLOT ? RenderSlotCall : CallExpression;
532
+ export declare function createCallExpression<T extends CallExpression['callee']>(callee: T, args?: CallExpression['arguments'], loc?: SourceLocation): InferCodegenNodeType<T>;
533
+ export declare function createFunctionExpression(params: FunctionExpression['params'], returns?: FunctionExpression['returns'], newline?: boolean, isSlot?: boolean, loc?: SourceLocation): FunctionExpression;
534
+ export declare function createConditionalExpression(test: ConditionalExpression['test'], consequent: ConditionalExpression['consequent'], alternate: ConditionalExpression['alternate'], newline?: boolean): ConditionalExpression;
535
+ export declare function createCacheExpression(index: number, value: JSChildNode, isVNode?: boolean): CacheExpression;
536
+ export declare function createBlockStatement(body: BlockStatement['body']): BlockStatement;
537
+ export declare function createTemplateLiteral(elements: TemplateLiteral['elements']): TemplateLiteral;
538
+ export declare function createIfStatement(test: IfStatement['test'], consequent: IfStatement['consequent'], alternate?: IfStatement['alternate']): IfStatement;
539
+ export declare function createAssignmentExpression(left: AssignmentExpression['left'], right: AssignmentExpression['right']): AssignmentExpression;
540
+ export declare function createSequenceExpression(expressions: SequenceExpression['expressions']): SequenceExpression;
541
+ export declare function createReturnStatement(returns: ReturnStatement['returns']): ReturnStatement;
542
+ export declare function getVNodeHelper(ssr: boolean, isComponent: boolean): typeof CREATE_VNODE | typeof CREATE_ELEMENT_VNODE;
543
+ export declare function getVNodeBlockHelper(ssr: boolean, isComponent: boolean): typeof CREATE_BLOCK | typeof CREATE_ELEMENT_BLOCK;
544
+ export declare function convertToBlock(node: VNodeCall, { helper, removeHelper, inSSR }: TransformContext): void;
542
545
 
543
546
  export interface CompilerError extends SyntaxError {
544
547
  code: number | string;
@@ -547,11 +550,11 @@ export interface CompilerError extends SyntaxError {
547
550
  export interface CoreCompilerError extends CompilerError {
548
551
  code: ErrorCodes;
549
552
  }
550
- export type InferCompilerError<T> = T extends ErrorCodes ? CoreCompilerError : CompilerError;
551
- declare function createCompilerError<T extends number>(code: T, loc?: SourceLocation, messages?: {
553
+ type InferCompilerError<T> = T extends ErrorCodes ? CoreCompilerError : CompilerError;
554
+ export declare function createCompilerError<T extends number>(code: T, loc?: SourceLocation, messages?: {
552
555
  [code: number]: string;
553
556
  }, additionalMessage?: string): InferCompilerError<T>;
554
- declare const enum ErrorCodes {
557
+ export declare const enum ErrorCodes {
555
558
  ABRUPT_CLOSING_OF_EMPTY_COMMENT = 0,
556
559
  CDATA_IN_HTML_CONTENT = 1,
557
560
  DUPLICATE_ATTRIBUTE = 2,
@@ -606,7 +609,7 @@ declare const enum ErrorCodes {
606
609
  __EXTEND_POINT__ = 51
607
610
  }
608
611
 
609
- export interface ErrorHandlingOptions {
612
+ interface ErrorHandlingOptions {
610
613
  onWarn?: (warning: CompilerError) => void;
611
614
  onError?: (error: CompilerError) => void;
612
615
  }
@@ -658,7 +661,7 @@ export interface ParserOptions extends ErrorHandlingOptions, CompilerCompatOptio
658
661
  comments?: boolean;
659
662
  }
660
663
  export type HoistTransform = (children: TemplateChildNode[], context: TransformContext, parent: ParentNode) => void;
661
- declare const enum BindingTypes {
664
+ export declare const enum BindingTypes {
662
665
  /**
663
666
  * returned from data()
664
667
  */
@@ -697,7 +700,11 @@ declare const enum BindingTypes {
697
700
  /**
698
701
  * declared by other options, e.g. computed, inject
699
702
  */
700
- OPTIONS = "options"
703
+ OPTIONS = "options",
704
+ /**
705
+ * a literal constant, e.g. 'foo', 1, true
706
+ */
707
+ LITERAL_CONST = "literal-const"
701
708
  }
702
709
  export type BindingMetadata = {
703
710
  [key: string]: BindingTypes | undefined;
@@ -705,7 +712,7 @@ export type BindingMetadata = {
705
712
  __isScriptSetup?: boolean;
706
713
  __propsAliases?: Record<string, string>;
707
714
  };
708
- export interface SharedTransformCodegenOptions {
715
+ interface SharedTransformCodegenOptions {
709
716
  /**
710
717
  * Transform expressions like {{ foo }} to `_ctx.foo`.
711
718
  * If this option is false, the generated code will be wrapped in a
@@ -877,7 +884,7 @@ export interface CodegenOptions extends SharedTransformCodegenOptions {
877
884
  }
878
885
  export type CompilerOptions = ParserOptions & TransformOptions & CodegenOptions;
879
886
 
880
- export type CodegenNode = TemplateChildNode | JSChildNode | SSRCodegenNode;
887
+ type CodegenNode = TemplateChildNode | JSChildNode | SSRCodegenNode;
881
888
  export interface CodegenResult {
882
889
  code: string;
883
890
  preamble: string;
@@ -899,7 +906,7 @@ export interface CodegenContext extends Omit<Required<CodegenOptions>, 'bindingM
899
906
  deindent(withoutNewLine?: boolean): void;
900
907
  newline(): void;
901
908
  }
902
- declare function generate(ast: RootNode, options?: CodegenOptions & {
909
+ export declare function generate(ast: RootNode, options?: CodegenOptions & {
903
910
  onContextCreated?: (context: CodegenContext) => void;
904
911
  }): CodegenResult;
905
912
 
@@ -907,80 +914,80 @@ export type TransformPreset = [
907
914
  NodeTransform[],
908
915
  Record<string, DirectiveTransform>
909
916
  ];
910
- declare function getBaseTransformPreset(prefixIdentifiers?: boolean): TransformPreset;
911
- declare function baseCompile(template: string | RootNode, options?: CompilerOptions): CodegenResult;
917
+ export declare function getBaseTransformPreset(prefixIdentifiers?: boolean): TransformPreset;
918
+ export declare function baseCompile(template: string | RootNode, options?: CompilerOptions): CodegenResult;
912
919
 
913
- declare const isStaticExp: (p: JSChildNode) => p is SimpleExpressionNode;
914
- declare const isBuiltInType: (tag: string, expected: string) => boolean;
915
- declare function isCoreComponent(tag: string): symbol | void;
916
- declare const isSimpleIdentifier: (name: string) => boolean;
920
+ export declare const isStaticExp: (p: JSChildNode) => p is SimpleExpressionNode;
921
+ export declare const isBuiltInType: (tag: string, expected: string) => boolean;
922
+ export declare function isCoreComponent(tag: string): symbol | void;
923
+ export declare const isSimpleIdentifier: (name: string) => boolean;
917
924
  /**
918
925
  * Simple lexer to check if an expression is a member expression. This is
919
926
  * lax and only checks validity at the root level (i.e. does not validate exps
920
927
  * inside square brackets), but it's ok since these are only used on template
921
928
  * expressions and false positives are invalid expressions in the first place.
922
929
  */
923
- declare const isMemberExpressionBrowser: (path: string) => boolean;
924
- declare const isMemberExpressionNode: (path: string, context: TransformContext) => boolean;
925
- declare const isMemberExpression: (path: string, context: TransformContext) => boolean;
926
- declare function getInnerRange(loc: SourceLocation, offset: number, length: number): SourceLocation;
927
- declare function advancePositionWithClone(pos: Position, source: string, numberOfCharacters?: number): Position;
928
- declare function advancePositionWithMutation(pos: Position, source: string, numberOfCharacters?: number): Position;
929
- declare function assert(condition: boolean, msg?: string): void;
930
- declare function findDir(node: ElementNode, name: string | RegExp, allowEmpty?: boolean): DirectiveNode | undefined;
931
- declare function findProp(node: ElementNode, name: string, dynamicOnly?: boolean, allowEmpty?: boolean): ElementNode['props'][0] | undefined;
932
- declare function isStaticArgOf(arg: DirectiveNode['arg'], name: string): boolean;
933
- declare function hasDynamicKeyVBind(node: ElementNode): boolean;
934
- declare function isText(node: TemplateChildNode): node is TextNode | InterpolationNode;
935
- declare function isVSlot(p: ElementNode['props'][0]): p is DirectiveNode;
936
- declare function isTemplateNode(node: RootNode | TemplateChildNode): node is TemplateNode;
937
- declare function isSlotOutlet(node: RootNode | TemplateChildNode): node is SlotOutletNode;
938
- declare function getVNodeHelper(ssr: boolean, isComponent: boolean): typeof CREATE_VNODE | typeof CREATE_ELEMENT_VNODE;
939
- declare function getVNodeBlockHelper(ssr: boolean, isComponent: boolean): typeof CREATE_BLOCK | typeof CREATE_ELEMENT_BLOCK;
940
- declare function injectProp(node: VNodeCall | RenderSlotCall, prop: Property, context: TransformContext): void;
941
- declare function toValidAssetId(name: string, type: 'component' | 'directive' | 'filter'): string;
942
- declare function hasScopeRef(node: TemplateChildNode | IfBranchNode | ExpressionNode | undefined, ids: TransformContext['identifiers']): boolean;
943
- declare function getMemoedVNodeCall(node: BlockCodegenNode | MemoExpression): VNodeCall | RenderSlotCall;
944
- declare function makeBlock(node: VNodeCall, { helper, removeHelper, inSSR }: TransformContext): void;
930
+ export declare const isMemberExpressionBrowser: (path: string) => boolean;
931
+ export declare const isMemberExpressionNode: (path: string, context: TransformContext) => boolean;
932
+ export declare const isMemberExpression: (path: string, context: TransformContext) => boolean;
933
+ export declare function getInnerRange(loc: SourceLocation, offset: number, length: number): SourceLocation;
934
+ export declare function advancePositionWithClone(pos: Position, source: string, numberOfCharacters?: number): Position;
935
+ export declare function advancePositionWithMutation(pos: Position, source: string, numberOfCharacters?: number): Position;
936
+ export declare function assert(condition: boolean, msg?: string): void;
937
+ export declare function findDir(node: ElementNode, name: string | RegExp, allowEmpty?: boolean): DirectiveNode | undefined;
938
+ export declare function findProp(node: ElementNode, name: string, dynamicOnly?: boolean, allowEmpty?: boolean): ElementNode['props'][0] | undefined;
939
+ export declare function isStaticArgOf(arg: DirectiveNode['arg'], name: string): boolean;
940
+ export declare function hasDynamicKeyVBind(node: ElementNode): boolean;
941
+ export declare function isText(node: TemplateChildNode): node is TextNode | InterpolationNode;
942
+ export declare function isVSlot(p: ElementNode['props'][0]): p is DirectiveNode;
943
+ export declare function isTemplateNode(node: RootNode | TemplateChildNode): node is TemplateNode;
944
+ export declare function isSlotOutlet(node: RootNode | TemplateChildNode): node is SlotOutletNode;
945
+ export declare function injectProp(node: VNodeCall | RenderSlotCall, prop: Property, context: TransformContext): void;
946
+ export declare function toValidAssetId(name: string, type: 'component' | 'directive' | 'filter'): string;
947
+ export declare function hasScopeRef(node: TemplateChildNode | IfBranchNode | ExpressionNode | undefined, ids: TransformContext['identifiers']): boolean;
948
+ export declare function getMemoedVNodeCall(node: BlockCodegenNode | MemoExpression): VNodeCall | RenderSlotCall;
945
949
 
946
- declare function walkIdentifiers(root: Node$1, onIdentifier: (node: Identifier, parent: Node$1, parentStack: Node$1[], isReference: boolean, isLocal: boolean) => void, includeAll?: boolean, parentStack?: Node$1[], knownIds?: Record<string, number>): void;
947
- declare function isReferencedIdentifier(id: Identifier, parent: Node$1 | null, parentStack: Node$1[]): boolean;
948
- declare function isInDestructureAssignment(parent: Node$1, parentStack: Node$1[]): boolean;
949
- declare function walkFunctionParams(node: Function, onIdent: (id: Identifier) => void): void;
950
- declare function walkBlockDeclarations(block: BlockStatement$1 | Program, onIdent: (node: Identifier) => void): void;
951
- declare function extractIdentifiers(param: Node$1, nodes?: Identifier[]): Identifier[];
952
- declare const isFunctionType: (node: Node$1) => node is Function;
953
- declare const isStaticProperty: (node: Node$1) => node is ObjectProperty;
954
- declare const isStaticPropertyKey: (node: Node$1, parent: Node$1) => boolean;
950
+ export declare function walkIdentifiers(root: Node$1, onIdentifier: (node: Identifier, parent: Node$1, parentStack: Node$1[], isReference: boolean, isLocal: boolean) => void, includeAll?: boolean, parentStack?: Node$1[], knownIds?: Record<string, number>): void;
951
+ export declare function isReferencedIdentifier(id: Identifier, parent: Node$1 | null, parentStack: Node$1[]): boolean;
952
+ export declare function isInDestructureAssignment(parent: Node$1, parentStack: Node$1[]): boolean;
953
+ export declare function walkFunctionParams(node: Function, onIdent: (id: Identifier) => void): void;
954
+ export declare function walkBlockDeclarations(block: BlockStatement$1 | Program, onIdent: (node: Identifier) => void): void;
955
+ export declare function extractIdentifiers(param: Node$1, nodes?: Identifier[]): Identifier[];
956
+ export declare const isFunctionType: (node: Node$1) => node is Function;
957
+ export declare const isStaticProperty: (node: Node$1) => node is ObjectProperty;
958
+ export declare const isStaticPropertyKey: (node: Node$1, parent: Node$1) => boolean;
959
+ export declare function getImportedName(specifier: ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier): string;
960
+ export declare const TS_NODE_TYPES: string[];
961
+ export declare function unwrapTSNode(node: Node$1): Node$1;
962
+ export declare function isCallOf(node: Node$1 | null | undefined, test: string | ((id: string) => boolean) | null | undefined): node is CallExpression$1;
955
963
 
956
- declare const transformModel: DirectiveTransform;
964
+ export declare const transformModel: DirectiveTransform;
957
965
 
958
- declare const transformOn: DirectiveTransform;
966
+ export declare const transformOn: DirectiveTransform;
959
967
 
960
- declare const transformBind: DirectiveTransform;
968
+ export declare const transformBind: DirectiveTransform;
961
969
 
962
- declare const noopDirectiveTransform: DirectiveTransform;
970
+ export declare const noopDirectiveTransform: DirectiveTransform;
963
971
 
964
- declare function processIf(node: ElementNode, dir: DirectiveNode, context: TransformContext, processCodegen?: (node: IfNode, branch: IfBranchNode, isRoot: boolean) => (() => void) | undefined): (() => void) | undefined;
972
+ export declare function processIf(node: ElementNode, dir: DirectiveNode, context: TransformContext, processCodegen?: (node: IfNode, branch: IfBranchNode, isRoot: boolean) => (() => void) | undefined): (() => void) | undefined;
965
973
 
966
- declare const transformExpression: NodeTransform;
967
- declare function processExpression(node: SimpleExpressionNode, context: TransformContext, asParams?: boolean, asRawStatements?: boolean, localVars?: Record<string, number>): ExpressionNode;
968
- declare function stringifyExpression(exp: ExpressionNode | string): string;
974
+ export declare const transformExpression: NodeTransform;
975
+ export declare function processExpression(node: SimpleExpressionNode, context: TransformContext, asParams?: boolean, asRawStatements?: boolean, localVars?: Record<string, number>): ExpressionNode;
976
+ export declare function stringifyExpression(exp: ExpressionNode | string): string;
969
977
 
970
- declare const trackSlotScopes: NodeTransform;
971
- declare const trackVForSlotScopes: NodeTransform;
978
+ export declare const trackSlotScopes: NodeTransform;
979
+ export declare const trackVForSlotScopes: NodeTransform;
972
980
  export type SlotFnBuilder = (slotProps: ExpressionNode | undefined, slotChildren: TemplateChildNode[], loc: SourceLocation) => FunctionExpression;
973
- declare function buildSlots(node: ElementNode, context: TransformContext, buildSlotFn?: SlotFnBuilder): {
981
+ export declare function buildSlots(node: ElementNode, context: TransformContext, buildSlotFn?: SlotFnBuilder): {
974
982
  slots: SlotsExpression;
975
983
  hasDynamicSlots: boolean;
976
984
  };
977
985
 
978
- export interface SlotOutletProcessResult {
986
+ interface SlotOutletProcessResult {
979
987
  slotName: string | ExpressionNode;
980
988
  slotProps: PropsExpression | undefined;
981
989
  }
982
- declare function processSlotOutlet(node: SlotOutletNode, context: TransformContext): SlotOutletProcessResult;
990
+ export declare function processSlotOutlet(node: SlotOutletNode, context: TransformContext): SlotOutletProcessResult;
983
991
 
984
- declare function getConstantType(node: TemplateChildNode | SimpleExpressionNode, context: TransformContext): ConstantTypes;
992
+ export declare function getConstantType(node: TemplateChildNode | SimpleExpressionNode, context: TransformContext): ConstantTypes;
985
993
 
986
- export { BASE_TRANSITION, BindingTypes, CAMELIZE, CAPITALIZE, CREATE_BLOCK, CREATE_COMMENT, CREATE_ELEMENT_BLOCK, CREATE_ELEMENT_VNODE, CREATE_SLOTS, CREATE_STATIC, CREATE_TEXT, CREATE_VNODE, CompilerDeprecationTypes, ConstantTypes, ElementTypes, ErrorCodes, FRAGMENT, GUARD_REACTIVE_PROPS, IS_MEMO_SAME, IS_REF, KEEP_ALIVE, MERGE_PROPS, NORMALIZE_CLASS, NORMALIZE_PROPS, NORMALIZE_STYLE, Namespaces, NodeTypes, OPEN_BLOCK, POP_SCOPE_ID, PUSH_SCOPE_ID, RENDER_LIST, RENDER_SLOT, RESOLVE_COMPONENT, RESOLVE_DIRECTIVE, RESOLVE_DYNAMIC_COMPONENT, RESOLVE_FILTER, SET_BLOCK_TRACKING, SUSPENSE, TELEPORT, TO_DISPLAY_STRING, TO_HANDLERS, TO_HANDLER_KEY, TextModes, UNREF, WITH_CTX, WITH_DIRECTIVES, WITH_MEMO, advancePositionWithClone, advancePositionWithMutation, assert, baseCompile, baseParse, buildDirectiveArgs, buildProps, buildSlots, checkCompatEnabled, createArrayExpression, createAssignmentExpression, createBlockStatement, createCacheExpression, createCallExpression, createCompilerError, createCompoundExpression, createConditionalExpression, createForLoopParams, createFunctionExpression, createIfStatement, createInterpolation, createObjectExpression, createObjectProperty, createReturnStatement, createRoot, createSequenceExpression, createSimpleExpression, createStructuralDirectiveTransform, createTemplateLiteral, createTransformContext, createVNodeCall, extractIdentifiers, findDir, findProp, generate, getBaseTransformPreset, getConstantType, getInnerRange, getMemoedVNodeCall, getVNodeBlockHelper, getVNodeHelper, hasDynamicKeyVBind, hasScopeRef, helperNameMap, injectProp, isBuiltInType, isCoreComponent, isFunctionType, isInDestructureAssignment, isMemberExpression, isMemberExpressionBrowser, isMemberExpressionNode, isReferencedIdentifier, isSimpleIdentifier, isSlotOutlet, isStaticArgOf, isStaticExp, isStaticProperty, isStaticPropertyKey, isTemplateNode, isText, isVSlot, locStub, makeBlock, noopDirectiveTransform, processExpression, processFor, processIf, processSlotOutlet, registerRuntimeHelpers, resolveComponentType, stringifyExpression, toValidAssetId, trackSlotScopes, trackVForSlotScopes, transform, transformBind, transformElement, transformExpression, transformModel, transformOn, traverseNode, walkBlockDeclarations, walkFunctionParams, walkIdentifiers, warnDeprecation };
@@ -336,6 +336,20 @@ function createReturnStatement(returns) {
336
336
  loc: locStub
337
337
  };
338
338
  }
339
+ function getVNodeHelper(ssr, isComponent) {
340
+ return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE;
341
+ }
342
+ function getVNodeBlockHelper(ssr, isComponent) {
343
+ return ssr || isComponent ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK;
344
+ }
345
+ function convertToBlock(node, { helper, removeHelper, inSSR }) {
346
+ if (!node.isBlock) {
347
+ node.isBlock = true;
348
+ removeHelper(getVNodeHelper(inSSR, node.isComponent));
349
+ helper(OPEN_BLOCK);
350
+ helper(getVNodeBlockHelper(inSSR, node.isComponent));
351
+ }
352
+ }
339
353
 
340
354
  const isStaticExp = (p) => p.type === 4 && p.isStatic;
341
355
  const isBuiltInType = (tag, expected) => tag === expected || tag === hyphenate(expected);
@@ -506,12 +520,6 @@ function isTemplateNode(node) {
506
520
  function isSlotOutlet(node) {
507
521
  return node.type === 1 && node.tagType === 2;
508
522
  }
509
- function getVNodeHelper(ssr, isComponent) {
510
- return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE;
511
- }
512
- function getVNodeBlockHelper(ssr, isComponent) {
513
- return ssr || isComponent ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK;
514
- }
515
523
  const propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);
516
524
  function getUnnormalizedProps(props, callPath = []) {
517
525
  if (props && !isString(props) && props.type === 14) {
@@ -645,14 +653,6 @@ function getMemoedVNodeCall(node) {
645
653
  return node;
646
654
  }
647
655
  }
648
- function makeBlock(node, { helper, removeHelper, inSSR }) {
649
- if (!node.isBlock) {
650
- node.isBlock = true;
651
- removeHelper(getVNodeHelper(inSSR, node.isComponent));
652
- helper(OPEN_BLOCK);
653
- helper(getVNodeBlockHelper(inSSR, node.isComponent));
654
- }
655
- }
656
656
 
657
657
  const deprecationData = {
658
658
  ["COMPILER_IS_ON_ELEMENT"]: {
@@ -1915,7 +1915,7 @@ function createRootCodegen(root, context) {
1915
1915
  if (isSingleElementRoot(root, child) && child.codegenNode) {
1916
1916
  const codegenNode = child.codegenNode;
1917
1917
  if (codegenNode.type === 13) {
1918
- makeBlock(codegenNode, context);
1918
+ convertToBlock(codegenNode, context);
1919
1919
  }
1920
1920
  root.codegenNode = codegenNode;
1921
1921
  } else {
@@ -2676,6 +2676,35 @@ const isFunctionType = (node) => {
2676
2676
  };
2677
2677
  const isStaticProperty = (node) => node && (node.type === "ObjectProperty" || node.type === "ObjectMethod") && !node.computed;
2678
2678
  const isStaticPropertyKey = (node, parent) => isStaticProperty(parent) && parent.key === node;
2679
+ function getImportedName(specifier) {
2680
+ if (specifier.type === "ImportSpecifier")
2681
+ return specifier.imported.type === "Identifier" ? specifier.imported.name : specifier.imported.value;
2682
+ else if (specifier.type === "ImportNamespaceSpecifier")
2683
+ return "*";
2684
+ return "default";
2685
+ }
2686
+ const TS_NODE_TYPES = [
2687
+ "TSAsExpression",
2688
+ // foo as number
2689
+ "TSTypeAssertion",
2690
+ // (<number>foo)
2691
+ "TSNonNullExpression",
2692
+ // foo!
2693
+ "TSInstantiationExpression",
2694
+ // foo<string>
2695
+ "TSSatisfiesExpression"
2696
+ // foo satisfies T
2697
+ ];
2698
+ function unwrapTSNode(node) {
2699
+ if (TS_NODE_TYPES.includes(node.type)) {
2700
+ return unwrapTSNode(node.expression);
2701
+ } else {
2702
+ return node;
2703
+ }
2704
+ }
2705
+ function isCallOf(node, test) {
2706
+ return !!(node && test && node.type === "CallExpression" && node.callee.type === "Identifier" && (typeof test === "string" ? node.callee.name === test : test(node.callee.name)));
2707
+ }
2679
2708
 
2680
2709
  const prohibitedKeywordRE = new RegExp(
2681
2710
  "\\b" + "arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b") + "\\b"
@@ -2934,7 +2963,7 @@ function createChildrenCodegenNode(branch, keyIndex, context) {
2934
2963
  const ret = firstChild.codegenNode;
2935
2964
  const vnodeCall = getMemoedVNodeCall(ret);
2936
2965
  if (vnodeCall.type === 13) {
2937
- makeBlock(vnodeCall, context);
2966
+ convertToBlock(vnodeCall, context);
2938
2967
  }
2939
2968
  injectProp(vnodeCall, keyProperty, context);
2940
2969
  return ret;
@@ -4587,7 +4616,7 @@ const transformMemo = (node, context) => {
4587
4616
  const codegenNode = node.codegenNode || context.currentNode.codegenNode;
4588
4617
  if (codegenNode && codegenNode.type === 13) {
4589
4618
  if (node.tagType !== 1) {
4590
- makeBlock(codegenNode, context);
4619
+ convertToBlock(codegenNode, context);
4591
4620
  }
4592
4621
  node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [
4593
4622
  dir.exp,
@@ -4667,4 +4696,4 @@ function baseCompile(template, options = {}) {
4667
4696
 
4668
4697
  const noopDirectiveTransform = () => ({ props: [] });
4669
4698
 
4670
- export { BASE_TRANSITION, CAMELIZE, CAPITALIZE, CREATE_BLOCK, CREATE_COMMENT, CREATE_ELEMENT_BLOCK, CREATE_ELEMENT_VNODE, CREATE_SLOTS, CREATE_STATIC, CREATE_TEXT, CREATE_VNODE, FRAGMENT, GUARD_REACTIVE_PROPS, IS_MEMO_SAME, IS_REF, KEEP_ALIVE, MERGE_PROPS, NORMALIZE_CLASS, NORMALIZE_PROPS, NORMALIZE_STYLE, OPEN_BLOCK, POP_SCOPE_ID, PUSH_SCOPE_ID, RENDER_LIST, RENDER_SLOT, RESOLVE_COMPONENT, RESOLVE_DIRECTIVE, RESOLVE_DYNAMIC_COMPONENT, RESOLVE_FILTER, SET_BLOCK_TRACKING, SUSPENSE, TELEPORT, TO_DISPLAY_STRING, TO_HANDLERS, TO_HANDLER_KEY, UNREF, WITH_CTX, WITH_DIRECTIVES, WITH_MEMO, advancePositionWithClone, advancePositionWithMutation, assert, baseCompile, baseParse, buildDirectiveArgs, buildProps, buildSlots, checkCompatEnabled, createArrayExpression, createAssignmentExpression, createBlockStatement, createCacheExpression, createCallExpression, createCompilerError, createCompoundExpression, createConditionalExpression, createForLoopParams, createFunctionExpression, createIfStatement, createInterpolation, createObjectExpression, createObjectProperty, createReturnStatement, createRoot, createSequenceExpression, createSimpleExpression, createStructuralDirectiveTransform, createTemplateLiteral, createTransformContext, createVNodeCall, extractIdentifiers, findDir, findProp, generate, getBaseTransformPreset, getConstantType, getInnerRange, getMemoedVNodeCall, getVNodeBlockHelper, getVNodeHelper, hasDynamicKeyVBind, hasScopeRef, helperNameMap, injectProp, isBuiltInType, isCoreComponent, isFunctionType, isInDestructureAssignment, isMemberExpression, isMemberExpressionBrowser, isMemberExpressionNode, isReferencedIdentifier, isSimpleIdentifier, isSlotOutlet, isStaticArgOf, isStaticExp, isStaticProperty, isStaticPropertyKey, isTemplateNode, isText$1 as isText, isVSlot, locStub, makeBlock, noopDirectiveTransform, processExpression, processFor, processIf, processSlotOutlet, registerRuntimeHelpers, resolveComponentType, stringifyExpression, toValidAssetId, trackSlotScopes, trackVForSlotScopes, transform, transformBind, transformElement, transformExpression, transformModel, transformOn, traverseNode, walkBlockDeclarations, walkFunctionParams, walkIdentifiers, warnDeprecation };
4699
+ export { BASE_TRANSITION, CAMELIZE, CAPITALIZE, CREATE_BLOCK, CREATE_COMMENT, CREATE_ELEMENT_BLOCK, CREATE_ELEMENT_VNODE, CREATE_SLOTS, CREATE_STATIC, CREATE_TEXT, CREATE_VNODE, FRAGMENT, GUARD_REACTIVE_PROPS, IS_MEMO_SAME, IS_REF, KEEP_ALIVE, MERGE_PROPS, NORMALIZE_CLASS, NORMALIZE_PROPS, NORMALIZE_STYLE, OPEN_BLOCK, POP_SCOPE_ID, PUSH_SCOPE_ID, RENDER_LIST, RENDER_SLOT, RESOLVE_COMPONENT, RESOLVE_DIRECTIVE, RESOLVE_DYNAMIC_COMPONENT, RESOLVE_FILTER, SET_BLOCK_TRACKING, SUSPENSE, TELEPORT, TO_DISPLAY_STRING, TO_HANDLERS, TO_HANDLER_KEY, TS_NODE_TYPES, UNREF, WITH_CTX, WITH_DIRECTIVES, WITH_MEMO, advancePositionWithClone, advancePositionWithMutation, assert, baseCompile, baseParse, buildDirectiveArgs, buildProps, buildSlots, checkCompatEnabled, convertToBlock, createArrayExpression, createAssignmentExpression, createBlockStatement, createCacheExpression, createCallExpression, createCompilerError, createCompoundExpression, createConditionalExpression, createForLoopParams, createFunctionExpression, createIfStatement, createInterpolation, createObjectExpression, createObjectProperty, createReturnStatement, createRoot, createSequenceExpression, createSimpleExpression, createStructuralDirectiveTransform, createTemplateLiteral, createTransformContext, createVNodeCall, extractIdentifiers, findDir, findProp, generate, getBaseTransformPreset, getConstantType, getImportedName, getInnerRange, getMemoedVNodeCall, getVNodeBlockHelper, getVNodeHelper, hasDynamicKeyVBind, hasScopeRef, helperNameMap, injectProp, isBuiltInType, isCallOf, isCoreComponent, isFunctionType, isInDestructureAssignment, isMemberExpression, isMemberExpressionBrowser, isMemberExpressionNode, isReferencedIdentifier, isSimpleIdentifier, isSlotOutlet, isStaticArgOf, isStaticExp, isStaticProperty, isStaticPropertyKey, isTemplateNode, isText$1 as isText, isVSlot, locStub, noopDirectiveTransform, processExpression, processFor, processIf, processSlotOutlet, registerRuntimeHelpers, resolveComponentType, stringifyExpression, toValidAssetId, trackSlotScopes, trackVForSlotScopes, transform, transformBind, transformElement, transformExpression, transformModel, transformOn, traverseNode, unwrapTSNode, walkBlockDeclarations, walkFunctionParams, walkIdentifiers, warnDeprecation };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/compiler-core",
3
- "version": "3.3.0-alpha.4",
3
+ "version": "3.3.0-alpha.6",
4
4
  "description": "@vue/compiler-core",
5
5
  "main": "index.js",
6
6
  "module": "dist/compiler-core.esm-bundler.js",
@@ -32,12 +32,12 @@
32
32
  },
33
33
  "homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-core#readme",
34
34
  "dependencies": {
35
- "@vue/shared": "3.3.0-alpha.4",
36
- "@babel/parser": "^7.20.15",
35
+ "@babel/parser": "^7.21.3",
36
+ "@vue/shared": "3.3.0-alpha.6",
37
37
  "estree-walker": "^2.0.2",
38
38
  "source-map": "^0.6.1"
39
39
  },
40
40
  "devDependencies": {
41
- "@babel/types": "^7.16.0"
41
+ "@babel/types": "^7.21.3"
42
42
  }
43
43
  }