vue 3.4.8 → 3.4.10

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/dist/vue.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.4.8
2
+ * vue v3.4.10
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 v3.4.8
2
+ * vue v3.4.10
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 v3.4.8
2
+ * vue v3.4.10
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2738,6 +2738,10 @@ const SuspenseImpl = {
2738
2738
  rendererInternals
2739
2739
  );
2740
2740
  } else {
2741
+ if (parentSuspense && parentSuspense.deps > 0) {
2742
+ n2.suspense = n1.suspense;
2743
+ return;
2744
+ }
2741
2745
  patchSuspense(
2742
2746
  n1,
2743
2747
  n2,
@@ -4811,58 +4815,6 @@ function useSlots() {
4811
4815
  function useAttrs() {
4812
4816
  return getContext().attrs;
4813
4817
  }
4814
- function useModel(props, name, options = EMPTY_OBJ) {
4815
- const i = getCurrentInstance();
4816
- if (!i) {
4817
- warn$1(`useModel() called without active instance.`);
4818
- return ref();
4819
- }
4820
- if (!i.propsOptions[0][name]) {
4821
- warn$1(`useModel() called with prop "${name}" which is not declared.`);
4822
- return ref();
4823
- }
4824
- const camelizedName = camelize(name);
4825
- const hyphenatedName = hyphenate(name);
4826
- const res = customRef((track, trigger) => {
4827
- let localValue;
4828
- watchSyncEffect(() => {
4829
- const propValue = props[name];
4830
- if (hasChanged(localValue, propValue)) {
4831
- localValue = propValue;
4832
- trigger();
4833
- }
4834
- });
4835
- return {
4836
- get() {
4837
- track();
4838
- return options.get ? options.get(localValue) : localValue;
4839
- },
4840
- set(value) {
4841
- const rawProps = i.vnode.props;
4842
- if (!(rawProps && // check if parent has passed v-model
4843
- (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
4844
- localValue = value;
4845
- trigger();
4846
- }
4847
- i.emit(`update:${name}`, options.set ? options.set(value) : value);
4848
- }
4849
- };
4850
- });
4851
- const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
4852
- res[Symbol.iterator] = () => {
4853
- let i2 = 0;
4854
- return {
4855
- next() {
4856
- if (i2 < 2) {
4857
- return { value: i2++ ? props[modifierKey] || {} : res, done: false };
4858
- } else {
4859
- return { done: true };
4860
- }
4861
- }
4862
- };
4863
- };
4864
- return res;
4865
- }
4866
4818
  function getContext() {
4867
4819
  const i = getCurrentInstance();
4868
4820
  if (!i) {
@@ -6649,8 +6601,13 @@ function propHasMismatch(el, key, clientValue, vnode) {
6649
6601
  actual = el.hasAttribute(key);
6650
6602
  expected = includeBooleanAttr(clientValue);
6651
6603
  } else {
6652
- actual = el.hasAttribute(key) ? el.getAttribute(key) : key in el ? el[key] : "";
6653
- expected = clientValue == null ? "" : String(clientValue);
6604
+ if (el.hasAttribute(key)) {
6605
+ actual = el.getAttribute(key);
6606
+ } else {
6607
+ const serverValue = el[key];
6608
+ actual = isObject(serverValue) || serverValue == null ? "" : String(serverValue);
6609
+ }
6610
+ expected = isObject(clientValue) || clientValue == null ? "" : String(clientValue);
6654
6611
  }
6655
6612
  if (actual !== expected) {
6656
6613
  mismatchType = `attribute`;
@@ -6659,15 +6616,15 @@ function propHasMismatch(el, key, clientValue, vnode) {
6659
6616
  }
6660
6617
  if (mismatchType) {
6661
6618
  const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
6662
- warn$1(
6663
- `Hydration ${mismatchType} mismatch on`,
6664
- el,
6665
- `
6619
+ const preSegment = `Hydration ${mismatchType} mismatch on`;
6620
+ const postSegment = `
6666
6621
  - rendered on server: ${format(actual)}
6667
6622
  - expected on client: ${format(expected)}
6668
6623
  Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
6669
- You should fix the source of the mismatch.`
6670
- );
6624
+ You should fix the source of the mismatch.`;
6625
+ {
6626
+ warn$1(preSegment, el, postSegment);
6627
+ }
6671
6628
  return true;
6672
6629
  }
6673
6630
  return false;
@@ -9323,6 +9280,59 @@ const computed = (getterOrOptions, debugOptions) => {
9323
9280
  return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
9324
9281
  };
9325
9282
 
9283
+ function useModel(props, name, options = EMPTY_OBJ) {
9284
+ const i = getCurrentInstance();
9285
+ if (!i) {
9286
+ warn$1(`useModel() called without active instance.`);
9287
+ return ref();
9288
+ }
9289
+ if (!i.propsOptions[0][name]) {
9290
+ warn$1(`useModel() called with prop "${name}" which is not declared.`);
9291
+ return ref();
9292
+ }
9293
+ const camelizedName = camelize(name);
9294
+ const hyphenatedName = hyphenate(name);
9295
+ const res = customRef((track, trigger) => {
9296
+ let localValue;
9297
+ watchSyncEffect(() => {
9298
+ const propValue = props[name];
9299
+ if (hasChanged(localValue, propValue)) {
9300
+ localValue = propValue;
9301
+ trigger();
9302
+ }
9303
+ });
9304
+ return {
9305
+ get() {
9306
+ track();
9307
+ return options.get ? options.get(localValue) : localValue;
9308
+ },
9309
+ set(value) {
9310
+ const rawProps = i.vnode.props;
9311
+ if (!(rawProps && // check if parent has passed v-model
9312
+ (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
9313
+ localValue = value;
9314
+ trigger();
9315
+ }
9316
+ i.emit(`update:${name}`, options.set ? options.set(value) : value);
9317
+ }
9318
+ };
9319
+ });
9320
+ const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
9321
+ res[Symbol.iterator] = () => {
9322
+ let i2 = 0;
9323
+ return {
9324
+ next() {
9325
+ if (i2 < 2) {
9326
+ return { value: i2++ ? props[modifierKey] || {} : res, done: false };
9327
+ } else {
9328
+ return { done: true };
9329
+ }
9330
+ }
9331
+ };
9332
+ };
9333
+ return res;
9334
+ }
9335
+
9326
9336
  function h(type, propsOrChildren, children) {
9327
9337
  const l = arguments.length;
9328
9338
  if (l === 2) {
@@ -9545,7 +9555,7 @@ function isMemoSame(cached, memo) {
9545
9555
  return true;
9546
9556
  }
9547
9557
 
9548
- const version = "3.4.8";
9558
+ const version = "3.4.10";
9549
9559
  const warn = warn$1 ;
9550
9560
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9551
9561
  const devtools = devtools$1 ;
@@ -10014,6 +10024,7 @@ function setVarsOnNode(el, vars) {
10014
10024
 
10015
10025
  function patchStyle(el, prev, next) {
10016
10026
  const style = el.style;
10027
+ const currentDisplay = style.display;
10017
10028
  const isCssString = isString(next);
10018
10029
  if (next && !isCssString) {
10019
10030
  if (prev && !isString(prev)) {
@@ -10027,7 +10038,6 @@ function patchStyle(el, prev, next) {
10027
10038
  setStyle(style, key, next[key]);
10028
10039
  }
10029
10040
  } else {
10030
- const currentDisplay = style.display;
10031
10041
  if (isCssString) {
10032
10042
  if (prev !== next) {
10033
10043
  const cssVarText = style[CSS_VAR_TEXT];
@@ -10039,9 +10049,9 @@ function patchStyle(el, prev, next) {
10039
10049
  } else if (prev) {
10040
10050
  el.removeAttribute("style");
10041
10051
  }
10042
- if (vShowOldKey in el) {
10043
- style.display = currentDisplay;
10044
- }
10052
+ }
10053
+ if (vShowOldKey in el) {
10054
+ style.display = currentDisplay;
10045
10055
  }
10046
10056
  }
10047
10057
  const semicolonRE = /[^\\];\s*$/;