@vue/compiler-core 3.6.0-alpha.3 → 3.6.0-alpha.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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-core v3.6.0-alpha.3
2
+ * @vue/compiler-core v3.6.0-alpha.4
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -135,14 +135,6 @@ function registerRuntimeHelpers(helpers) {
135
135
  });
136
136
  }
137
137
 
138
- const Namespaces = {
139
- "HTML": 0,
140
- "0": "HTML",
141
- "SVG": 1,
142
- "1": "SVG",
143
- "MATH_ML": 2,
144
- "2": "MATH_ML"
145
- };
146
138
  const NodeTypes = {
147
139
  "ROOT": 0,
148
140
  "0": "ROOT",
@@ -4662,17 +4654,14 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
4662
4654
  knownIds
4663
4655
  );
4664
4656
  const children = [];
4665
- const isTSNode = TS_NODE_TYPES.includes(ast.type);
4666
4657
  ids.sort((a, b) => a.start - b.start);
4667
4658
  ids.forEach((id, i) => {
4668
4659
  const start = id.start - 1;
4669
4660
  const end = id.end - 1;
4670
4661
  const last = ids[i - 1];
4671
- if (!(isTSNode && i === 0)) {
4672
- const leadingText = rawExp.slice(last ? last.end - 1 : 0, start);
4673
- if (leadingText.length || id.prefix) {
4674
- children.push(leadingText + (id.prefix || ``));
4675
- }
4662
+ const leadingText = rawExp.slice(last ? last.end - 1 : 0, start);
4663
+ if (leadingText.length || id.prefix) {
4664
+ children.push(leadingText + (id.prefix || ``));
4676
4665
  }
4677
4666
  const source = rawExp.slice(start, end);
4678
4667
  children.push(
@@ -4687,7 +4676,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
4687
4676
  id.isConstant ? 3 : 0
4688
4677
  )
4689
4678
  );
4690
- if (i === ids.length - 1 && end < rawExp.length && !isTSNode) {
4679
+ if (i === ids.length - 1 && end < rawExp.length) {
4691
4680
  children.push(rawExp.slice(end));
4692
4681
  }
4693
4682
  });
@@ -6490,7 +6479,7 @@ const transformModel = (dir, node, context) => {
6490
6479
  }
6491
6480
  if (dir.modifiers.length && node.tagType === 1) {
6492
6481
  const modifiers = dir.modifiers.map((m) => m.content).map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `);
6493
- const modifiersKey = arg ? isStaticExp(arg) ? `${arg.content}Modifiers` : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`;
6482
+ const modifiersKey = arg ? isStaticExp(arg) ? shared.getModifierPropName(arg.content) : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`;
6494
6483
  props.push(
6495
6484
  createObjectProperty(
6496
6485
  modifiersKey,
@@ -6817,7 +6806,6 @@ exports.MERGE_PROPS = MERGE_PROPS;
6817
6806
  exports.NORMALIZE_CLASS = NORMALIZE_CLASS;
6818
6807
  exports.NORMALIZE_PROPS = NORMALIZE_PROPS;
6819
6808
  exports.NORMALIZE_STYLE = NORMALIZE_STYLE;
6820
- exports.Namespaces = Namespaces;
6821
6809
  exports.NewlineType = NewlineType;
6822
6810
  exports.NodeTypes = NodeTypes;
6823
6811
  exports.OPEN_BLOCK = OPEN_BLOCK;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-core v3.6.0-alpha.3
2
+ * @vue/compiler-core v3.6.0-alpha.4
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -135,14 +135,6 @@ function registerRuntimeHelpers(helpers) {
135
135
  });
136
136
  }
137
137
 
138
- const Namespaces = {
139
- "HTML": 0,
140
- "0": "HTML",
141
- "SVG": 1,
142
- "1": "SVG",
143
- "MATH_ML": 2,
144
- "2": "MATH_ML"
145
- };
146
138
  const NodeTypes = {
147
139
  "ROOT": 0,
148
140
  "0": "ROOT",
@@ -4586,17 +4578,14 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
4586
4578
  knownIds
4587
4579
  );
4588
4580
  const children = [];
4589
- const isTSNode = TS_NODE_TYPES.includes(ast.type);
4590
4581
  ids.sort((a, b) => a.start - b.start);
4591
4582
  ids.forEach((id, i) => {
4592
4583
  const start = id.start - 1;
4593
4584
  const end = id.end - 1;
4594
4585
  const last = ids[i - 1];
4595
- if (!(isTSNode && i === 0)) {
4596
- const leadingText = rawExp.slice(last ? last.end - 1 : 0, start);
4597
- if (leadingText.length || id.prefix) {
4598
- children.push(leadingText + (id.prefix || ``));
4599
- }
4586
+ const leadingText = rawExp.slice(last ? last.end - 1 : 0, start);
4587
+ if (leadingText.length || id.prefix) {
4588
+ children.push(leadingText + (id.prefix || ``));
4600
4589
  }
4601
4590
  const source = rawExp.slice(start, end);
4602
4591
  children.push(
@@ -4611,7 +4600,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
4611
4600
  id.isConstant ? 3 : 0
4612
4601
  )
4613
4602
  );
4614
- if (i === ids.length - 1 && end < rawExp.length && !isTSNode) {
4603
+ if (i === ids.length - 1 && end < rawExp.length) {
4615
4604
  children.push(rawExp.slice(end));
4616
4605
  }
4617
4606
  });
@@ -6372,7 +6361,7 @@ const transformModel = (dir, node, context) => {
6372
6361
  }
6373
6362
  if (dir.modifiers.length && node.tagType === 1) {
6374
6363
  const modifiers = dir.modifiers.map((m) => m.content).map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `);
6375
- const modifiersKey = arg ? isStaticExp(arg) ? `${arg.content}Modifiers` : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`;
6364
+ const modifiersKey = arg ? isStaticExp(arg) ? shared.getModifierPropName(arg.content) : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`;
6376
6365
  props.push(
6377
6366
  createObjectProperty(
6378
6367
  modifiersKey,
@@ -6694,7 +6683,6 @@ exports.MERGE_PROPS = MERGE_PROPS;
6694
6683
  exports.NORMALIZE_CLASS = NORMALIZE_CLASS;
6695
6684
  exports.NORMALIZE_PROPS = NORMALIZE_PROPS;
6696
6685
  exports.NORMALIZE_STYLE = NORMALIZE_STYLE;
6697
- exports.Namespaces = Namespaces;
6698
6686
  exports.NewlineType = NewlineType;
6699
6687
  exports.NodeTypes = NodeTypes;
6700
6688
  exports.OPEN_BLOCK = OPEN_BLOCK;
@@ -1,4 +1,4 @@
1
- import { PatchFlags } from '@vue/shared';
1
+ import { Namespace, PatchFlags, Namespaces } from '@vue/shared';
2
2
  export { generateCodeFrame } from '@vue/shared';
3
3
  import { Node as Node$1, Identifier, Function, BlockStatement as BlockStatement$1, SwitchCase, Program, ObjectProperty } from '@babel/types';
4
4
  import { ParserPlugin } from '@babel/parser';
@@ -83,8 +83,8 @@ interface DirectiveTransformResult {
83
83
  ssrTagParts?: TemplateLiteral['elements'];
84
84
  }
85
85
  export type StructuralDirectiveTransform = (node: ElementNode, dir: DirectiveNode, context: TransformContext) => void | (() => void);
86
- interface ImportItem {
87
- exp: string | ExpressionNode;
86
+ export interface ImportItem {
87
+ exp: SimpleExpressionNode;
88
88
  path: string;
89
89
  }
90
90
  export interface TransformContext extends Required<Omit<TransformOptions, keyof CompilerCompatOptions>>, CompilerCompatOptions {
@@ -142,12 +142,6 @@ export declare function buildProps(node: ElementNode, context: TransformContext,
142
142
  };
143
143
  export declare function buildDirectiveArgs(dir: DirectiveNode, context: TransformContext): ArrayExpression;
144
144
 
145
- export type Namespace = number;
146
- export declare enum Namespaces {
147
- HTML = 0,
148
- SVG = 1,
149
- MATH_ML = 2
150
- }
151
145
  export declare enum NodeTypes {
152
146
  ROOT = 0,
153
147
  ELEMENT = 1,
@@ -1,9 +1,9 @@
1
1
  /**
2
- * @vue/compiler-core v3.6.0-alpha.3
2
+ * @vue/compiler-core v3.6.0-alpha.4
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
6
- import { isString, NOOP, isObject, extend, NO, isSymbol, PatchFlagNames, isArray, EMPTY_OBJ, capitalize, camelize, makeMap, slotFlagsText, isOn, isBuiltInDirective, isReservedProp, toHandlerKey } from '@vue/shared';
6
+ import { isString, NOOP, isObject, extend, NO, isSymbol, PatchFlagNames, isArray, EMPTY_OBJ, capitalize, camelize, makeMap, slotFlagsText, isOn, isBuiltInDirective, isReservedProp, toHandlerKey, getModifierPropName } from '@vue/shared';
7
7
  export { generateCodeFrame } from '@vue/shared';
8
8
 
9
9
  const FRAGMENT = Symbol(!!(process.env.NODE_ENV !== "production") ? `Fragment` : ``);
@@ -128,14 +128,6 @@ function registerRuntimeHelpers(helpers) {
128
128
  });
129
129
  }
130
130
 
131
- const Namespaces = {
132
- "HTML": 0,
133
- "0": "HTML",
134
- "SVG": 1,
135
- "1": "SVG",
136
- "MATH_ML": 2,
137
- "2": "MATH_ML"
138
- };
139
131
  const NodeTypes = {
140
132
  "ROOT": 0,
141
133
  "0": "ROOT",
@@ -5582,7 +5574,7 @@ const transformModel = (dir, node, context) => {
5582
5574
  ];
5583
5575
  if (dir.modifiers.length && node.tagType === 1) {
5584
5576
  const modifiers = dir.modifiers.map((m) => m.content).map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `);
5585
- const modifiersKey = arg ? isStaticExp(arg) ? `${arg.content}Modifiers` : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`;
5577
+ const modifiersKey = arg ? isStaticExp(arg) ? getModifierPropName(arg.content) : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`;
5586
5578
  props.push(
5587
5579
  createObjectProperty(
5588
5580
  modifiersKey,
@@ -5880,4 +5872,4 @@ const BindingTypes = {
5880
5872
 
5881
5873
  const noopDirectiveTransform = () => ({ props: [] });
5882
5874
 
5883
- 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, NewlineType, 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, 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, defaultOnError, defaultOnWarn, errorMessages, extractIdentifiers, findDir, findProp, forAliasRE, generate, getBaseTransformPreset, getConstantType, getMemoedVNodeCall, getSelfName, getVNodeBlockHelper, getVNodeHelper, hasDynamicKeyVBind, hasScopeRef, helperNameMap, injectProp, isConstantNode, isCoreComponent, isFnExpression, isFnExpressionBrowser, isFnExpressionNode, isFunctionType, isInDestructureAssignment, isInNewExpression, isLiteralWhitelisted, isMemberExpression, isMemberExpressionBrowser, isMemberExpressionNode, isReferencedIdentifier, isSimpleIdentifier, isSlotOutlet, isStaticArgOf, isStaticExp, isStaticNode, isStaticProperty, isStaticPropertyKey, isTemplateNode, isText$1 as isText, isVPre, isVSlot, locStub, noopDirectiveTransform, processExpression, processFor, processIf, processSlotOutlet, registerRuntimeHelpers, resolveComponentType, stringifyExpression, toValidAssetId, trackSlotScopes, trackVForSlotScopes, transform, transformBind, transformElement, transformExpression, transformModel, transformOn, transformVBindShorthand, traverseNode, unwrapTSNode, validFirstIdentCharRE, walkBlockDeclarations, walkFunctionParams, walkIdentifiers, warnDeprecation };
5875
+ 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, NewlineType, 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, 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, defaultOnError, defaultOnWarn, errorMessages, extractIdentifiers, findDir, findProp, forAliasRE, generate, getBaseTransformPreset, getConstantType, getMemoedVNodeCall, getSelfName, getVNodeBlockHelper, getVNodeHelper, hasDynamicKeyVBind, hasScopeRef, helperNameMap, injectProp, isConstantNode, isCoreComponent, isFnExpression, isFnExpressionBrowser, isFnExpressionNode, isFunctionType, isInDestructureAssignment, isInNewExpression, isLiteralWhitelisted, isMemberExpression, isMemberExpressionBrowser, isMemberExpressionNode, isReferencedIdentifier, isSimpleIdentifier, isSlotOutlet, isStaticArgOf, isStaticExp, isStaticNode, isStaticProperty, isStaticPropertyKey, isTemplateNode, isText$1 as isText, isVPre, isVSlot, locStub, noopDirectiveTransform, processExpression, processFor, processIf, processSlotOutlet, registerRuntimeHelpers, resolveComponentType, stringifyExpression, toValidAssetId, trackSlotScopes, trackVForSlotScopes, transform, transformBind, transformElement, transformExpression, transformModel, transformOn, transformVBindShorthand, traverseNode, unwrapTSNode, validFirstIdentCharRE, walkBlockDeclarations, walkFunctionParams, walkIdentifiers, warnDeprecation };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/compiler-core",
3
- "version": "3.6.0-alpha.3",
3
+ "version": "3.6.0-alpha.4",
4
4
  "description": "@vue/compiler-core",
5
5
  "main": "index.js",
6
6
  "module": "dist/compiler-core.esm-bundler.js",
@@ -50,7 +50,7 @@
50
50
  "entities": "^4.5.0",
51
51
  "estree-walker": "^2.0.2",
52
52
  "source-map-js": "^1.2.1",
53
- "@vue/shared": "3.6.0-alpha.3"
53
+ "@vue/shared": "3.6.0-alpha.4"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@babel/types": "^7.28.5"