@vue/runtime-core 3.5.0-alpha.3 → 3.5.0-alpha.4

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-core v3.5.0-alpha.3
2
+ * @vue/runtime-core v3.5.0-alpha.4
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1519,6 +1519,7 @@ function defineAsyncComponent(source) {
1519
1519
  },
1520
1520
  setup() {
1521
1521
  const instance = currentInstance;
1522
+ markAsyncBoundary(instance);
1522
1523
  if (resolvedComp) {
1523
1524
  return () => createInnerComp(resolvedComp, instance);
1524
1525
  }
@@ -1540,8 +1541,6 @@ function defineAsyncComponent(source) {
1540
1541
  error: err
1541
1542
  }) : null;
1542
1543
  });
1543
- } else {
1544
- markAsyncBoundary(instance);
1545
1544
  }
1546
1545
  const loaded = reactivity.ref(false);
1547
1546
  const error = reactivity.ref();
@@ -4942,7 +4941,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4942
4941
  const componentUpdateFn = () => {
4943
4942
  if (!instance.isMounted) {
4944
4943
  let vnodeHook;
4945
- const { el, props } = initialVNode;
4944
+ const { el, props, type } = initialVNode;
4946
4945
  const { bm, m, parent } = instance;
4947
4946
  const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
4948
4947
  toggleRecurse(instance, false);
@@ -4976,8 +4975,8 @@ function baseCreateRenderer(options, createHydrationFns) {
4976
4975
  endMeasure(instance, `hydrate`);
4977
4976
  }
4978
4977
  };
4979
- if (isAsyncWrapperVNode) {
4980
- initialVNode.type.__asyncLoader().then(
4978
+ if (isAsyncWrapperVNode && !type.__asyncResolved) {
4979
+ type.__asyncLoader().then(
4981
4980
  // note: we are moving the render call into an async callback,
4982
4981
  // which means it won't track dependencies - but it's ok because
4983
4982
  // a server-rendered async wrapper is already in resolved state
@@ -6089,7 +6088,7 @@ function useModel(props, name, options = shared.EMPTY_OBJ) {
6089
6088
  const modifiers = getModelModifiers(props, name);
6090
6089
  const res = reactivity.customRef((track, trigger) => {
6091
6090
  let localValue;
6092
- let prevSetValue;
6091
+ let prevSetValue = shared.EMPTY_OBJ;
6093
6092
  let prevEmittedValue;
6094
6093
  watchSyncEffect(() => {
6095
6094
  const propValue = props[name];
@@ -6104,7 +6103,7 @@ function useModel(props, name, options = shared.EMPTY_OBJ) {
6104
6103
  return options.get ? options.get(localValue) : localValue;
6105
6104
  },
6106
6105
  set(value) {
6107
- if (!shared.hasChanged(value, localValue)) {
6106
+ if (!shared.hasChanged(value, localValue) && !(prevSetValue !== shared.EMPTY_OBJ && shared.hasChanged(value, prevSetValue))) {
6108
6107
  return;
6109
6108
  }
6110
6109
  const rawProps = i.vnode.props;
@@ -6115,7 +6114,7 @@ function useModel(props, name, options = shared.EMPTY_OBJ) {
6115
6114
  }
6116
6115
  const emittedValue = options.set ? options.set(value) : value;
6117
6116
  i.emit(`update:${name}`, emittedValue);
6118
- if (value !== emittedValue && value !== prevSetValue && emittedValue === prevEmittedValue) {
6117
+ if (shared.hasChanged(value, emittedValue) && shared.hasChanged(value, prevSetValue) && !shared.hasChanged(emittedValue, prevEmittedValue)) {
6119
6118
  trigger();
6120
6119
  }
6121
6120
  prevSetValue = value;
@@ -7734,7 +7733,7 @@ function setupStatefulComponent(instance, isSSR) {
7734
7733
  reactivity.resetTracking();
7735
7734
  reset();
7736
7735
  if (shared.isPromise(setupResult)) {
7737
- markAsyncBoundary(instance);
7736
+ if (!isAsyncWrapper(instance)) markAsyncBoundary(instance);
7738
7737
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
7739
7738
  if (isSSR) {
7740
7739
  return setupResult.then((resolvedResult) => {
@@ -8215,7 +8214,7 @@ function isMemoSame(cached, memo) {
8215
8214
  return true;
8216
8215
  }
8217
8216
 
8218
- const version = "3.5.0-alpha.3";
8217
+ const version = "3.5.0-alpha.4";
8219
8218
  const warn = warn$1 ;
8220
8219
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
8221
8220
  const devtools = devtools$1 ;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-core v3.5.0-alpha.3
2
+ * @vue/runtime-core v3.5.0-alpha.4
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1072,6 +1072,7 @@ function defineAsyncComponent(source) {
1072
1072
  },
1073
1073
  setup() {
1074
1074
  const instance = currentInstance;
1075
+ markAsyncBoundary(instance);
1075
1076
  if (resolvedComp) {
1076
1077
  return () => createInnerComp(resolvedComp, instance);
1077
1078
  }
@@ -1093,8 +1094,6 @@ function defineAsyncComponent(source) {
1093
1094
  error: err
1094
1095
  }) : null;
1095
1096
  });
1096
- } else {
1097
- markAsyncBoundary(instance);
1098
1097
  }
1099
1098
  const loaded = reactivity.ref(false);
1100
1099
  const error = reactivity.ref();
@@ -3751,7 +3750,7 @@ function baseCreateRenderer(options, createHydrationFns) {
3751
3750
  const componentUpdateFn = () => {
3752
3751
  if (!instance.isMounted) {
3753
3752
  let vnodeHook;
3754
- const { el, props } = initialVNode;
3753
+ const { el, props, type } = initialVNode;
3755
3754
  const { bm, m, parent } = instance;
3756
3755
  const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
3757
3756
  toggleRecurse(instance, false);
@@ -3773,8 +3772,8 @@ function baseCreateRenderer(options, createHydrationFns) {
3773
3772
  null
3774
3773
  );
3775
3774
  };
3776
- if (isAsyncWrapperVNode) {
3777
- initialVNode.type.__asyncLoader().then(
3775
+ if (isAsyncWrapperVNode && !type.__asyncResolved) {
3776
+ type.__asyncLoader().then(
3778
3777
  // note: we are moving the render call into an async callback,
3779
3778
  // which means it won't track dependencies - but it's ok because
3780
3779
  // a server-rendered async wrapper is already in resolved state
@@ -4768,7 +4767,7 @@ function useModel(props, name, options = shared.EMPTY_OBJ) {
4768
4767
  const modifiers = getModelModifiers(props, name);
4769
4768
  const res = reactivity.customRef((track, trigger) => {
4770
4769
  let localValue;
4771
- let prevSetValue;
4770
+ let prevSetValue = shared.EMPTY_OBJ;
4772
4771
  let prevEmittedValue;
4773
4772
  watchSyncEffect(() => {
4774
4773
  const propValue = props[name];
@@ -4783,7 +4782,7 @@ function useModel(props, name, options = shared.EMPTY_OBJ) {
4783
4782
  return options.get ? options.get(localValue) : localValue;
4784
4783
  },
4785
4784
  set(value) {
4786
- if (!shared.hasChanged(value, localValue)) {
4785
+ if (!shared.hasChanged(value, localValue) && !(prevSetValue !== shared.EMPTY_OBJ && shared.hasChanged(value, prevSetValue))) {
4787
4786
  return;
4788
4787
  }
4789
4788
  const rawProps = i.vnode.props;
@@ -4794,7 +4793,7 @@ function useModel(props, name, options = shared.EMPTY_OBJ) {
4794
4793
  }
4795
4794
  const emittedValue = options.set ? options.set(value) : value;
4796
4795
  i.emit(`update:${name}`, emittedValue);
4797
- if (value !== emittedValue && value !== prevSetValue && emittedValue === prevEmittedValue) {
4796
+ if (shared.hasChanged(value, emittedValue) && shared.hasChanged(value, prevSetValue) && !shared.hasChanged(emittedValue, prevEmittedValue)) {
4798
4797
  trigger();
4799
4798
  }
4800
4799
  prevSetValue = value;
@@ -6191,7 +6190,7 @@ function setupStatefulComponent(instance, isSSR) {
6191
6190
  reactivity.resetTracking();
6192
6191
  reset();
6193
6192
  if (shared.isPromise(setupResult)) {
6194
- markAsyncBoundary(instance);
6193
+ if (!isAsyncWrapper(instance)) markAsyncBoundary(instance);
6195
6194
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
6196
6195
  if (isSSR) {
6197
6196
  return setupResult.then((resolvedResult) => {
@@ -6385,7 +6384,7 @@ function isMemoSame(cached, memo) {
6385
6384
  return true;
6386
6385
  }
6387
6386
 
6388
- const version = "3.5.0-alpha.3";
6387
+ const version = "3.5.0-alpha.4";
6389
6388
  const warn$1 = shared.NOOP;
6390
6389
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
6391
6390
  const devtools = void 0;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-core v3.5.0-alpha.3
2
+ * @vue/runtime-core v3.5.0-alpha.4
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1523,6 +1523,7 @@ function defineAsyncComponent(source) {
1523
1523
  },
1524
1524
  setup() {
1525
1525
  const instance = currentInstance;
1526
+ markAsyncBoundary(instance);
1526
1527
  if (resolvedComp) {
1527
1528
  return () => createInnerComp(resolvedComp, instance);
1528
1529
  }
@@ -1544,8 +1545,6 @@ function defineAsyncComponent(source) {
1544
1545
  error: err
1545
1546
  }) : null;
1546
1547
  });
1547
- } else {
1548
- markAsyncBoundary(instance);
1549
1548
  }
1550
1549
  const loaded = ref(false);
1551
1550
  const error = ref();
@@ -4999,7 +4998,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4999
4998
  const componentUpdateFn = () => {
5000
4999
  if (!instance.isMounted) {
5001
5000
  let vnodeHook;
5002
- const { el, props } = initialVNode;
5001
+ const { el, props, type } = initialVNode;
5003
5002
  const { bm, m, parent } = instance;
5004
5003
  const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
5005
5004
  toggleRecurse(instance, false);
@@ -5033,8 +5032,8 @@ function baseCreateRenderer(options, createHydrationFns) {
5033
5032
  endMeasure(instance, `hydrate`);
5034
5033
  }
5035
5034
  };
5036
- if (isAsyncWrapperVNode) {
5037
- initialVNode.type.__asyncLoader().then(
5035
+ if (isAsyncWrapperVNode && !type.__asyncResolved) {
5036
+ type.__asyncLoader().then(
5038
5037
  // note: we are moving the render call into an async callback,
5039
5038
  // which means it won't track dependencies - but it's ok because
5040
5039
  // a server-rendered async wrapper is already in resolved state
@@ -6146,7 +6145,7 @@ function useModel(props, name, options = EMPTY_OBJ) {
6146
6145
  const modifiers = getModelModifiers(props, name);
6147
6146
  const res = customRef((track, trigger) => {
6148
6147
  let localValue;
6149
- let prevSetValue;
6148
+ let prevSetValue = EMPTY_OBJ;
6150
6149
  let prevEmittedValue;
6151
6150
  watchSyncEffect(() => {
6152
6151
  const propValue = props[name];
@@ -6161,7 +6160,7 @@ function useModel(props, name, options = EMPTY_OBJ) {
6161
6160
  return options.get ? options.get(localValue) : localValue;
6162
6161
  },
6163
6162
  set(value) {
6164
- if (!hasChanged(value, localValue)) {
6163
+ if (!hasChanged(value, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
6165
6164
  return;
6166
6165
  }
6167
6166
  const rawProps = i.vnode.props;
@@ -6172,7 +6171,7 @@ function useModel(props, name, options = EMPTY_OBJ) {
6172
6171
  }
6173
6172
  const emittedValue = options.set ? options.set(value) : value;
6174
6173
  i.emit(`update:${name}`, emittedValue);
6175
- if (value !== emittedValue && value !== prevSetValue && emittedValue === prevEmittedValue) {
6174
+ if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
6176
6175
  trigger();
6177
6176
  }
6178
6177
  prevSetValue = value;
@@ -7793,7 +7792,7 @@ function setupStatefulComponent(instance, isSSR) {
7793
7792
  resetTracking();
7794
7793
  reset();
7795
7794
  if (isPromise(setupResult)) {
7796
- markAsyncBoundary(instance);
7795
+ if (!isAsyncWrapper(instance)) markAsyncBoundary(instance);
7797
7796
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
7798
7797
  if (isSSR) {
7799
7798
  return setupResult.then((resolvedResult) => {
@@ -8286,7 +8285,7 @@ function isMemoSame(cached, memo) {
8286
8285
  return true;
8287
8286
  }
8288
8287
 
8289
- const version = "3.5.0-alpha.3";
8288
+ const version = "3.5.0-alpha.4";
8290
8289
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
8291
8290
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
8292
8291
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/runtime-core",
3
- "version": "3.5.0-alpha.3",
3
+ "version": "3.5.0-alpha.4",
4
4
  "description": "@vue/runtime-core",
5
5
  "main": "index.js",
6
6
  "module": "dist/runtime-core.esm-bundler.js",
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
48
48
  "dependencies": {
49
- "@vue/shared": "3.5.0-alpha.3",
50
- "@vue/reactivity": "3.5.0-alpha.3"
49
+ "@vue/shared": "3.5.0-alpha.4",
50
+ "@vue/reactivity": "3.5.0-alpha.4"
51
51
  }
52
52
  }