@vue/compat 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/compat v3.4.8
2
+ * @vue/compat v3.4.9
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -3194,6 +3194,10 @@ const SuspenseImpl = {
3194
3194
  rendererInternals
3195
3195
  );
3196
3196
  } else {
3197
+ if (parentSuspense && parentSuspense.deps > 0) {
3198
+ n2.suspense = n1.suspense;
3199
+ return;
3200
+ }
3197
3201
  patchSuspense(
3198
3202
  n1,
3199
3203
  n2,
@@ -5840,58 +5844,6 @@ function useSlots() {
5840
5844
  function useAttrs() {
5841
5845
  return getContext().attrs;
5842
5846
  }
5843
- function useModel(props, name, options = EMPTY_OBJ) {
5844
- const i = getCurrentInstance();
5845
- if (!i) {
5846
- warn$1(`useModel() called without active instance.`);
5847
- return ref();
5848
- }
5849
- if (!i.propsOptions[0][name]) {
5850
- warn$1(`useModel() called with prop "${name}" which is not declared.`);
5851
- return ref();
5852
- }
5853
- const camelizedName = camelize(name);
5854
- const hyphenatedName = hyphenate(name);
5855
- const res = customRef((track, trigger) => {
5856
- let localValue;
5857
- watchSyncEffect(() => {
5858
- const propValue = props[name];
5859
- if (hasChanged(localValue, propValue)) {
5860
- localValue = propValue;
5861
- trigger();
5862
- }
5863
- });
5864
- return {
5865
- get() {
5866
- track();
5867
- return options.get ? options.get(localValue) : localValue;
5868
- },
5869
- set(value) {
5870
- const rawProps = i.vnode.props;
5871
- if (!(rawProps && // check if parent has passed v-model
5872
- (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
5873
- localValue = value;
5874
- trigger();
5875
- }
5876
- i.emit(`update:${name}`, options.set ? options.set(value) : value);
5877
- }
5878
- };
5879
- });
5880
- const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
5881
- res[Symbol.iterator] = () => {
5882
- let i2 = 0;
5883
- return {
5884
- next() {
5885
- if (i2 < 2) {
5886
- return { value: i2++ ? props[modifierKey] || {} : res, done: false };
5887
- } else {
5888
- return { done: true };
5889
- }
5890
- }
5891
- };
5892
- };
5893
- return res;
5894
- }
5895
5847
  function getContext() {
5896
5848
  const i = getCurrentInstance();
5897
5849
  if (!i) {
@@ -6463,7 +6415,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6463
6415
  return vm;
6464
6416
  }
6465
6417
  }
6466
- Vue.version = `2.6.14-compat:${"3.4.8"}`;
6418
+ Vue.version = `2.6.14-compat:${"3.4.9"}`;
6467
6419
  Vue.config = singletonApp.config;
6468
6420
  Vue.use = (p, ...options) => {
6469
6421
  if (p && isFunction(p.install)) {
@@ -8214,8 +8166,17 @@ function propHasMismatch(el, key, clientValue, vnode) {
8214
8166
  actual = el.hasAttribute(key);
8215
8167
  expected = includeBooleanAttr(clientValue);
8216
8168
  } else {
8217
- actual = el.hasAttribute(key) ? el.getAttribute(key) : key in el ? el[key] : "";
8218
- expected = clientValue == null ? "" : String(clientValue);
8169
+ if (el.hasAttribute(key)) {
8170
+ actual = el.getAttribute(key);
8171
+ } else if (key in el) {
8172
+ const serverValue = el[key];
8173
+ if (!isObject(serverValue)) {
8174
+ actual = serverValue == null ? "" : String(serverValue);
8175
+ }
8176
+ }
8177
+ if (!isObject(clientValue)) {
8178
+ expected = clientValue == null ? "" : String(clientValue);
8179
+ }
8219
8180
  }
8220
8181
  if (actual !== expected) {
8221
8182
  mismatchType = `attribute`;
@@ -8224,15 +8185,15 @@ function propHasMismatch(el, key, clientValue, vnode) {
8224
8185
  }
8225
8186
  if (mismatchType) {
8226
8187
  const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
8227
- warn$1(
8228
- `Hydration ${mismatchType} mismatch on`,
8229
- el,
8230
- `
8188
+ const preSegment = `Hydration ${mismatchType} mismatch on`;
8189
+ const postSegment = `
8231
8190
  - rendered on server: ${format(actual)}
8232
8191
  - expected on client: ${format(expected)}
8233
8192
  Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
8234
- You should fix the source of the mismatch.`
8235
- );
8193
+ You should fix the source of the mismatch.`;
8194
+ {
8195
+ warn$1(preSegment, el, postSegment);
8196
+ }
8236
8197
  return true;
8237
8198
  }
8238
8199
  return false;
@@ -10995,6 +10956,59 @@ const computed = (getterOrOptions, debugOptions) => {
10995
10956
  return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
10996
10957
  };
10997
10958
 
10959
+ function useModel(props, name, options = EMPTY_OBJ) {
10960
+ const i = getCurrentInstance();
10961
+ if (!i) {
10962
+ warn$1(`useModel() called without active instance.`);
10963
+ return ref();
10964
+ }
10965
+ if (!i.propsOptions[0][name]) {
10966
+ warn$1(`useModel() called with prop "${name}" which is not declared.`);
10967
+ return ref();
10968
+ }
10969
+ const camelizedName = camelize(name);
10970
+ const hyphenatedName = hyphenate(name);
10971
+ const res = customRef((track, trigger) => {
10972
+ let localValue;
10973
+ watchSyncEffect(() => {
10974
+ const propValue = props[name];
10975
+ if (hasChanged(localValue, propValue)) {
10976
+ localValue = propValue;
10977
+ trigger();
10978
+ }
10979
+ });
10980
+ return {
10981
+ get() {
10982
+ track();
10983
+ return options.get ? options.get(localValue) : localValue;
10984
+ },
10985
+ set(value) {
10986
+ const rawProps = i.vnode.props;
10987
+ if (!(rawProps && // check if parent has passed v-model
10988
+ (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
10989
+ localValue = value;
10990
+ trigger();
10991
+ }
10992
+ i.emit(`update:${name}`, options.set ? options.set(value) : value);
10993
+ }
10994
+ };
10995
+ });
10996
+ const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
10997
+ res[Symbol.iterator] = () => {
10998
+ let i2 = 0;
10999
+ return {
11000
+ next() {
11001
+ if (i2 < 2) {
11002
+ return { value: i2++ ? props[modifierKey] || {} : res, done: false };
11003
+ } else {
11004
+ return { done: true };
11005
+ }
11006
+ }
11007
+ };
11008
+ };
11009
+ return res;
11010
+ }
11011
+
10998
11012
  function h(type, propsOrChildren, children) {
10999
11013
  const l = arguments.length;
11000
11014
  if (l === 2) {
@@ -11217,7 +11231,7 @@ function isMemoSame(cached, memo) {
11217
11231
  return true;
11218
11232
  }
11219
11233
 
11220
- const version = "3.4.8";
11234
+ const version = "3.4.9";
11221
11235
  const warn = warn$1 ;
11222
11236
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11223
11237
  const devtools = devtools$1 ;
@@ -11730,6 +11744,7 @@ function setVarsOnNode(el, vars) {
11730
11744
 
11731
11745
  function patchStyle(el, prev, next) {
11732
11746
  const style = el.style;
11747
+ const currentDisplay = style.display;
11733
11748
  const isCssString = isString(next);
11734
11749
  if (next && !isCssString) {
11735
11750
  if (prev && !isString(prev)) {
@@ -11743,7 +11758,6 @@ function patchStyle(el, prev, next) {
11743
11758
  setStyle(style, key, next[key]);
11744
11759
  }
11745
11760
  } else {
11746
- const currentDisplay = style.display;
11747
11761
  if (isCssString) {
11748
11762
  if (prev !== next) {
11749
11763
  const cssVarText = style[CSS_VAR_TEXT];
@@ -11755,9 +11769,9 @@ function patchStyle(el, prev, next) {
11755
11769
  } else if (prev) {
11756
11770
  el.removeAttribute("style");
11757
11771
  }
11758
- if (vShowOldKey in el) {
11759
- style.display = currentDisplay;
11760
- }
11772
+ }
11773
+ if (vShowOldKey in el) {
11774
+ style.display = currentDisplay;
11761
11775
  }
11762
11776
  }
11763
11777
  const semicolonRE = /[^\\];\s*$/;