@vue/compiler-core 3.5.35 → 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.35
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,
@@ -4920,6 +4921,9 @@ const transformFor = createStructuralDirectiveTransform(
4920
4921
  keyProperty.value,
4921
4922
  context
4922
4923
  );
4924
+ if (memo) {
4925
+ context.vForMemoKeyedNodes.add(node);
4926
+ }
4923
4927
  }
4924
4928
  }
4925
4929
  const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-core v3.5.35
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,
@@ -4833,6 +4834,9 @@ const transformFor = createStructuralDirectiveTransform(
4833
4834
  keyProperty.value,
4834
4835
  context
4835
4836
  );
4837
+ if (memo) {
4838
+ context.vForMemoKeyedNodes.add(node);
4839
+ }
4836
4840
  }
4837
4841
  }
4838
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;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-core v3.5.35
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/compiler-core",
3
- "version": "3.5.35",
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.35"
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
  }