vue 3.4.8 → 3.4.9

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