@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
  **/
@@ -3201,6 +3201,10 @@ const SuspenseImpl = {
3201
3201
  rendererInternals
3202
3202
  );
3203
3203
  } else {
3204
+ if (parentSuspense && parentSuspense.deps > 0) {
3205
+ n2.suspense = n1.suspense;
3206
+ return;
3207
+ }
3204
3208
  patchSuspense(
3205
3209
  n1,
3206
3210
  n2,
@@ -5876,58 +5880,6 @@ function useSlots() {
5876
5880
  function useAttrs() {
5877
5881
  return getContext().attrs;
5878
5882
  }
5879
- function useModel(props, name, options = EMPTY_OBJ) {
5880
- const i = getCurrentInstance();
5881
- if (!!(process.env.NODE_ENV !== "production") && !i) {
5882
- warn$1(`useModel() called without active instance.`);
5883
- return ref();
5884
- }
5885
- if (!!(process.env.NODE_ENV !== "production") && !i.propsOptions[0][name]) {
5886
- warn$1(`useModel() called with prop "${name}" which is not declared.`);
5887
- return ref();
5888
- }
5889
- const camelizedName = camelize(name);
5890
- const hyphenatedName = hyphenate(name);
5891
- const res = customRef((track, trigger) => {
5892
- let localValue;
5893
- watchSyncEffect(() => {
5894
- const propValue = props[name];
5895
- if (hasChanged(localValue, propValue)) {
5896
- localValue = propValue;
5897
- trigger();
5898
- }
5899
- });
5900
- return {
5901
- get() {
5902
- track();
5903
- return options.get ? options.get(localValue) : localValue;
5904
- },
5905
- set(value) {
5906
- const rawProps = i.vnode.props;
5907
- if (!(rawProps && // check if parent has passed v-model
5908
- (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
5909
- localValue = value;
5910
- trigger();
5911
- }
5912
- i.emit(`update:${name}`, options.set ? options.set(value) : value);
5913
- }
5914
- };
5915
- });
5916
- const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
5917
- res[Symbol.iterator] = () => {
5918
- let i2 = 0;
5919
- return {
5920
- next() {
5921
- if (i2 < 2) {
5922
- return { value: i2++ ? props[modifierKey] || {} : res, done: false };
5923
- } else {
5924
- return { done: true };
5925
- }
5926
- }
5927
- };
5928
- };
5929
- return res;
5930
- }
5931
5883
  function getContext() {
5932
5884
  const i = getCurrentInstance();
5933
5885
  if (!!(process.env.NODE_ENV !== "production") && !i) {
@@ -6501,7 +6453,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6501
6453
  return vm;
6502
6454
  }
6503
6455
  }
6504
- Vue.version = `2.6.14-compat:${"3.4.8"}`;
6456
+ Vue.version = `2.6.14-compat:${"3.4.9"}`;
6505
6457
  Vue.config = singletonApp.config;
6506
6458
  Vue.use = (p, ...options) => {
6507
6459
  if (p && isFunction(p.install)) {
@@ -8265,8 +8217,17 @@ function propHasMismatch(el, key, clientValue, vnode) {
8265
8217
  actual = el.hasAttribute(key);
8266
8218
  expected = includeBooleanAttr(clientValue);
8267
8219
  } else {
8268
- actual = el.hasAttribute(key) ? el.getAttribute(key) : key in el ? el[key] : "";
8269
- expected = clientValue == null ? "" : String(clientValue);
8220
+ if (el.hasAttribute(key)) {
8221
+ actual = el.getAttribute(key);
8222
+ } else if (key in el) {
8223
+ const serverValue = el[key];
8224
+ if (!isObject(serverValue)) {
8225
+ actual = serverValue == null ? "" : String(serverValue);
8226
+ }
8227
+ }
8228
+ if (!isObject(clientValue)) {
8229
+ expected = clientValue == null ? "" : String(clientValue);
8230
+ }
8270
8231
  }
8271
8232
  if (actual !== expected) {
8272
8233
  mismatchType = `attribute`;
@@ -8275,15 +8236,15 @@ function propHasMismatch(el, key, clientValue, vnode) {
8275
8236
  }
8276
8237
  if (mismatchType) {
8277
8238
  const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
8278
- warn$1(
8279
- `Hydration ${mismatchType} mismatch on`,
8280
- el,
8281
- `
8239
+ const preSegment = `Hydration ${mismatchType} mismatch on`;
8240
+ const postSegment = `
8282
8241
  - rendered on server: ${format(actual)}
8283
8242
  - expected on client: ${format(expected)}
8284
8243
  Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
8285
- You should fix the source of the mismatch.`
8286
- );
8244
+ You should fix the source of the mismatch.`;
8245
+ {
8246
+ warn$1(preSegment, el, postSegment);
8247
+ }
8287
8248
  return true;
8288
8249
  }
8289
8250
  return false;
@@ -11117,6 +11078,59 @@ const computed = (getterOrOptions, debugOptions) => {
11117
11078
  return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
11118
11079
  };
11119
11080
 
11081
+ function useModel(props, name, options = EMPTY_OBJ) {
11082
+ const i = getCurrentInstance();
11083
+ if (!!(process.env.NODE_ENV !== "production") && !i) {
11084
+ warn$1(`useModel() called without active instance.`);
11085
+ return ref();
11086
+ }
11087
+ if (!!(process.env.NODE_ENV !== "production") && !i.propsOptions[0][name]) {
11088
+ warn$1(`useModel() called with prop "${name}" which is not declared.`);
11089
+ return ref();
11090
+ }
11091
+ const camelizedName = camelize(name);
11092
+ const hyphenatedName = hyphenate(name);
11093
+ const res = customRef((track, trigger) => {
11094
+ let localValue;
11095
+ watchSyncEffect(() => {
11096
+ const propValue = props[name];
11097
+ if (hasChanged(localValue, propValue)) {
11098
+ localValue = propValue;
11099
+ trigger();
11100
+ }
11101
+ });
11102
+ return {
11103
+ get() {
11104
+ track();
11105
+ return options.get ? options.get(localValue) : localValue;
11106
+ },
11107
+ set(value) {
11108
+ const rawProps = i.vnode.props;
11109
+ if (!(rawProps && // check if parent has passed v-model
11110
+ (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
11111
+ localValue = value;
11112
+ trigger();
11113
+ }
11114
+ i.emit(`update:${name}`, options.set ? options.set(value) : value);
11115
+ }
11116
+ };
11117
+ });
11118
+ const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
11119
+ res[Symbol.iterator] = () => {
11120
+ let i2 = 0;
11121
+ return {
11122
+ next() {
11123
+ if (i2 < 2) {
11124
+ return { value: i2++ ? props[modifierKey] || {} : res, done: false };
11125
+ } else {
11126
+ return { done: true };
11127
+ }
11128
+ }
11129
+ };
11130
+ };
11131
+ return res;
11132
+ }
11133
+
11120
11134
  function h(type, propsOrChildren, children) {
11121
11135
  const l = arguments.length;
11122
11136
  if (l === 2) {
@@ -11339,11 +11353,11 @@ function isMemoSame(cached, memo) {
11339
11353
  return true;
11340
11354
  }
11341
11355
 
11342
- const version = "3.4.8";
11356
+ const version = "3.4.9";
11343
11357
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
11344
11358
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11345
- const devtools = !!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__ ? devtools$1 : void 0;
11346
- const setDevtoolsHook = !!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__ ? setDevtoolsHook$1 : NOOP;
11359
+ const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
11360
+ const setDevtoolsHook = !!(process.env.NODE_ENV !== "production") || true ? setDevtoolsHook$1 : NOOP;
11347
11361
  const _ssrUtils = {
11348
11362
  createComponentInstance,
11349
11363
  setupComponent,
@@ -11867,6 +11881,7 @@ function setVarsOnNode(el, vars) {
11867
11881
 
11868
11882
  function patchStyle(el, prev, next) {
11869
11883
  const style = el.style;
11884
+ const currentDisplay = style.display;
11870
11885
  const isCssString = isString(next);
11871
11886
  if (next && !isCssString) {
11872
11887
  if (prev && !isString(prev)) {
@@ -11880,7 +11895,6 @@ function patchStyle(el, prev, next) {
11880
11895
  setStyle(style, key, next[key]);
11881
11896
  }
11882
11897
  } else {
11883
- const currentDisplay = style.display;
11884
11898
  if (isCssString) {
11885
11899
  if (prev !== next) {
11886
11900
  const cssVarText = style[CSS_VAR_TEXT];
@@ -11892,9 +11906,9 @@ function patchStyle(el, prev, next) {
11892
11906
  } else if (prev) {
11893
11907
  el.removeAttribute("style");
11894
11908
  }
11895
- if (vShowOldKey in el) {
11896
- style.display = currentDisplay;
11897
- }
11909
+ }
11910
+ if (vShowOldKey in el) {
11911
+ style.display = currentDisplay;
11898
11912
  }
11899
11913
  }
11900
11914
  const semicolonRE = /[^\\];\s*$/;
@@ -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
  **/
@@ -3197,6 +3197,10 @@ If this is a native custom element, make sure to exclude it from component resol
3197
3197
  rendererInternals
3198
3198
  );
3199
3199
  } else {
3200
+ if (parentSuspense && parentSuspense.deps > 0) {
3201
+ n2.suspense = n1.suspense;
3202
+ return;
3203
+ }
3200
3204
  patchSuspense(
3201
3205
  n1,
3202
3206
  n2,
@@ -5837,58 +5841,6 @@ If this is a native custom element, make sure to exclude it from component resol
5837
5841
  function useAttrs() {
5838
5842
  return getContext().attrs;
5839
5843
  }
5840
- function useModel(props, name, options = EMPTY_OBJ) {
5841
- const i = getCurrentInstance();
5842
- if (!i) {
5843
- warn$1(`useModel() called without active instance.`);
5844
- return ref();
5845
- }
5846
- if (!i.propsOptions[0][name]) {
5847
- warn$1(`useModel() called with prop "${name}" which is not declared.`);
5848
- return ref();
5849
- }
5850
- const camelizedName = camelize(name);
5851
- const hyphenatedName = hyphenate(name);
5852
- const res = customRef((track, trigger) => {
5853
- let localValue;
5854
- watchSyncEffect(() => {
5855
- const propValue = props[name];
5856
- if (hasChanged(localValue, propValue)) {
5857
- localValue = propValue;
5858
- trigger();
5859
- }
5860
- });
5861
- return {
5862
- get() {
5863
- track();
5864
- return options.get ? options.get(localValue) : localValue;
5865
- },
5866
- set(value) {
5867
- const rawProps = i.vnode.props;
5868
- if (!(rawProps && // check if parent has passed v-model
5869
- (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
5870
- localValue = value;
5871
- trigger();
5872
- }
5873
- i.emit(`update:${name}`, options.set ? options.set(value) : value);
5874
- }
5875
- };
5876
- });
5877
- const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
5878
- res[Symbol.iterator] = () => {
5879
- let i2 = 0;
5880
- return {
5881
- next() {
5882
- if (i2 < 2) {
5883
- return { value: i2++ ? props[modifierKey] || {} : res, done: false };
5884
- } else {
5885
- return { done: true };
5886
- }
5887
- }
5888
- };
5889
- };
5890
- return res;
5891
- }
5892
5844
  function getContext() {
5893
5845
  const i = getCurrentInstance();
5894
5846
  if (!i) {
@@ -6460,7 +6412,7 @@ If this is a native custom element, make sure to exclude it from component resol
6460
6412
  return vm;
6461
6413
  }
6462
6414
  }
6463
- Vue.version = `2.6.14-compat:${"3.4.8"}`;
6415
+ Vue.version = `2.6.14-compat:${"3.4.9"}`;
6464
6416
  Vue.config = singletonApp.config;
6465
6417
  Vue.use = (p, ...options) => {
6466
6418
  if (p && isFunction(p.install)) {
@@ -8211,8 +8163,17 @@ Server rendered element contains fewer child nodes than client vdom.`
8211
8163
  actual = el.hasAttribute(key);
8212
8164
  expected = includeBooleanAttr(clientValue);
8213
8165
  } else {
8214
- actual = el.hasAttribute(key) ? el.getAttribute(key) : key in el ? el[key] : "";
8215
- expected = clientValue == null ? "" : String(clientValue);
8166
+ if (el.hasAttribute(key)) {
8167
+ actual = el.getAttribute(key);
8168
+ } else if (key in el) {
8169
+ const serverValue = el[key];
8170
+ if (!isObject(serverValue)) {
8171
+ actual = serverValue == null ? "" : String(serverValue);
8172
+ }
8173
+ }
8174
+ if (!isObject(clientValue)) {
8175
+ expected = clientValue == null ? "" : String(clientValue);
8176
+ }
8216
8177
  }
8217
8178
  if (actual !== expected) {
8218
8179
  mismatchType = `attribute`;
@@ -8221,15 +8182,15 @@ Server rendered element contains fewer child nodes than client vdom.`
8221
8182
  }
8222
8183
  if (mismatchType) {
8223
8184
  const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
8224
- warn$1(
8225
- `Hydration ${mismatchType} mismatch on`,
8226
- el,
8227
- `
8185
+ const preSegment = `Hydration ${mismatchType} mismatch on`;
8186
+ const postSegment = `
8228
8187
  - rendered on server: ${format(actual)}
8229
8188
  - expected on client: ${format(expected)}
8230
8189
  Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
8231
- You should fix the source of the mismatch.`
8232
- );
8190
+ You should fix the source of the mismatch.`;
8191
+ {
8192
+ warn$1(preSegment, el, postSegment);
8193
+ }
8233
8194
  return true;
8234
8195
  }
8235
8196
  return false;
@@ -10992,6 +10953,59 @@ Component that was made reactive: `,
10992
10953
  return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
10993
10954
  };
10994
10955
 
10956
+ function useModel(props, name, options = EMPTY_OBJ) {
10957
+ const i = getCurrentInstance();
10958
+ if (!i) {
10959
+ warn$1(`useModel() called without active instance.`);
10960
+ return ref();
10961
+ }
10962
+ if (!i.propsOptions[0][name]) {
10963
+ warn$1(`useModel() called with prop "${name}" which is not declared.`);
10964
+ return ref();
10965
+ }
10966
+ const camelizedName = camelize(name);
10967
+ const hyphenatedName = hyphenate(name);
10968
+ const res = customRef((track, trigger) => {
10969
+ let localValue;
10970
+ watchSyncEffect(() => {
10971
+ const propValue = props[name];
10972
+ if (hasChanged(localValue, propValue)) {
10973
+ localValue = propValue;
10974
+ trigger();
10975
+ }
10976
+ });
10977
+ return {
10978
+ get() {
10979
+ track();
10980
+ return options.get ? options.get(localValue) : localValue;
10981
+ },
10982
+ set(value) {
10983
+ const rawProps = i.vnode.props;
10984
+ if (!(rawProps && // check if parent has passed v-model
10985
+ (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
10986
+ localValue = value;
10987
+ trigger();
10988
+ }
10989
+ i.emit(`update:${name}`, options.set ? options.set(value) : value);
10990
+ }
10991
+ };
10992
+ });
10993
+ const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
10994
+ res[Symbol.iterator] = () => {
10995
+ let i2 = 0;
10996
+ return {
10997
+ next() {
10998
+ if (i2 < 2) {
10999
+ return { value: i2++ ? props[modifierKey] || {} : res, done: false };
11000
+ } else {
11001
+ return { done: true };
11002
+ }
11003
+ }
11004
+ };
11005
+ };
11006
+ return res;
11007
+ }
11008
+
10995
11009
  function h(type, propsOrChildren, children) {
10996
11010
  const l = arguments.length;
10997
11011
  if (l === 2) {
@@ -11214,7 +11228,7 @@ Component that was made reactive: `,
11214
11228
  return true;
11215
11229
  }
11216
11230
 
11217
- const version = "3.4.8";
11231
+ const version = "3.4.9";
11218
11232
  const warn = warn$1 ;
11219
11233
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11220
11234
  const devtools = devtools$1 ;
@@ -11727,6 +11741,7 @@ Component that was made reactive: `,
11727
11741
 
11728
11742
  function patchStyle(el, prev, next) {
11729
11743
  const style = el.style;
11744
+ const currentDisplay = style.display;
11730
11745
  const isCssString = isString(next);
11731
11746
  if (next && !isCssString) {
11732
11747
  if (prev && !isString(prev)) {
@@ -11740,7 +11755,6 @@ Component that was made reactive: `,
11740
11755
  setStyle(style, key, next[key]);
11741
11756
  }
11742
11757
  } else {
11743
- const currentDisplay = style.display;
11744
11758
  if (isCssString) {
11745
11759
  if (prev !== next) {
11746
11760
  const cssVarText = style[CSS_VAR_TEXT];
@@ -11752,9 +11766,9 @@ Component that was made reactive: `,
11752
11766
  } else if (prev) {
11753
11767
  el.removeAttribute("style");
11754
11768
  }
11755
- if (vShowOldKey in el) {
11756
- style.display = currentDisplay;
11757
- }
11769
+ }
11770
+ if (vShowOldKey in el) {
11771
+ style.display = currentDisplay;
11758
11772
  }
11759
11773
  }
11760
11774
  const semicolonRE = /[^\\];\s*$/;