@vue/compiler-core 3.5.34 → 3.5.36

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.5.34
2
+ * @vue/compiler-core v3.5.36
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2617,7 +2617,7 @@ const tokenizer = new Tokenizer(stack, {
2617
2617
  }
2618
2618
  },
2619
2619
  oncdata(start, end) {
2620
- if (stack[0].ns !== 0) {
2620
+ if ((stack[0] ? stack[0].ns : currentOptions.ns) !== 0) {
2621
2621
  onText(getSlice(start, end), start, end);
2622
2622
  } else {
2623
2623
  emitError(1, start - 9);
@@ -3404,6 +3404,7 @@ function createTransformContext(root, {
3404
3404
  imports: [],
3405
3405
  cached: [],
3406
3406
  constantCache: /* @__PURE__ */ new WeakMap(),
3407
+ vForMemoKeyedNodes: /* @__PURE__ */ new WeakSet(),
3407
3408
  temps: 0,
3408
3409
  identifiers: /* @__PURE__ */ Object.create(null),
3409
3410
  scopes: {
@@ -4463,7 +4464,7 @@ const transformExpression = (node, context) => {
4463
4464
  const exp = dir.exp;
4464
4465
  const arg = dir.arg;
4465
4466
  if (exp && exp.type === 4 && !(dir.name === "on" && arg) && // key has been processed in transformFor(vMemo + vFor)
4466
- !(memo && arg && arg.type === 4 && arg.content === "key")) {
4467
+ !(memo && context.vForMemoKeyedNodes.has(node) && arg && arg.type === 4 && arg.content === "key")) {
4467
4468
  dir.exp = processExpression(
4468
4469
  exp,
4469
4470
  context,
@@ -4907,27 +4908,22 @@ const transformFor = createStructuralDirectiveTransform(
4907
4908
  const keyProp = findProp(node, `key`, false, true);
4908
4909
  const isDirKey = keyProp && keyProp.type === 7;
4909
4910
  let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
4910
- if (memo && keyExp && isDirKey) {
4911
- {
4912
- keyProp.exp = keyExp = processExpression(
4913
- keyExp,
4914
- context
4915
- );
4916
- }
4917
- }
4918
- const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
4919
- if (isTemplate) {
4920
- if (memo) {
4911
+ const keyProperty = keyExp ? createObjectProperty(`key`, keyExp) : null;
4912
+ {
4913
+ if (isTemplate && memo) {
4921
4914
  memo.exp = processExpression(
4922
4915
  memo.exp,
4923
4916
  context
4924
4917
  );
4925
4918
  }
4926
- if (keyProperty && keyProp.type !== 6) {
4927
- keyProperty.value = processExpression(
4919
+ if ((isTemplate || memo) && keyProperty && isDirKey) {
4920
+ keyExp = keyProp.exp = keyProperty.value = processExpression(
4928
4921
  keyProperty.value,
4929
4922
  context
4930
4923
  );
4924
+ if (memo) {
4925
+ context.vForMemoKeyedNodes.add(node);
4926
+ }
4931
4927
  }
4932
4928
  }
4933
4929
  const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-core v3.5.34
2
+ * @vue/compiler-core v3.5.36
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2613,7 +2613,7 @@ const tokenizer = new Tokenizer(stack, {
2613
2613
  }
2614
2614
  },
2615
2615
  oncdata(start, end) {
2616
- if (stack[0].ns !== 0) {
2616
+ if ((stack[0] ? stack[0].ns : currentOptions.ns) !== 0) {
2617
2617
  onText(getSlice(start, end), start, end);
2618
2618
  } else {
2619
2619
  emitError(1, start - 9);
@@ -3363,6 +3363,7 @@ function createTransformContext(root, {
3363
3363
  imports: [],
3364
3364
  cached: [],
3365
3365
  constantCache: /* @__PURE__ */ new WeakMap(),
3366
+ vForMemoKeyedNodes: /* @__PURE__ */ new WeakSet(),
3366
3367
  temps: 0,
3367
3368
  identifiers: /* @__PURE__ */ Object.create(null),
3368
3369
  scopes: {
@@ -4387,7 +4388,7 @@ const transformExpression = (node, context) => {
4387
4388
  const exp = dir.exp;
4388
4389
  const arg = dir.arg;
4389
4390
  if (exp && exp.type === 4 && !(dir.name === "on" && arg) && // key has been processed in transformFor(vMemo + vFor)
4390
- !(memo && arg && arg.type === 4 && arg.content === "key")) {
4391
+ !(memo && context.vForMemoKeyedNodes.has(node) && arg && arg.type === 4 && arg.content === "key")) {
4391
4392
  dir.exp = processExpression(
4392
4393
  exp,
4393
4394
  context,
@@ -4820,27 +4821,22 @@ const transformFor = createStructuralDirectiveTransform(
4820
4821
  const keyProp = findProp(node, `key`, false, true);
4821
4822
  const isDirKey = keyProp && keyProp.type === 7;
4822
4823
  let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
4823
- if (memo && keyExp && isDirKey) {
4824
- {
4825
- keyProp.exp = keyExp = processExpression(
4826
- keyExp,
4827
- context
4828
- );
4829
- }
4830
- }
4831
- const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
4832
- if (isTemplate) {
4833
- if (memo) {
4824
+ const keyProperty = keyExp ? createObjectProperty(`key`, keyExp) : null;
4825
+ {
4826
+ if (isTemplate && memo) {
4834
4827
  memo.exp = processExpression(
4835
4828
  memo.exp,
4836
4829
  context
4837
4830
  );
4838
4831
  }
4839
- if (keyProperty && keyProp.type !== 6) {
4840
- keyProperty.value = processExpression(
4832
+ if ((isTemplate || memo) && keyProperty && isDirKey) {
4833
+ keyExp = keyProp.exp = keyProperty.value = processExpression(
4841
4834
  keyProperty.value,
4842
4835
  context
4843
4836
  );
4837
+ if (memo) {
4838
+ context.vForMemoKeyedNodes.add(node);
4839
+ }
4844
4840
  }
4845
4841
  }
4846
4842
  const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
@@ -122,6 +122,7 @@ export interface TransformContext extends Required<Omit<TransformOptions, keyof
122
122
  hoist(exp: string | JSChildNode | ArrayExpression): SimpleExpressionNode;
123
123
  cache(exp: JSChildNode, isVNode?: boolean, inVOnce?: boolean): CacheExpression;
124
124
  constantCache: WeakMap<TemplateChildNode, ConstantTypes>;
125
+ vForMemoKeyedNodes: WeakSet<ElementNode>;
125
126
  filters?: Set<string>;
126
127
  }
127
128
  export declare function createTransformContext(root: RootNode, { filename, prefixIdentifiers, hoistStatic, hmr, cacheHandlers, nodeTransforms, directiveTransforms, transformHoist, isBuiltInComponent, isCustomElement, expressionPlugins, scopeId, slotted, ssr, inSSR, ssrCssVars, bindingMetadata, inline, isTS, onError, onWarn, compatConfig, }: TransformOptions): TransformContext;
@@ -948,7 +949,7 @@ export type CompilerOptions = ParserOptions & TransformOptions & CodegenOptions;
948
949
  *
949
950
  * Since TS 5.3, dts generation starts to strangely include broken triple slash
950
951
  * references for source-map-js, so we are inlining all source map related types
951
- * here to to workaround that.
952
+ * here to workaround that.
952
953
  */
953
954
  export interface CodegenSourceMapGenerator {
954
955
  setSourceContent(sourceFile: string, sourceContent: string): void;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-core v3.5.34
2
+ * @vue/compiler-core v3.5.36
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2275,7 +2275,7 @@ const tokenizer = new Tokenizer(stack, {
2275
2275
  }
2276
2276
  },
2277
2277
  oncdata(start, end) {
2278
- if (stack[0].ns !== 0) {
2278
+ if ((stack[0] ? stack[0].ns : currentOptions.ns) !== 0) {
2279
2279
  onText(getSlice(start, end), start, end);
2280
2280
  } else {
2281
2281
  emitError(1, start - 9);
@@ -3047,6 +3047,7 @@ function createTransformContext(root, {
3047
3047
  imports: [],
3048
3048
  cached: [],
3049
3049
  constantCache: /* @__PURE__ */ new WeakMap(),
3050
+ vForMemoKeyedNodes: /* @__PURE__ */ new WeakSet(),
3050
3051
  temps: 0,
3051
3052
  identifiers: /* @__PURE__ */ Object.create(null),
3052
3053
  scopes: {
@@ -3914,7 +3915,7 @@ const transformExpression = (node, context) => {
3914
3915
  const exp = dir.exp;
3915
3916
  const arg = dir.arg;
3916
3917
  if (exp && exp.type === 4 && !(dir.name === "on" && arg) && // key has been processed in transformFor(vMemo + vFor)
3917
- !(memo && arg && arg.type === 4 && arg.content === "key")) {
3918
+ !(memo && context.vForMemoKeyedNodes.has(node) && arg && arg.type === 4 && arg.content === "key")) {
3918
3919
  dir.exp = processExpression(
3919
3920
  exp,
3920
3921
  context,
@@ -4177,7 +4178,7 @@ const transformFor = createStructuralDirectiveTransform(
4177
4178
  const keyProp = findProp(node, `key`, false, true);
4178
4179
  keyProp && keyProp.type === 7;
4179
4180
  let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
4180
- const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
4181
+ const keyProperty = keyExp ? createObjectProperty(`key`, keyExp) : null;
4181
4182
  const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
4182
4183
  const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
4183
4184
  forNode.codegenNode = createVNodeCall(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/compiler-core",
3
- "version": "3.5.34",
3
+ "version": "3.5.36",
4
4
  "description": "@vue/compiler-core",
5
5
  "main": "index.js",
6
6
  "module": "dist/compiler-core.esm-bundler.js",
@@ -46,13 +46,13 @@
46
46
  },
47
47
  "homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-core#readme",
48
48
  "dependencies": {
49
- "@babel/parser": "^7.29.3",
49
+ "@babel/parser": "^7.29.7",
50
50
  "entities": "^7.0.1",
51
51
  "estree-walker": "^2.0.2",
52
52
  "source-map-js": "^1.2.1",
53
- "@vue/shared": "3.5.34"
53
+ "@vue/shared": "3.5.36"
54
54
  },
55
55
  "devDependencies": {
56
- "@babel/types": "^7.29.0"
56
+ "@babel/types": "^7.29.7"
57
57
  }
58
58
  }