@vue/compiler-core 3.6.0-beta.13 → 3.6.0-beta.15

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-beta.13
2
+ * @vue/compiler-core v3.6.0-beta.15
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2636,7 +2636,7 @@ const tokenizer = new Tokenizer(stack, {
2636
2636
  }
2637
2637
  },
2638
2638
  oncdata(start, end) {
2639
- if (stack[0].ns !== 0) onText(getSlice(start, end), start, end);
2639
+ if ((stack[0] ? stack[0].ns : currentOptions.ns) !== 0) onText(getSlice(start, end), start, end);
2640
2640
  else emitError(1, start - 9);
2641
2641
  },
2642
2642
  onprocessinginstruction(start) {
@@ -3141,7 +3141,7 @@ function getSelfName(filename) {
3141
3141
  const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/);
3142
3142
  return nameMatch ? (0, _vue_shared.capitalize)((0, _vue_shared.camelize)(nameMatch[1])) : null;
3143
3143
  }
3144
- function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = _vue_shared.NOOP, isCustomElement = _vue_shared.NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = _vue_shared.EMPTY_OBJ, inline = false, isTS = false, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
3144
+ function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = _vue_shared.NOOP, isCustomElement = _vue_shared.NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = _vue_shared.EMPTY_OBJ, inline = false, isTS = false, eventDelegation = true, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
3145
3145
  const context = {
3146
3146
  filename,
3147
3147
  selfName: getSelfName(filename),
@@ -3163,6 +3163,7 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
3163
3163
  bindingMetadata,
3164
3164
  inline,
3165
3165
  isTS,
3166
+ eventDelegation,
3166
3167
  onError,
3167
3168
  onWarn,
3168
3169
  compatConfig,
@@ -3174,6 +3175,7 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
3174
3175
  imports: [],
3175
3176
  cached: [],
3176
3177
  constantCache: /* @__PURE__ */ new WeakMap(),
3178
+ vForMemoKeyedNodes: /* @__PURE__ */ new WeakSet(),
3177
3179
  temps: 0,
3178
3180
  identifiers: Object.create(null),
3179
3181
  identifierScopes: Object.create(null),
@@ -3954,7 +3956,7 @@ const transformExpression = (node, context) => {
3954
3956
  if (dir.type === 7 && dir.name !== "for") {
3955
3957
  const exp = dir.exp;
3956
3958
  const arg = dir.arg;
3957
- if (exp && exp.type === 4 && !(dir.name === "on" && arg) && !(memo && arg && arg.type === 4 && arg.content === "key")) dir.exp = processExpression(exp, context, dir.name === "slot");
3959
+ if (exp && exp.type === 4 && !(dir.name === "on" && arg) && !(memo && context.vForMemoKeyedNodes.has(node) && arg && arg.type === 4 && arg.content === "key")) dir.exp = processExpression(exp, context, dir.name === "slot");
3958
3960
  if (arg && arg.type === 4 && !arg.isStatic) dir.arg = processExpression(arg, context);
3959
3961
  }
3960
3962
  }
@@ -4214,7 +4216,10 @@ const transformFor = createStructuralDirectiveTransform("for", (node, dir, conte
4214
4216
  let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
4215
4217
  const keyProperty = keyExp ? createObjectProperty(`key`, keyExp) : null;
4216
4218
  if (isTemplate && memo) memo.exp = processExpression(memo.exp, context);
4217
- if ((isTemplate || memo) && keyProperty && isDirKey) keyExp = keyProp.exp = keyProperty.value = processExpression(keyProperty.value, context);
4219
+ if ((isTemplate || memo) && keyProperty && isDirKey) {
4220
+ keyExp = keyProp.exp = keyProperty.value = processExpression(keyProperty.value, context);
4221
+ if (memo) context.vForMemoKeyedNodes.add(node);
4222
+ }
4218
4223
  const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
4219
4224
  const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
4220
4225
  forNode.codegenNode = createVNodeCall(context, helper(FRAGMENT), void 0, renderExp, fragmentFlag, void 0, void 0, true, !isStableFragment, false, node.loc);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-core v3.6.0-beta.13
2
+ * @vue/compiler-core v3.6.0-beta.15
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2632,7 +2632,7 @@ const tokenizer = new Tokenizer(stack, {
2632
2632
  }
2633
2633
  },
2634
2634
  oncdata(start, end) {
2635
- if (stack[0].ns !== 0) onText(getSlice(start, end), start, end);
2635
+ if ((stack[0] ? stack[0].ns : currentOptions.ns) !== 0) onText(getSlice(start, end), start, end);
2636
2636
  else emitError(1, start - 9);
2637
2637
  },
2638
2638
  onprocessinginstruction(start) {
@@ -3120,7 +3120,7 @@ function getSelfName(filename) {
3120
3120
  const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/);
3121
3121
  return nameMatch ? (0, _vue_shared.capitalize)((0, _vue_shared.camelize)(nameMatch[1])) : null;
3122
3122
  }
3123
- function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = _vue_shared.NOOP, isCustomElement = _vue_shared.NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = _vue_shared.EMPTY_OBJ, inline = false, isTS = false, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
3123
+ function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = _vue_shared.NOOP, isCustomElement = _vue_shared.NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = _vue_shared.EMPTY_OBJ, inline = false, isTS = false, eventDelegation = true, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
3124
3124
  const context = {
3125
3125
  filename,
3126
3126
  selfName: getSelfName(filename),
@@ -3142,6 +3142,7 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
3142
3142
  bindingMetadata,
3143
3143
  inline,
3144
3144
  isTS,
3145
+ eventDelegation,
3145
3146
  onError,
3146
3147
  onWarn,
3147
3148
  compatConfig,
@@ -3153,6 +3154,7 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
3153
3154
  imports: [],
3154
3155
  cached: [],
3155
3156
  constantCache: /* @__PURE__ */ new WeakMap(),
3157
+ vForMemoKeyedNodes: /* @__PURE__ */ new WeakSet(),
3156
3158
  temps: 0,
3157
3159
  identifiers: Object.create(null),
3158
3160
  identifierScopes: Object.create(null),
@@ -3919,7 +3921,7 @@ const transformExpression = (node, context) => {
3919
3921
  if (dir.type === 7 && dir.name !== "for") {
3920
3922
  const exp = dir.exp;
3921
3923
  const arg = dir.arg;
3922
- if (exp && exp.type === 4 && !(dir.name === "on" && arg) && !(memo && arg && arg.type === 4 && arg.content === "key")) dir.exp = processExpression(exp, context, dir.name === "slot");
3924
+ if (exp && exp.type === 4 && !(dir.name === "on" && arg) && !(memo && context.vForMemoKeyedNodes.has(node) && arg && arg.type === 4 && arg.content === "key")) dir.exp = processExpression(exp, context, dir.name === "slot");
3923
3925
  if (arg && arg.type === 4 && !arg.isStatic) dir.arg = processExpression(arg, context);
3924
3926
  }
3925
3927
  }
@@ -4172,7 +4174,10 @@ const transformFor = createStructuralDirectiveTransform("for", (node, dir, conte
4172
4174
  let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
4173
4175
  const keyProperty = keyExp ? createObjectProperty(`key`, keyExp) : null;
4174
4176
  if (isTemplate && memo) memo.exp = processExpression(memo.exp, context);
4175
- if ((isTemplate || memo) && keyProperty && isDirKey) keyExp = keyProp.exp = keyProperty.value = processExpression(keyProperty.value, context);
4177
+ if ((isTemplate || memo) && keyProperty && isDirKey) {
4178
+ keyExp = keyProp.exp = keyProperty.value = processExpression(keyProperty.value, context);
4179
+ if (memo) context.vForMemoKeyedNodes.add(node);
4180
+ }
4176
4181
  const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
4177
4182
  const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
4178
4183
  forNode.codegenNode = createVNodeCall(context, helper(FRAGMENT), void 0, renderExp, fragmentFlag, void 0, void 0, true, !isStableFragment, false, node.loc);
@@ -130,6 +130,7 @@ export interface TransformContext extends Required<Omit<TransformOptions, keyof
130
130
  hoist(exp: string | JSChildNode | ArrayExpression): SimpleExpressionNode;
131
131
  cache(exp: JSChildNode, isVNode?: boolean, inVOnce?: boolean): CacheExpression;
132
132
  constantCache: WeakMap<TemplateChildNode, ConstantTypes>;
133
+ vForMemoKeyedNodes: WeakSet<ElementNode>;
133
134
  filters?: Set<string>;
134
135
  }
135
136
  export declare function getSelfName(filename: string): string | null;
@@ -153,6 +154,7 @@ export declare function createTransformContext(root: RootNode, {
153
154
  bindingMetadata,
154
155
  inline,
155
156
  isTS,
157
+ eventDelegation,
156
158
  onError,
157
159
  onWarn,
158
160
  compatConfig
@@ -927,6 +929,12 @@ export interface TransformOptions extends SharedTransformCodegenOptions, ErrorHa
927
929
  * correctly, e.g. #6938, #7138
928
930
  */
929
931
  hmr?: boolean;
932
+ /**
933
+ * Vapor only: control whether eligible static DOM events are compiled to
934
+ * document-level delegated events.
935
+ * @default true
936
+ */
937
+ eventDelegation?: boolean;
930
938
  }
931
939
  export interface CodegenOptions extends SharedTransformCodegenOptions {
932
940
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-core v3.6.0-beta.13
2
+ * @vue/compiler-core v3.6.0-beta.15
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1983,7 +1983,7 @@ const tokenizer = new Tokenizer(stack, {
1983
1983
  }
1984
1984
  },
1985
1985
  oncdata(start, end) {
1986
- if (stack[0].ns !== 0) onText(getSlice(start, end), start, end);
1986
+ if ((stack[0] ? stack[0].ns : currentOptions.ns) !== 0) onText(getSlice(start, end), start, end);
1987
1987
  else emitError(1, start - 9);
1988
1988
  },
1989
1989
  onprocessinginstruction(start) {
@@ -2479,7 +2479,7 @@ function getSelfName(filename) {
2479
2479
  const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/);
2480
2480
  return nameMatch ? capitalize(camelize(nameMatch[1])) : null;
2481
2481
  }
2482
- function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
2482
+ function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, eventDelegation = true, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
2483
2483
  const context = {
2484
2484
  filename,
2485
2485
  selfName: getSelfName(filename),
@@ -2501,6 +2501,7 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
2501
2501
  bindingMetadata,
2502
2502
  inline,
2503
2503
  isTS,
2504
+ eventDelegation,
2504
2505
  onError,
2505
2506
  onWarn,
2506
2507
  compatConfig,
@@ -2512,6 +2513,7 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
2512
2513
  imports: [],
2513
2514
  cached: [],
2514
2515
  constantCache: /* @__PURE__ */ new WeakMap(),
2516
+ vForMemoKeyedNodes: /* @__PURE__ */ new WeakSet(),
2515
2517
  temps: 0,
2516
2518
  identifiers: Object.create(null),
2517
2519
  identifierScopes: Object.create(null),
@@ -3158,7 +3160,7 @@ const transformExpression = (node, context) => {
3158
3160
  if (dir.type === 7 && dir.name !== "for") {
3159
3161
  const exp = dir.exp;
3160
3162
  const arg = dir.arg;
3161
- if (exp && exp.type === 4 && !(dir.name === "on" && arg) && !(memo && arg && arg.type === 4 && arg.content === "key")) dir.exp = processExpression(exp, context, dir.name === "slot");
3163
+ if (exp && exp.type === 4 && !(dir.name === "on" && arg) && !(memo && context.vForMemoKeyedNodes.has(node) && arg && arg.type === 4 && arg.content === "key")) dir.exp = processExpression(exp, context, dir.name === "slot");
3162
3164
  if (arg && arg.type === 4 && !arg.isStatic) dir.arg = processExpression(arg, context);
3163
3165
  }
3164
3166
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/compiler-core",
3
- "version": "3.6.0-beta.13",
3
+ "version": "3.6.0-beta.15",
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.6.0-beta.13"
53
+ "@vue/shared": "3.6.0-beta.15"
54
54
  },
55
55
  "devDependencies": {
56
- "@babel/types": "^7.29.0"
56
+ "@babel/types": "^7.29.7"
57
57
  }
58
58
  }