@vue/runtime-dom 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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.6.0-beta.14
2
+ * @vue/runtime-dom v3.6.0-beta.15
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1065,7 +1065,7 @@ const TransitionGroup = /* @__PURE__ */ decorate({
1065
1065
  prevChildren = [];
1066
1066
  if (children) for (let i = 0; i < children.length; i++) {
1067
1067
  const child = children[i];
1068
- if (child.el && child.el instanceof Element) {
1068
+ if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
1069
1069
  prevChildren.push(child);
1070
1070
  (0, _vue_runtime_core.setTransitionHooks)(child, (0, _vue_runtime_core.resolveTransitionHooks)(child, cssTransitionProps, state, instance));
1071
1071
  positionMap.set(child, getPosition(child.el));
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.6.0-beta.14
2
+ * @vue/runtime-dom v3.6.0-beta.15
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1009,7 +1009,7 @@ const TransitionGroup = /* @__PURE__ */ decorate({
1009
1009
  prevChildren = [];
1010
1010
  if (children) for (let i = 0; i < children.length; i++) {
1011
1011
  const child = children[i];
1012
- if (child.el && child.el instanceof Element) {
1012
+ if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
1013
1013
  prevChildren.push(child);
1014
1014
  (0, _vue_runtime_core.setTransitionHooks)(child, (0, _vue_runtime_core.resolveTransitionHooks)(child, cssTransitionProps, state, instance));
1015
1015
  positionMap.set(child, getPosition(child.el));
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.6.0-beta.14
2
+ * @vue/runtime-dom v3.6.0-beta.15
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2156,8 +2156,9 @@ var WatcherEffect = class extends ReactiveEffect {
2156
2156
  if (once && cb) {
2157
2157
  const _cb = cb;
2158
2158
  cb = (...args) => {
2159
- _cb(...args);
2159
+ const res = _cb(...args);
2160
2160
  this.stop();
2161
+ return res;
2161
2162
  };
2162
2163
  }
2163
2164
  this.cb = cb;
@@ -2171,7 +2172,7 @@ var WatcherEffect = class extends ReactiveEffect {
2171
2172
  if (!this.cb) return;
2172
2173
  const { immediate, deep, call } = this.options;
2173
2174
  if (initialRun && !immediate) return;
2174
- if (deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2175
+ if (initialRun || deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2175
2176
  cleanup(this);
2176
2177
  const currentWatcher = activeWatcher;
2177
2178
  activeWatcher = this;
@@ -4227,11 +4228,16 @@ function defineAsyncComponent(source) {
4227
4228
  onError(err);
4228
4229
  return () => errorComponent ? createVNode(errorComponent, { error: err }) : null;
4229
4230
  });
4230
- const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError);
4231
+ const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError, instance);
4231
4232
  load().then(() => {
4233
+ if (instance.isUnmounted) return;
4232
4234
  loaded.value = true;
4233
4235
  if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) instance.parent.update();
4234
4236
  }).catch((err) => {
4237
+ if (instance.isUnmounted) {
4238
+ setPendingRequest(null);
4239
+ return;
4240
+ }
4235
4241
  onError(err);
4236
4242
  error.value = err;
4237
4243
  });
@@ -4289,14 +4295,22 @@ function createAsyncComponentContext(source) {
4289
4295
  setPendingRequest: (request) => pendingRequest = request
4290
4296
  };
4291
4297
  }
4292
- const useAsyncComponentState = (delay, timeout, onError) => {
4298
+ const useAsyncComponentState = (delay, timeout, onError, instance = currentInstance) => {
4293
4299
  const loaded = /* @__PURE__ */ ref(false);
4294
4300
  const error = /* @__PURE__ */ ref();
4295
4301
  const delayed = /* @__PURE__ */ ref(!!delay);
4296
- if (delay) setTimeout(() => {
4302
+ let timeoutTimer;
4303
+ let delayTimer;
4304
+ if (instance) onUnmounted(() => {
4305
+ if (timeoutTimer != null) clearTimeout(timeoutTimer);
4306
+ if (delayTimer != null) clearTimeout(delayTimer);
4307
+ }, instance);
4308
+ if (delay) delayTimer = setTimeout(() => {
4309
+ if (instance && instance.isUnmounted) return;
4297
4310
  delayed.value = false;
4298
4311
  }, delay);
4299
- if (timeout != null) setTimeout(() => {
4312
+ if (timeout != null) timeoutTimer = setTimeout(() => {
4313
+ if (instance && instance.isUnmounted) return;
4300
4314
  if (!loaded.value && !error.value) {
4301
4315
  const err = /* @__PURE__ */ new Error(`Async component timed out after ${timeout}ms.`);
4302
4316
  onError(err);
@@ -5553,12 +5567,13 @@ function useModel(props, name, options = EMPTY_OBJ) {
5553
5567
  for (const key of rawPropKeys) if (key === name || key === camelizedName || key === hyphenatedName) parentPassedModelValue = true;
5554
5568
  else if (key === `onUpdate:${name}` || key === `onUpdate:${camelizedName}` || key === `onUpdate:${hyphenatedName}`) parentPassedModelUpdater = true;
5555
5569
  }
5556
- if (!parentPassedModelValue || !parentPassedModelUpdater) {
5570
+ const hasVModel = parentPassedModelValue && parentPassedModelUpdater;
5571
+ if (!hasVModel) {
5557
5572
  localValue = value;
5558
5573
  trigger();
5559
5574
  }
5560
5575
  i.emit(`update:${name}`, emittedValue);
5561
- if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) trigger();
5576
+ if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) trigger();
5562
5577
  prevSetValue = value;
5563
5578
  prevEmittedValue = emittedValue;
5564
5579
  }
@@ -8404,7 +8419,7 @@ function isMemoSame(cached, memo) {
8404
8419
  }
8405
8420
  //#endregion
8406
8421
  //#region packages/runtime-core/src/index.ts
8407
- const version = "3.6.0-beta.14";
8422
+ const version = "3.6.0-beta.15";
8408
8423
  const warn = warn$1;
8409
8424
  /**
8410
8425
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -9555,7 +9570,7 @@ const TransitionGroup = /* @__PURE__ */ decorate({
9555
9570
  prevChildren = [];
9556
9571
  if (children) for (let i = 0; i < children.length; i++) {
9557
9572
  const child = children[i];
9558
- if (child.el && child.el instanceof Element) {
9573
+ if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
9559
9574
  prevChildren.push(child);
9560
9575
  setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
9561
9576
  positionMap.set(child, getPosition(child.el));