@dcloudio/uni-cli-shared 3.0.0-5010520260709001 → 3.0.0-5020320260806002

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.
Files changed (29) hide show
  1. package/dist/messages/en.d.ts +1 -0
  2. package/dist/messages/en.js +1 -0
  3. package/dist/messages/index.d.ts +2 -0
  4. package/dist/messages/zh_CN.d.ts +1 -0
  5. package/dist/messages/zh_CN.js +1 -0
  6. package/dist/uts.d.ts +0 -1
  7. package/dist/uts.js +1 -31
  8. package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.cjs.js +11 -9
  9. package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.cjs.prod.js +11 -9
  10. package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.d.ts +13 -1
  11. package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.esm-bundler.js +8 -7
  12. package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.cjs.js +1 -1
  13. package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +1 -1
  14. package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.esm-browser.js +8 -7
  15. package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.esm-browser.prod.js +5 -5
  16. package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js +1 -1
  17. package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.global.js +8 -7
  18. package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.global.prod.js +5 -5
  19. package/lib/dom2/app/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +4772 -1513
  20. package/lib/dom2/app/@vue/compiler-sfc/dist/compiler-sfc.esm-browser.js +3209 -1754
  21. package/lib/dom2/app/@vue/compiler-vapor/dist/compiler-vapor.cjs.js +1471 -395
  22. package/lib/dom2/app/@vue/compiler-vapor/dist/compiler-vapor.d.ts +143 -119
  23. package/lib/dom2/app/@vue/compiler-vapor/dist/compiler-vapor.esm-browser.js +1576 -470
  24. package/lib/dom2/app/@vue/compiler-vapor-dom2/dist/compiler-vapor-dom2.cjs.js +1 -1
  25. package/lib/dom2/app/@vue/shared/dist/shared.cjs.js +77 -2
  26. package/lib/dom2/app/@vue/shared/dist/shared.cjs.prod.js +77 -2
  27. package/lib/dom2/app/@vue/shared/dist/shared.d.ts +89 -2
  28. package/lib/dom2/app/@vue/shared/dist/shared.esm-bundler.js +74 -3
  29. package/package.json +5 -5
@@ -4,6 +4,7 @@ declare const _default: {
4
4
  readonly 'view.render.compiler.target.bytecode': "bytecode";
5
5
  readonly 'view.render.compiler.target.nativecode': "nativecode";
6
6
  readonly 'style.isolation.version': "Style isolation version: {version}";
7
+ readonly 'style.isolation.version.upgrade': "Style isolation version: {version}. Upgrading to 2.0 is recommended.";
7
8
  readonly compiling: "Compiling...";
8
9
  readonly 'dev.performance': "Please note that in running mode, due to log output, sourcemap, and uncompressed source code, the performance and package size are not as good as release mode.";
9
10
  readonly 'dev.performance.nvue': "Especially the sourcemap of app-nvue has a greater impact";
@@ -6,6 +6,7 @@ exports.default = {
6
6
  'view.render.compiler.target.bytecode': 'bytecode',
7
7
  'view.render.compiler.target.nativecode': 'nativecode',
8
8
  'style.isolation.version': 'Style isolation version: {version}',
9
+ 'style.isolation.version.upgrade': 'Style isolation version: {version}. Upgrading to 2.0 is recommended.',
9
10
  compiling: 'Compiling...',
10
11
  'dev.performance': 'Please note that in running mode, due to log output, sourcemap, and uncompressed source code, the performance and package size are not as good as release mode.',
11
12
  'dev.performance.nvue': 'Especially the sourcemap of app-nvue has a greater impact',
@@ -4,6 +4,7 @@ export declare const M: {
4
4
  readonly 'view.render.compiler.target.bytecode': "字节码";
5
5
  readonly 'view.render.compiler.target.nativecode': "机器码";
6
6
  readonly 'style.isolation.version': "当前样式隔离策略:{version}。详见:https://doc.dcloud.net.cn/uni-app-x/css/common/style-isolation.html";
7
+ readonly 'style.isolation.version.upgrade': "当前样式隔离策略:{version}。推荐升级为 2.0。详见:https://doc.dcloud.net.cn/uni-app-x/css/common/style-isolation.html";
7
8
  readonly compiling: "正在编译中...";
8
9
  readonly 'dev.performance': "请注意运行模式下,因日志输出、sourcemap 以及未压缩源码等原因,性能和包体积,均不及发行模式。";
9
10
  readonly 'dev.performance.nvue': "尤其是 app-nvue 的 sourcemap 影响较大";
@@ -63,6 +64,7 @@ export declare const M: {
63
64
  readonly 'view.render.compiler.target.bytecode': "bytecode";
64
65
  readonly 'view.render.compiler.target.nativecode': "nativecode";
65
66
  readonly 'style.isolation.version': "Style isolation version: {version}";
67
+ readonly 'style.isolation.version.upgrade': "Style isolation version: {version}. Upgrading to 2.0 is recommended.";
66
68
  readonly compiling: "Compiling...";
67
69
  readonly 'dev.performance': "Please note that in running mode, due to log output, sourcemap, and uncompressed source code, the performance and package size are not as good as release mode.";
68
70
  readonly 'dev.performance.nvue': "Especially the sourcemap of app-nvue has a greater impact";
@@ -4,6 +4,7 @@ declare const _default: {
4
4
  readonly 'view.render.compiler.target.bytecode': "字节码";
5
5
  readonly 'view.render.compiler.target.nativecode': "机器码";
6
6
  readonly 'style.isolation.version': "当前样式隔离策略:{version}。详见:https://doc.dcloud.net.cn/uni-app-x/css/common/style-isolation.html";
7
+ readonly 'style.isolation.version.upgrade': "当前样式隔离策略:{version}。推荐升级为 2.0。详见:https://doc.dcloud.net.cn/uni-app-x/css/common/style-isolation.html";
7
8
  readonly compiling: "正在编译中...";
8
9
  readonly 'dev.performance': "请注意运行模式下,因日志输出、sourcemap 以及未压缩源码等原因,性能和包体积,均不及发行模式。";
9
10
  readonly 'dev.performance.nvue': "尤其是 app-nvue 的 sourcemap 影响较大";
@@ -6,6 +6,7 @@ exports.default = {
6
6
  'view.render.compiler.target.bytecode': '字节码',
7
7
  'view.render.compiler.target.nativecode': '机器码',
8
8
  'style.isolation.version': '当前样式隔离策略:{version}。详见:https://doc.dcloud.net.cn/uni-app-x/css/common/style-isolation.html',
9
+ 'style.isolation.version.upgrade': '当前样式隔离策略:{version}。推荐升级为 2.0。详见:https://doc.dcloud.net.cn/uni-app-x/css/common/style-isolation.html',
9
10
  compiling: '正在编译中...',
10
11
  'dev.performance': '请注意运行模式下,因日志输出、sourcemap 以及未压缩源码等原因,性能和包体积,均不及发行模式。',
11
12
  'dev.performance.nvue': '尤其是 app-nvue 的 sourcemap 影响较大',
package/dist/uts.d.ts CHANGED
@@ -11,7 +11,6 @@ import type { EasycomMatcher } from './easycom';
11
11
  */
12
12
  export declare function resolveUTSAppModule(platform: typeof process.env.UNI_UTS_PLATFORM, id: string, importer: string, includeUTSSDK?: boolean): string | undefined;
13
13
  export declare function resolveUTSModule(id: string, importer: string, includeUTSSDK?: boolean): string | undefined;
14
- export declare function hasUTSModulePlatformFile(pluginDir: string, platform: typeof process.env.UNI_UTS_PLATFORM): boolean;
15
14
  export declare function resolveUTSCompiler(throwError?: boolean): typeof UTSCompiler;
16
15
  export declare function resolveUTSCompilerVersion(): string;
17
16
  interface UTSComponentMeta {
package/dist/uts.js CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.isUniHelpers = exports.isUTSProxy = exports.tscOutDir = exports.uvueOutDir = exports.genUniExtApiDeclarationFileOnce = exports.initUTSSwiftAutoImportsOnce = exports.initUTSKotlinAutoImportsOnce = exports.resolveUniTypeScript = exports.parseUniExtApiNamespacesJsOnce = exports.parseUniExtApiNamespacesOnce = exports.parseSwiftModuleWithPluginId = exports.parseSwiftPackageWithPluginId = exports.parseKotlinPackageWithPluginId = exports.parseCustomElementExports = exports.initUTSCustomElements = exports.initUTSComponents = exports.parseUTSCustomElement = exports.parseUTSComponent = exports.getUTSCustomElementAutoImports = exports.getUTSComponentAutoImports = exports.getUTSCustomElement = exports.isUTSCustomElement = exports.getUTSPluginCustomElements = exports.getUTSCustomElements = exports.clearUTSCustomElements = exports.isUTSComponent = exports.clearUTSComponents = exports.getUTSCustomElementsExports = exports.resolveUTSCompilerVersion = exports.resolveUTSCompiler = exports.hasUTSModulePlatformFile = exports.resolveUTSModule = exports.resolveUTSAppModule = void 0;
6
+ exports.isUniHelpers = exports.isUTSProxy = exports.tscOutDir = exports.uvueOutDir = exports.genUniExtApiDeclarationFileOnce = exports.initUTSSwiftAutoImportsOnce = exports.initUTSKotlinAutoImportsOnce = exports.resolveUniTypeScript = exports.parseUniExtApiNamespacesJsOnce = exports.parseUniExtApiNamespacesOnce = exports.parseSwiftModuleWithPluginId = exports.parseSwiftPackageWithPluginId = exports.parseKotlinPackageWithPluginId = exports.parseCustomElementExports = exports.initUTSCustomElements = exports.initUTSComponents = exports.parseUTSCustomElement = exports.parseUTSComponent = exports.getUTSCustomElementAutoImports = exports.getUTSComponentAutoImports = exports.getUTSCustomElement = exports.isUTSCustomElement = exports.getUTSPluginCustomElements = exports.getUTSCustomElements = exports.clearUTSCustomElements = exports.isUTSComponent = exports.clearUTSComponents = exports.getUTSCustomElementsExports = exports.resolveUTSCompilerVersion = exports.resolveUTSCompiler = exports.resolveUTSModule = exports.resolveUTSAppModule = void 0;
7
7
  // 重要,该文件编译后的 js 需要同步到 vue2 编译器 uni-cli-shared/lib/uts
8
8
  const fs_extra_1 = __importDefault(require("fs-extra"));
9
9
  const path_1 = __importDefault(require("path"));
@@ -165,36 +165,6 @@ function resolveUTSModule(id, importer, includeUTSSDK = true) {
165
165
  }
166
166
  }
167
167
  exports.resolveUTSModule = resolveUTSModule;
168
- function hasUTSModulePlatformFile(pluginDir, platform) {
169
- const utssdkDir = path_1.default.resolve(pluginDir, 'utssdk');
170
- if (!fs_extra_1.default.existsSync(utssdkDir)) {
171
- return false;
172
- }
173
- // 根目录 index.uts 视为当前平台可复用,和现有 uts 解析逻辑保持一致
174
- if (fs_extra_1.default.existsSync(path_1.default.resolve(utssdkDir, 'index.uts'))) {
175
- return true;
176
- }
177
- if (platform === 'app-harmony') {
178
- if (fs_extra_1.default.existsSync(path_1.default.resolve(utssdkDir, 'app-js', 'index.uts')) ||
179
- resolveUTSFile(path_1.default.resolve(utssdkDir, platform), [
180
- '.uts',
181
- '.vue',
182
- '.uvue',
183
- ])) {
184
- return true;
185
- }
186
- return false;
187
- }
188
- if (platform === 'app-android' || platform === 'app-ios') {
189
- return !!resolveUTSFile(path_1.default.resolve(utssdkDir, platform), [
190
- '.uts',
191
- '.vue',
192
- '.uvue',
193
- ]);
194
- }
195
- return !!resolveUTSFile(path_1.default.resolve(utssdkDir, platform));
196
- }
197
- exports.hasUTSModulePlatformFile = hasUTSModulePlatformFile;
198
168
  function resolveUTSEncryptFile(pluginId, index) {
199
169
  if (!pluginId) {
200
170
  return;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-core v3.6.0-beta.12
2
+ * @vue/compiler-core v3.6.0-beta.17
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2633,7 +2633,7 @@ const tokenizer = new Tokenizer(stack, {
2633
2633
  }
2634
2634
  },
2635
2635
  oncdata(start, end) {
2636
- if (stack[0].ns !== 0) onText(getSlice(start, end), start, end);
2636
+ if ((stack[0] ? stack[0].ns : currentOptions.ns) !== 0) onText(getSlice(start, end), start, end);
2637
2637
  else emitError(1, start - 9);
2638
2638
  },
2639
2639
  onprocessinginstruction(start) {
@@ -3147,7 +3147,7 @@ function getSelfName(filename) {
3147
3147
  }
3148
3148
  function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = _vue_shared.NOOP, isCustomElement = _vue_shared.NOOP, isUserComponent = (element) => {
3149
3149
  return element.tagType === 1;
3150
- }, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = _vue_shared.EMPTY_OBJ, inline = false, isTS = false, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
3150
+ }, 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 }) {
3151
3151
  const context = {
3152
3152
  filename,
3153
3153
  selfName: getSelfName(filename),
@@ -3170,6 +3170,7 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
3170
3170
  bindingMetadata,
3171
3171
  inline,
3172
3172
  isTS,
3173
+ eventDelegation,
3173
3174
  onError,
3174
3175
  onWarn,
3175
3176
  compatConfig,
@@ -3181,6 +3182,7 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
3181
3182
  imports: [],
3182
3183
  cached: [],
3183
3184
  constantCache: /* @__PURE__ */ new WeakMap(),
3185
+ vForMemoKeyedNodes: /* @__PURE__ */ new WeakSet(),
3184
3186
  temps: 0,
3185
3187
  identifiers: Object.create(null),
3186
3188
  identifierScopes: Object.create(null),
@@ -3961,7 +3963,7 @@ const transformExpression = (node, context) => {
3961
3963
  if (dir.type === 7 && dir.name !== "for") {
3962
3964
  const exp = dir.exp;
3963
3965
  const arg = dir.arg;
3964
- 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");
3966
+ 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");
3965
3967
  if (arg && arg.type === 4 && !arg.isStatic) dir.arg = processExpression(arg, context);
3966
3968
  }
3967
3969
  }
@@ -4219,11 +4221,11 @@ const transformFor = createStructuralDirectiveTransform("for", (node, dir, conte
4219
4221
  const keyProp = findProp(node, `key`, false, true);
4220
4222
  const isDirKey = keyProp && keyProp.type === 7;
4221
4223
  let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
4222
- if (memo && keyExp && isDirKey) keyProp.exp = keyExp = processExpression(keyExp, context);
4223
- const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
4224
- if (isTemplate) {
4225
- if (memo) memo.exp = processExpression(memo.exp, context);
4226
- if (keyProperty && keyProp.type !== 6) keyProperty.value = processExpression(keyProperty.value, context);
4224
+ const keyProperty = keyExp ? createObjectProperty(`key`, keyExp) : null;
4225
+ if (isTemplate && memo) memo.exp = processExpression(memo.exp, context);
4226
+ if ((isTemplate || memo) && keyProperty && isDirKey) {
4227
+ keyExp = keyProp.exp = keyProperty.value = processExpression(keyProperty.value, context);
4228
+ if (memo) context.vForMemoKeyedNodes.add(node);
4227
4229
  }
4228
4230
  const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
4229
4231
  const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-core v3.6.0-beta.12
2
+ * @vue/compiler-core v3.6.0-beta.17
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2629,7 +2629,7 @@ const tokenizer = new Tokenizer(stack, {
2629
2629
  }
2630
2630
  },
2631
2631
  oncdata(start, end) {
2632
- if (stack[0].ns !== 0) onText(getSlice(start, end), start, end);
2632
+ if ((stack[0] ? stack[0].ns : currentOptions.ns) !== 0) onText(getSlice(start, end), start, end);
2633
2633
  else emitError(1, start - 9);
2634
2634
  },
2635
2635
  onprocessinginstruction(start) {
@@ -3126,7 +3126,7 @@ function getSelfName(filename) {
3126
3126
  }
3127
3127
  function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = _vue_shared.NOOP, isCustomElement = _vue_shared.NOOP, isUserComponent = (element) => {
3128
3128
  return element.tagType === 1;
3129
- }, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = _vue_shared.EMPTY_OBJ, inline = false, isTS = false, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
3129
+ }, 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 }) {
3130
3130
  const context = {
3131
3131
  filename,
3132
3132
  selfName: getSelfName(filename),
@@ -3149,6 +3149,7 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
3149
3149
  bindingMetadata,
3150
3150
  inline,
3151
3151
  isTS,
3152
+ eventDelegation,
3152
3153
  onError,
3153
3154
  onWarn,
3154
3155
  compatConfig,
@@ -3160,6 +3161,7 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
3160
3161
  imports: [],
3161
3162
  cached: [],
3162
3163
  constantCache: /* @__PURE__ */ new WeakMap(),
3164
+ vForMemoKeyedNodes: /* @__PURE__ */ new WeakSet(),
3163
3165
  temps: 0,
3164
3166
  identifiers: Object.create(null),
3165
3167
  identifierScopes: Object.create(null),
@@ -3926,7 +3928,7 @@ const transformExpression = (node, context) => {
3926
3928
  if (dir.type === 7 && dir.name !== "for") {
3927
3929
  const exp = dir.exp;
3928
3930
  const arg = dir.arg;
3929
- 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");
3931
+ 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");
3930
3932
  if (arg && arg.type === 4 && !arg.isStatic) dir.arg = processExpression(arg, context);
3931
3933
  }
3932
3934
  }
@@ -4177,11 +4179,11 @@ const transformFor = createStructuralDirectiveTransform("for", (node, dir, conte
4177
4179
  const keyProp = findProp(node, `key`, false, true);
4178
4180
  const isDirKey = keyProp && keyProp.type === 7;
4179
4181
  let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
4180
- if (memo && keyExp && isDirKey) keyProp.exp = keyExp = processExpression(keyExp, context);
4181
- const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
4182
- if (isTemplate) {
4183
- if (memo) memo.exp = processExpression(memo.exp, context);
4184
- if (keyProperty && keyProp.type !== 6) keyProperty.value = processExpression(keyProperty.value, context);
4182
+ const keyProperty = keyExp ? createObjectProperty(`key`, keyExp) : null;
4183
+ if (isTemplate && memo) memo.exp = processExpression(memo.exp, context);
4184
+ if ((isTemplate || memo) && keyProperty && isDirKey) {
4185
+ keyExp = keyProp.exp = keyProperty.value = processExpression(keyProperty.value, context);
4186
+ if (memo) context.vForMemoKeyedNodes.add(node);
4185
4187
  }
4186
4188
  const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
4187
4189
  const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
@@ -137,6 +137,7 @@ export interface TransformContext extends Required<Omit<TransformOptions, keyof
137
137
  hoist(exp: string | JSChildNode | ArrayExpression): SimpleExpressionNode;
138
138
  cache(exp: JSChildNode, isVNode?: boolean, inVOnce?: boolean): CacheExpression;
139
139
  constantCache: WeakMap<TemplateChildNode, ConstantTypes>;
140
+ vForMemoKeyedNodes: WeakSet<ElementNode>;
140
141
  filters?: Set<string>;
141
142
  }
142
143
  export declare function getSelfName(filename: string): string | null;
@@ -161,6 +162,7 @@ export declare function createTransformContext(root: RootNode, {
161
162
  bindingMetadata,
162
163
  inline,
163
164
  isTS,
165
+ eventDelegation,
164
166
  onError,
165
167
  onWarn,
166
168
  compatConfig
@@ -262,6 +264,10 @@ export interface BaseElementNode extends Node {
262
264
  children: TemplateChildNode[];
263
265
  isSelfClosing?: boolean;
264
266
  innerLoc?: SourceLocation;
267
+ /**
268
+ * fixed by uts DOM2 编译期 flatten 静态值。
269
+ */
270
+ flatten?: boolean;
265
271
  }
266
272
  export interface PlainElementNode extends BaseElementNode {
267
273
  tagType: ElementTypes.ELEMENT;
@@ -951,6 +957,12 @@ export interface TransformOptions extends SharedTransformCodegenOptions, ErrorHa
951
957
  * correctly, e.g. #6938, #7138
952
958
  */
953
959
  hmr?: boolean;
960
+ /**
961
+ * Vapor only: control whether eligible static DOM events are compiled to
962
+ * document-level delegated events.
963
+ * @default true
964
+ */
965
+ eventDelegation?: boolean;
954
966
  }
955
967
  export interface CodegenOptions extends SharedTransformCodegenOptions {
956
968
  /**
@@ -1005,7 +1017,7 @@ export type CompilerOptions = ParserOptions & TransformOptions & CodegenOptions;
1005
1017
  *
1006
1018
  * Since TS 5.3, dts generation starts to strangely include broken triple slash
1007
1019
  * references for source-map-js, so we are inlining all source map related types
1008
- * here to to workaround that.
1020
+ * here to workaround that.
1009
1021
  */
1010
1022
  export interface CodegenSourceMapGenerator {
1011
1023
  setSourceContent(sourceFile: string, sourceContent: string): void;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-core v3.6.0-beta.12
2
+ * @vue/compiler-core v3.6.0-beta.17
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1980,7 +1980,7 @@ const tokenizer = new Tokenizer(stack, {
1980
1980
  }
1981
1981
  },
1982
1982
  oncdata(start, end) {
1983
- if (stack[0].ns !== 0) onText(getSlice(start, end), start, end);
1983
+ if ((stack[0] ? stack[0].ns : currentOptions.ns) !== 0) onText(getSlice(start, end), start, end);
1984
1984
  else emitError(1, start - 9);
1985
1985
  },
1986
1986
  onprocessinginstruction(start) {
@@ -2485,7 +2485,7 @@ function getSelfName(filename) {
2485
2485
  }
2486
2486
  function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, isUserComponent = (element) => {
2487
2487
  return element.tagType === 1;
2488
- }, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
2488
+ }, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, eventDelegation = true, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
2489
2489
  const context = {
2490
2490
  filename,
2491
2491
  selfName: getSelfName(filename),
@@ -2508,6 +2508,7 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
2508
2508
  bindingMetadata,
2509
2509
  inline,
2510
2510
  isTS,
2511
+ eventDelegation,
2511
2512
  onError,
2512
2513
  onWarn,
2513
2514
  compatConfig,
@@ -2519,6 +2520,7 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
2519
2520
  imports: [],
2520
2521
  cached: [],
2521
2522
  constantCache: /* @__PURE__ */ new WeakMap(),
2523
+ vForMemoKeyedNodes: /* @__PURE__ */ new WeakSet(),
2522
2524
  temps: 0,
2523
2525
  identifiers: Object.create(null),
2524
2526
  identifierScopes: Object.create(null),
@@ -3165,7 +3167,7 @@ const transformExpression = (node, context) => {
3165
3167
  if (dir.type === 7 && dir.name !== "for") {
3166
3168
  const exp = dir.exp;
3167
3169
  const arg = dir.arg;
3168
- 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");
3170
+ 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");
3169
3171
  if (arg && arg.type === 4 && !arg.isStatic) dir.arg = processExpression(arg, context);
3170
3172
  }
3171
3173
  }
@@ -3311,10 +3313,9 @@ const transformFor = createStructuralDirectiveTransform("for", (node, dir, conte
3311
3313
  const isTemplate = isTemplateNode(node);
3312
3314
  const memo = findDir(node, "memo");
3313
3315
  const keyProp = findProp(node, `key`, false, true);
3314
- const isDirKey = keyProp && keyProp.type === 7;
3316
+ keyProp && keyProp.type;
3315
3317
  let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
3316
- if (memo && keyExp && isDirKey) {}
3317
- const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
3318
+ const keyProperty = keyExp ? createObjectProperty(`key`, keyExp) : null;
3318
3319
  const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
3319
3320
  const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
3320
3321
  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-dom v3.6.0-beta.12
2
+ * @vue/compiler-dom v3.6.0-beta.17
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-dom v3.6.0-beta.12
2
+ * @vue/compiler-dom v3.6.0-beta.17
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-dom v3.6.0-beta.12
2
+ * @vue/compiler-dom v3.6.0-beta.17
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2152,7 +2152,7 @@ const tokenizer = new Tokenizer(stack, {
2152
2152
  }
2153
2153
  },
2154
2154
  oncdata(start, end) {
2155
- if (stack[0].ns !== 0) onText(getSlice(start, end), start, end);
2155
+ if ((stack[0] ? stack[0].ns : currentOptions.ns) !== 0) onText(getSlice(start, end), start, end);
2156
2156
  else emitError(1, start - 9);
2157
2157
  },
2158
2158
  onprocessinginstruction(start) {
@@ -2653,7 +2653,7 @@ function getSelfName(filename) {
2653
2653
  }
2654
2654
  function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, isUserComponent = (element) => {
2655
2655
  return element.tagType === 1;
2656
- }, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
2656
+ }, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, eventDelegation = true, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
2657
2657
  const context = {
2658
2658
  filename,
2659
2659
  selfName: getSelfName(filename),
@@ -2676,6 +2676,7 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
2676
2676
  bindingMetadata,
2677
2677
  inline,
2678
2678
  isTS,
2679
+ eventDelegation,
2679
2680
  onError,
2680
2681
  onWarn,
2681
2682
  compatConfig,
@@ -2687,6 +2688,7 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
2687
2688
  imports: [],
2688
2689
  cached: [],
2689
2690
  constantCache: /* @__PURE__ */ new WeakMap(),
2691
+ vForMemoKeyedNodes: /* @__PURE__ */ new WeakSet(),
2690
2692
  temps: 0,
2691
2693
  identifiers: Object.create(null),
2692
2694
  identifierScopes: Object.create(null),
@@ -3328,7 +3330,7 @@ const transformExpression = (node, context) => {
3328
3330
  if (dir.type === 7 && dir.name !== "for") {
3329
3331
  const exp = dir.exp;
3330
3332
  const arg = dir.arg;
3331
- 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");
3333
+ 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");
3332
3334
  if (arg && arg.type === 4 && !arg.isStatic) dir.arg = processExpression(arg, context);
3333
3335
  }
3334
3336
  }
@@ -3474,10 +3476,9 @@ const transformFor = createStructuralDirectiveTransform("for", (node, dir, conte
3474
3476
  const isTemplate = isTemplateNode(node);
3475
3477
  const memo = findDir(node, "memo");
3476
3478
  const keyProp = findProp(node, `key`, false, true);
3477
- const isDirKey = keyProp && keyProp.type === 7;
3479
+ keyProp && keyProp.type;
3478
3480
  let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
3479
- if (memo && keyExp && isDirKey) {}
3480
- const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
3481
+ const keyProperty = keyExp ? createObjectProperty(`key`, keyExp) : null;
3481
3482
  const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
3482
3483
  const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
3483
3484
  forNode.codegenNode = createVNodeCall(context, helper(FRAGMENT), void 0, renderExp, fragmentFlag, void 0, void 0, true, !isStableFragment, false, node.loc);