@vue/compat 3.6.0-beta.14 → 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.
package/README.md CHANGED
@@ -18,7 +18,7 @@ While we've tried hard to make the migration build mimic Vue 2 behavior as much
18
18
 
19
19
  - Internet Explorer 11 support: [Vue 3 has officially dropped the plan for IE11 support](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0038-vue3-ie11-support.md). If you still need to support IE11 or below, you will have to stay on Vue 2.
20
20
 
21
- - Server-side rendering: the migration build can be used for SSR, but migrating a custom SSR setup is much more involved. The general idea is replacing `vue-server-renderer` with [`@vue/server-renderer`](https://github.com/vuejs/core/tree/main/packages/server-renderer). Vue 3 no longer provides a bundle renderer and it is recommended to use Vue 3 SSR with [Vite](https://vitejs.dev/guide/ssr.html). If you are using [Nuxt.js](https://nuxtjs.org/), it is probably better to wait for Nuxt 3.
21
+ - Server-side rendering: the migration build can be used for SSR, but migrating a custom SSR setup is much more involved. The general idea is replacing `vue-server-renderer` with [`@vue/server-renderer`](https://github.com/vuejs/core/tree/main/packages/server-renderer). Vue 3 no longer provides a bundle renderer and it is recommended to use Vue 3 SSR with [Vite](https://vite.dev/guide/ssr). If you are using [Nuxt.js](https://nuxtjs.org/), it is probably better to wait for Nuxt 3.
22
22
 
23
23
  ### Expectations
24
24
 
@@ -43,7 +43,7 @@ The following workflow walks through the steps of migrating an actual Vue 2 app
43
43
  1. Upgrade tooling if applicable.
44
44
  - If using custom webpack setup: Upgrade `vue-loader` to `^16.0.0`.
45
45
  - If using `vue-cli`: upgrade to the latest `@vue/cli-service` with `vue upgrade`
46
- - (Alternative) migrate to [Vite](https://vitejs.dev/) + [vite-plugin-vue2](https://github.com/underfin/vite-plugin-vue2). [[Example commit](https://github.com/vuejs/vue-hackernews-2.0/commit/565b948919eb58f22a32afca7e321b490cb3b074)]
46
+ - (Alternative) migrate to [Vite](https://vite.dev/) + [vite-plugin-vue2](https://github.com/underfin/vite-plugin-vue2). [[Example commit](https://github.com/vuejs/vue-hackernews-2.0/commit/565b948919eb58f22a32afca7e321b490cb3b074)]
47
47
 
48
48
  2. In `package.json`, update `vue` to 3.1, install `@vue/compat` of the same version, and replace `vue-template-compiler` (if present) with `@vue/compiler-sfc`:
49
49
 
package/dist/vue.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.6.0-beta.14
2
+ * @vue/compat v3.6.0-beta.15
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2291,8 +2291,9 @@ var WatcherEffect = class extends ReactiveEffect {
2291
2291
  if (once && cb) {
2292
2292
  const _cb = cb;
2293
2293
  cb = (...args) => {
2294
- _cb(...args);
2294
+ const res = _cb(...args);
2295
2295
  this.stop();
2296
+ return res;
2296
2297
  };
2297
2298
  }
2298
2299
  this.cb = cb;
@@ -2306,7 +2307,7 @@ var WatcherEffect = class extends ReactiveEffect {
2306
2307
  if (!this.cb) return;
2307
2308
  const { immediate, deep, call } = this.options;
2308
2309
  if (initialRun && !immediate) return;
2309
- if (deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2310
+ if (initialRun || deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2310
2311
  cleanup(this);
2311
2312
  const currentWatcher = activeWatcher;
2312
2313
  activeWatcher = this;
@@ -4732,11 +4733,16 @@ function defineAsyncComponent(source) {
4732
4733
  onError(err);
4733
4734
  return () => errorComponent ? createVNode(errorComponent, { error: err }) : null;
4734
4735
  });
4735
- const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError);
4736
+ const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError, instance);
4736
4737
  load().then(() => {
4738
+ if (instance.isUnmounted) return;
4737
4739
  loaded.value = true;
4738
4740
  if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) instance.parent.update();
4739
4741
  }).catch((err) => {
4742
+ if (instance.isUnmounted) {
4743
+ setPendingRequest(null);
4744
+ return;
4745
+ }
4740
4746
  onError(err);
4741
4747
  error.value = err;
4742
4748
  });
@@ -4794,14 +4800,22 @@ function createAsyncComponentContext(source) {
4794
4800
  setPendingRequest: (request) => pendingRequest = request
4795
4801
  };
4796
4802
  }
4797
- const useAsyncComponentState = (delay, timeout, onError) => {
4803
+ const useAsyncComponentState = (delay, timeout, onError, instance = currentInstance) => {
4798
4804
  const loaded = /* @__PURE__ */ ref(false);
4799
4805
  const error = /* @__PURE__ */ ref();
4800
4806
  const delayed = /* @__PURE__ */ ref(!!delay);
4801
- if (delay) setTimeout(() => {
4807
+ let timeoutTimer;
4808
+ let delayTimer;
4809
+ if (instance) onUnmounted(() => {
4810
+ if (timeoutTimer != null) clearTimeout(timeoutTimer);
4811
+ if (delayTimer != null) clearTimeout(delayTimer);
4812
+ }, instance);
4813
+ if (delay) delayTimer = setTimeout(() => {
4814
+ if (instance && instance.isUnmounted) return;
4802
4815
  delayed.value = false;
4803
4816
  }, delay);
4804
- if (timeout != null) setTimeout(() => {
4817
+ if (timeout != null) timeoutTimer = setTimeout(() => {
4818
+ if (instance && instance.isUnmounted) return;
4805
4819
  if (!loaded.value && !error.value) {
4806
4820
  const err = /* @__PURE__ */ new Error(`Async component timed out after ${timeout}ms.`);
4807
4821
  onError(err);
@@ -6361,7 +6375,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6361
6375
  if (options.el) return vm.$mount(options.el);
6362
6376
  else return vm;
6363
6377
  }
6364
- Vue.version = `2.6.14-compat:3.6.0-beta.14`;
6378
+ Vue.version = `2.6.14-compat:3.6.0-beta.15`;
6365
6379
  Vue.config = singletonApp.config;
6366
6380
  Vue.use = (plugin, ...options) => {
6367
6381
  if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
@@ -6616,7 +6630,9 @@ function defineReactive(obj, key, val) {
6616
6630
  else Object.keys(val).forEach((key) => {
6617
6631
  try {
6618
6632
  defineReactiveSimple(val, key, val[key]);
6619
- } catch (e) {}
6633
+ } catch (e) {
6634
+ warn$1(`Failed making property "${key}" reactive:`, e);
6635
+ }
6620
6636
  });
6621
6637
  }
6622
6638
  const i = obj.$;
@@ -6861,12 +6877,13 @@ function useModel(props, name, options = EMPTY_OBJ) {
6861
6877
  for (const key of rawPropKeys) if (key === name || key === camelizedName || key === hyphenatedName) parentPassedModelValue = true;
6862
6878
  else if (key === `onUpdate:${name}` || key === `onUpdate:${camelizedName}` || key === `onUpdate:${hyphenatedName}`) parentPassedModelUpdater = true;
6863
6879
  }
6864
- if (!parentPassedModelValue || !parentPassedModelUpdater) {
6880
+ const hasVModel = parentPassedModelValue && parentPassedModelUpdater;
6881
+ if (!hasVModel) {
6865
6882
  localValue = value;
6866
6883
  trigger();
6867
6884
  }
6868
6885
  i.emit(`update:${name}`, emittedValue);
6869
- if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) trigger();
6886
+ if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) trigger();
6870
6887
  prevSetValue = value;
6871
6888
  prevEmittedValue = emittedValue;
6872
6889
  }
@@ -9831,7 +9848,7 @@ function isMemoSame(cached, memo) {
9831
9848
  }
9832
9849
  //#endregion
9833
9850
  //#region packages/runtime-core/src/index.ts
9834
- const version = "3.6.0-beta.14";
9851
+ const version = "3.6.0-beta.15";
9835
9852
  const warn = warn$1;
9836
9853
  /**
9837
9854
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -10974,7 +10991,7 @@ const TransitionGroup = /* @__PURE__ */ decorate({
10974
10991
  prevChildren = [];
10975
10992
  if (children) for (let i = 0; i < children.length; i++) {
10976
10993
  const child = children[i];
10977
- if (child.el && child.el instanceof Element) {
10994
+ if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
10978
10995
  prevChildren.push(child);
10979
10996
  setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
10980
10997
  positionMap.set(child, getPosition(child.el));
@@ -13946,7 +13963,7 @@ const tokenizer = new Tokenizer(stack, {
13946
13963
  }
13947
13964
  },
13948
13965
  oncdata(start, end) {
13949
- if (stack[0].ns !== 0) onText(getSlice(start, end), start, end);
13966
+ if ((stack[0] ? stack[0].ns : currentOptions.ns) !== 0) onText(getSlice(start, end), start, end);
13950
13967
  else emitError(1, start - 9);
13951
13968
  },
13952
13969
  onprocessinginstruction(start) {
@@ -14451,7 +14468,7 @@ function getSelfName(filename) {
14451
14468
  const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/);
14452
14469
  return nameMatch ? capitalize(camelize(nameMatch[1])) : null;
14453
14470
  }
14454
- 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 }) {
14471
+ 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 }) {
14455
14472
  const context = {
14456
14473
  filename,
14457
14474
  selfName: getSelfName(filename),
@@ -14473,6 +14490,7 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
14473
14490
  bindingMetadata,
14474
14491
  inline,
14475
14492
  isTS,
14493
+ eventDelegation,
14476
14494
  onError,
14477
14495
  onWarn,
14478
14496
  compatConfig,
@@ -14484,6 +14502,7 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
14484
14502
  imports: [],
14485
14503
  cached: [],
14486
14504
  constantCache: /* @__PURE__ */ new WeakMap(),
14505
+ vForMemoKeyedNodes: /* @__PURE__ */ new WeakSet(),
14487
14506
  temps: 0,
14488
14507
  identifiers: Object.create(null),
14489
14508
  identifierScopes: Object.create(null),
@@ -15254,7 +15273,7 @@ const transformExpression = (node, context) => {
15254
15273
  if (dir.type === 7 && dir.name !== "for") {
15255
15274
  const exp = dir.exp;
15256
15275
  const arg = dir.arg;
15257
- 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");
15276
+ 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");
15258
15277
  if (arg && arg.type === 4 && !arg.isStatic) dir.arg = processExpression(arg, context);
15259
15278
  }
15260
15279
  }
@@ -15514,7 +15533,10 @@ const transformFor = createStructuralDirectiveTransform("for", (node, dir, conte
15514
15533
  let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
15515
15534
  const keyProperty = keyExp ? createObjectProperty(`key`, keyExp) : null;
15516
15535
  if (isTemplate && memo) memo.exp = processExpression(memo.exp, context);
15517
- if ((isTemplate || memo) && keyProperty && isDirKey) keyExp = keyProp.exp = keyProperty.value = processExpression(keyProperty.value, context);
15536
+ if ((isTemplate || memo) && keyProperty && isDirKey) {
15537
+ keyExp = keyProp.exp = keyProperty.value = processExpression(keyProperty.value, context);
15538
+ if (memo) context.vForMemoKeyedNodes.add(node);
15539
+ }
15518
15540
  const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
15519
15541
  const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
15520
15542
  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/compat v3.6.0-beta.14
2
+ * @vue/compat v3.6.0-beta.15
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2090,8 +2090,9 @@ var WatcherEffect = class extends ReactiveEffect {
2090
2090
  if (once && cb) {
2091
2091
  const _cb = cb;
2092
2092
  cb = (...args) => {
2093
- _cb(...args);
2093
+ const res = _cb(...args);
2094
2094
  this.stop();
2095
+ return res;
2095
2096
  };
2096
2097
  }
2097
2098
  this.cb = cb;
@@ -2103,7 +2104,7 @@ var WatcherEffect = class extends ReactiveEffect {
2103
2104
  if (!this.cb) return;
2104
2105
  const { immediate, deep, call } = this.options;
2105
2106
  if (initialRun && !immediate) return;
2106
- if (deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2107
+ if (initialRun || deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2107
2108
  cleanup(this);
2108
2109
  const currentWatcher = activeWatcher;
2109
2110
  activeWatcher = this;
@@ -3812,11 +3813,16 @@ function defineAsyncComponent(source) {
3812
3813
  onError(err);
3813
3814
  return () => errorComponent ? createVNode(errorComponent, { error: err }) : null;
3814
3815
  });
3815
- const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError);
3816
+ const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError, instance);
3816
3817
  load().then(() => {
3818
+ if (instance.isUnmounted) return;
3817
3819
  loaded.value = true;
3818
3820
  if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) instance.parent.update();
3819
3821
  }).catch((err) => {
3822
+ if (instance.isUnmounted) {
3823
+ setPendingRequest(null);
3824
+ return;
3825
+ }
3820
3826
  onError(err);
3821
3827
  error.value = err;
3822
3828
  });
@@ -3872,14 +3878,22 @@ function createAsyncComponentContext(source) {
3872
3878
  setPendingRequest: (request) => pendingRequest = request
3873
3879
  };
3874
3880
  }
3875
- const useAsyncComponentState = (delay, timeout, onError) => {
3881
+ const useAsyncComponentState = (delay, timeout, onError, instance = currentInstance) => {
3876
3882
  const loaded = /* @__PURE__ */ ref(false);
3877
3883
  const error = /* @__PURE__ */ ref();
3878
3884
  const delayed = /* @__PURE__ */ ref(!!delay);
3879
- if (delay) setTimeout(() => {
3885
+ let timeoutTimer;
3886
+ let delayTimer;
3887
+ if (instance) onUnmounted(() => {
3888
+ if (timeoutTimer != null) clearTimeout(timeoutTimer);
3889
+ if (delayTimer != null) clearTimeout(delayTimer);
3890
+ }, instance);
3891
+ if (delay) delayTimer = setTimeout(() => {
3892
+ if (instance && instance.isUnmounted) return;
3880
3893
  delayed.value = false;
3881
3894
  }, delay);
3882
- if (timeout != null) setTimeout(() => {
3895
+ if (timeout != null) timeoutTimer = setTimeout(() => {
3896
+ if (instance && instance.isUnmounted) return;
3883
3897
  if (!loaded.value && !error.value) {
3884
3898
  const err = /* @__PURE__ */ new Error(`Async component timed out after ${timeout}ms.`);
3885
3899
  onError(err);
@@ -5255,7 +5269,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5255
5269
  if (options.el) return vm.$mount(options.el);
5256
5270
  else return vm;
5257
5271
  }
5258
- Vue.version = `2.6.14-compat:3.6.0-beta.14`;
5272
+ Vue.version = `2.6.14-compat:3.6.0-beta.15`;
5259
5273
  Vue.config = singletonApp.config;
5260
5274
  Vue.use = (plugin, ...options) => {
5261
5275
  if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
@@ -5690,12 +5704,13 @@ function useModel(props, name, options = EMPTY_OBJ) {
5690
5704
  for (const key of rawPropKeys) if (key === name || key === camelizedName || key === hyphenatedName) parentPassedModelValue = true;
5691
5705
  else if (key === `onUpdate:${name}` || key === `onUpdate:${camelizedName}` || key === `onUpdate:${hyphenatedName}`) parentPassedModelUpdater = true;
5692
5706
  }
5693
- if (!parentPassedModelValue || !parentPassedModelUpdater) {
5707
+ const hasVModel = parentPassedModelValue && parentPassedModelUpdater;
5708
+ if (!hasVModel) {
5694
5709
  localValue = value;
5695
5710
  trigger();
5696
5711
  }
5697
5712
  i.emit(`update:${name}`, emittedValue);
5698
- if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) trigger();
5713
+ if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) trigger();
5699
5714
  prevSetValue = value;
5700
5715
  prevEmittedValue = emittedValue;
5701
5716
  }
@@ -8027,7 +8042,7 @@ function isMemoSame(cached, memo) {
8027
8042
  }
8028
8043
  //#endregion
8029
8044
  //#region packages/runtime-core/src/index.ts
8030
- const version = "3.6.0-beta.14";
8045
+ const version = "3.6.0-beta.15";
8031
8046
  const warn = NOOP;
8032
8047
  /**
8033
8048
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -9112,7 +9127,7 @@ const TransitionGroup = /* @__PURE__ */ decorate({
9112
9127
  prevChildren = [];
9113
9128
  if (children) for (let i = 0; i < children.length; i++) {
9114
9129
  const child = children[i];
9115
- if (child.el && child.el instanceof Element) {
9130
+ if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
9116
9131
  prevChildren.push(child);
9117
9132
  setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
9118
9133
  positionMap.set(child, getPosition(child.el));
@@ -11983,7 +11998,7 @@ const tokenizer = new Tokenizer(stack, {
11983
11998
  }
11984
11999
  },
11985
12000
  oncdata(start, end) {
11986
- if (stack[0].ns !== 0) onText(getSlice(start, end), start, end);
12001
+ if ((stack[0] ? stack[0].ns : currentOptions.ns) !== 0) onText(getSlice(start, end), start, end);
11987
12002
  else emitError(1, start - 9);
11988
12003
  },
11989
12004
  onprocessinginstruction(start) {
@@ -12471,7 +12486,7 @@ function getSelfName(filename) {
12471
12486
  const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/);
12472
12487
  return nameMatch ? capitalize(camelize(nameMatch[1])) : null;
12473
12488
  }
12474
- 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 }) {
12489
+ 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 }) {
12475
12490
  const context = {
12476
12491
  filename,
12477
12492
  selfName: getSelfName(filename),
@@ -12493,6 +12508,7 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
12493
12508
  bindingMetadata,
12494
12509
  inline,
12495
12510
  isTS,
12511
+ eventDelegation,
12496
12512
  onError,
12497
12513
  onWarn,
12498
12514
  compatConfig,
@@ -12504,6 +12520,7 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
12504
12520
  imports: [],
12505
12521
  cached: [],
12506
12522
  constantCache: /* @__PURE__ */ new WeakMap(),
12523
+ vForMemoKeyedNodes: /* @__PURE__ */ new WeakSet(),
12507
12524
  temps: 0,
12508
12525
  identifiers: Object.create(null),
12509
12526
  identifierScopes: Object.create(null),
@@ -13260,7 +13277,7 @@ const transformExpression = (node, context) => {
13260
13277
  if (dir.type === 7 && dir.name !== "for") {
13261
13278
  const exp = dir.exp;
13262
13279
  const arg = dir.arg;
13263
- 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");
13280
+ 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");
13264
13281
  if (arg && arg.type === 4 && !arg.isStatic) dir.arg = processExpression(arg, context);
13265
13282
  }
13266
13283
  }
@@ -13513,7 +13530,10 @@ const transformFor = createStructuralDirectiveTransform("for", (node, dir, conte
13513
13530
  let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
13514
13531
  const keyProperty = keyExp ? createObjectProperty(`key`, keyExp) : null;
13515
13532
  if (isTemplate && memo) memo.exp = processExpression(memo.exp, context);
13516
- if ((isTemplate || memo) && keyProperty && isDirKey) keyExp = keyProp.exp = keyProperty.value = processExpression(keyProperty.value, context);
13533
+ if ((isTemplate || memo) && keyProperty && isDirKey) {
13534
+ keyExp = keyProp.exp = keyProperty.value = processExpression(keyProperty.value, context);
13535
+ if (memo) context.vForMemoKeyedNodes.add(node);
13536
+ }
13517
13537
  const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
13518
13538
  const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
13519
13539
  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/compat v3.6.0-beta.14
2
+ * @vue/compat v3.6.0-beta.15
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2246,8 +2246,9 @@ var WatcherEffect = class extends ReactiveEffect {
2246
2246
  if (once && cb) {
2247
2247
  const _cb = cb;
2248
2248
  cb = (...args) => {
2249
- _cb(...args);
2249
+ const res = _cb(...args);
2250
2250
  this.stop();
2251
+ return res;
2251
2252
  };
2252
2253
  }
2253
2254
  this.cb = cb;
@@ -2261,7 +2262,7 @@ var WatcherEffect = class extends ReactiveEffect {
2261
2262
  if (!this.cb) return;
2262
2263
  const { immediate, deep, call } = this.options;
2263
2264
  if (initialRun && !immediate) return;
2264
- if (deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2265
+ if (initialRun || deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2265
2266
  cleanup(this);
2266
2267
  const currentWatcher = activeWatcher;
2267
2268
  activeWatcher = this;
@@ -4669,11 +4670,16 @@ function defineAsyncComponent(source) {
4669
4670
  onError(err);
4670
4671
  return () => errorComponent ? createVNode(errorComponent, { error: err }) : null;
4671
4672
  });
4672
- const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError);
4673
+ const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError, instance);
4673
4674
  load().then(() => {
4675
+ if (instance.isUnmounted) return;
4674
4676
  loaded.value = true;
4675
4677
  if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) instance.parent.update();
4676
4678
  }).catch((err) => {
4679
+ if (instance.isUnmounted) {
4680
+ setPendingRequest(null);
4681
+ return;
4682
+ }
4677
4683
  onError(err);
4678
4684
  error.value = err;
4679
4685
  });
@@ -4731,14 +4737,22 @@ function createAsyncComponentContext(source) {
4731
4737
  setPendingRequest: (request) => pendingRequest = request
4732
4738
  };
4733
4739
  }
4734
- const useAsyncComponentState = (delay, timeout, onError) => {
4740
+ const useAsyncComponentState = (delay, timeout, onError, instance = currentInstance) => {
4735
4741
  const loaded = /* @__PURE__ */ ref(false);
4736
4742
  const error = /* @__PURE__ */ ref();
4737
4743
  const delayed = /* @__PURE__ */ ref(!!delay);
4738
- if (delay) setTimeout(() => {
4744
+ let timeoutTimer;
4745
+ let delayTimer;
4746
+ if (instance) onUnmounted(() => {
4747
+ if (timeoutTimer != null) clearTimeout(timeoutTimer);
4748
+ if (delayTimer != null) clearTimeout(delayTimer);
4749
+ }, instance);
4750
+ if (delay) delayTimer = setTimeout(() => {
4751
+ if (instance && instance.isUnmounted) return;
4739
4752
  delayed.value = false;
4740
4753
  }, delay);
4741
- if (timeout != null) setTimeout(() => {
4754
+ if (timeout != null) timeoutTimer = setTimeout(() => {
4755
+ if (instance && instance.isUnmounted) return;
4742
4756
  if (!loaded.value && !error.value) {
4743
4757
  const err = /* @__PURE__ */ new Error(`Async component timed out after ${timeout}ms.`);
4744
4758
  onError(err);
@@ -6293,7 +6307,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6293
6307
  if (options.el) return vm.$mount(options.el);
6294
6308
  else return vm;
6295
6309
  }
6296
- Vue.version = `2.6.14-compat:3.6.0-beta.14`;
6310
+ Vue.version = `2.6.14-compat:3.6.0-beta.15`;
6297
6311
  Vue.config = singletonApp.config;
6298
6312
  Vue.use = (plugin, ...options) => {
6299
6313
  if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
@@ -6548,7 +6562,9 @@ function defineReactive(obj, key, val) {
6548
6562
  else Object.keys(val).forEach((key) => {
6549
6563
  try {
6550
6564
  defineReactiveSimple(val, key, val[key]);
6551
- } catch (e) {}
6565
+ } catch (e) {
6566
+ warn$1(`Failed making property "${key}" reactive:`, e);
6567
+ }
6552
6568
  });
6553
6569
  }
6554
6570
  const i = obj.$;
@@ -6793,12 +6809,13 @@ function useModel(props, name, options = EMPTY_OBJ) {
6793
6809
  for (const key of rawPropKeys) if (key === name || key === camelizedName || key === hyphenatedName) parentPassedModelValue = true;
6794
6810
  else if (key === `onUpdate:${name}` || key === `onUpdate:${camelizedName}` || key === `onUpdate:${hyphenatedName}`) parentPassedModelUpdater = true;
6795
6811
  }
6796
- if (!parentPassedModelValue || !parentPassedModelUpdater) {
6812
+ const hasVModel = parentPassedModelValue && parentPassedModelUpdater;
6813
+ if (!hasVModel) {
6797
6814
  localValue = value;
6798
6815
  trigger();
6799
6816
  }
6800
6817
  i.emit(`update:${name}`, emittedValue);
6801
- if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) trigger();
6818
+ if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) trigger();
6802
6819
  prevSetValue = value;
6803
6820
  prevEmittedValue = emittedValue;
6804
6821
  }
@@ -9753,7 +9770,7 @@ function isMemoSame(cached, memo) {
9753
9770
  }
9754
9771
  //#endregion
9755
9772
  //#region packages/runtime-core/src/index.ts
9756
- const version = "3.6.0-beta.14";
9773
+ const version = "3.6.0-beta.15";
9757
9774
  const warn = warn$1;
9758
9775
  /**
9759
9776
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -10956,7 +10973,7 @@ const TransitionGroup = /* @__PURE__ */ decorate({
10956
10973
  prevChildren = [];
10957
10974
  if (children) for (let i = 0; i < children.length; i++) {
10958
10975
  const child = children[i];
10959
- if (child.el && child.el instanceof Element) {
10976
+ if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
10960
10977
  prevChildren.push(child);
10961
10978
  setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
10962
10979
  positionMap.set(child, getPosition(child.el));
@@ -13177,7 +13194,7 @@ const tokenizer = new Tokenizer(stack, {
13177
13194
  }
13178
13195
  },
13179
13196
  oncdata(start, end) {
13180
- if (stack[0].ns !== 0) onText(getSlice(start, end), start, end);
13197
+ if ((stack[0] ? stack[0].ns : currentOptions.ns) !== 0) onText(getSlice(start, end), start, end);
13181
13198
  else emitError(1, start - 9);
13182
13199
  },
13183
13200
  onprocessinginstruction(start) {
@@ -13669,7 +13686,7 @@ function getSelfName(filename) {
13669
13686
  const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/);
13670
13687
  return nameMatch ? capitalize(camelize(nameMatch[1])) : null;
13671
13688
  }
13672
- 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 }) {
13689
+ 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 }) {
13673
13690
  const context = {
13674
13691
  filename,
13675
13692
  selfName: getSelfName(filename),
@@ -13691,6 +13708,7 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
13691
13708
  bindingMetadata,
13692
13709
  inline,
13693
13710
  isTS,
13711
+ eventDelegation,
13694
13712
  onError,
13695
13713
  onWarn,
13696
13714
  compatConfig,
@@ -13702,6 +13720,7 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
13702
13720
  imports: [],
13703
13721
  cached: [],
13704
13722
  constantCache: /* @__PURE__ */ new WeakMap(),
13723
+ vForMemoKeyedNodes: /* @__PURE__ */ new WeakSet(),
13705
13724
  temps: 0,
13706
13725
  identifiers: Object.create(null),
13707
13726
  identifierScopes: Object.create(null),
@@ -14332,7 +14351,7 @@ const transformExpression = (node, context) => {
14332
14351
  if (dir.type === 7 && dir.name !== "for") {
14333
14352
  const exp = dir.exp;
14334
14353
  const arg = dir.arg;
14335
- 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");
14354
+ 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");
14336
14355
  if (arg && arg.type === 4 && !arg.isStatic) dir.arg = processExpression(arg, context);
14337
14356
  }
14338
14357
  }