@vue/compat 3.4.0-rc.3 → 3.4.1

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.
@@ -3794,6 +3794,19 @@ function mapCompatDirectiveHook(name, dir, instance) {
3794
3794
  }
3795
3795
  }
3796
3796
 
3797
+ const ssrContextKey = Symbol.for("v-scx");
3798
+ const useSSRContext = () => {
3799
+ {
3800
+ const ctx = inject(ssrContextKey);
3801
+ if (!ctx) {
3802
+ !!(process.env.NODE_ENV !== "production") && warn$1(
3803
+ `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`
3804
+ );
3805
+ }
3806
+ return ctx;
3807
+ }
3808
+ };
3809
+
3797
3810
  function watchEffect(effect, options) {
3798
3811
  return doWatch(effect, null, options);
3799
3812
  }
@@ -5857,6 +5870,7 @@ function useModel(props, name, options = EMPTY_OBJ) {
5857
5870
  warn$1(`useModel() called with prop "${name}" which is not declared.`);
5858
5871
  return ref();
5859
5872
  }
5873
+ const camelizedName = camelize(name);
5860
5874
  const res = customRef((track, trigger) => {
5861
5875
  let localValue;
5862
5876
  watchSyncEffect(() => {
@@ -5873,7 +5887,8 @@ function useModel(props, name, options = EMPTY_OBJ) {
5873
5887
  },
5874
5888
  set(value) {
5875
5889
  const rawProps = i.vnode.props;
5876
- if (!(rawProps && name in rawProps) && hasChanged(value, localValue)) {
5890
+ if (!(rawProps && // check if parent has passed v-model
5891
+ (name in rawProps || camelizedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps)) && hasChanged(value, localValue)) {
5877
5892
  localValue = value;
5878
5893
  trigger();
5879
5894
  }
@@ -5887,7 +5902,7 @@ function useModel(props, name, options = EMPTY_OBJ) {
5887
5902
  return {
5888
5903
  next() {
5889
5904
  if (i2 < 2) {
5890
- return { value: i2++ ? props[modifierKey] : res, done: false };
5905
+ return { value: i2++ ? props[modifierKey] || {} : res, done: false };
5891
5906
  } else {
5892
5907
  return { done: true };
5893
5908
  }
@@ -6469,7 +6484,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6469
6484
  return vm;
6470
6485
  }
6471
6486
  }
6472
- Vue.version = `2.6.14-compat:${"3.4.0-rc.3"}`;
6487
+ Vue.version = `2.6.14-compat:${"3.4.1"}`;
6473
6488
  Vue.config = singletonApp.config;
6474
6489
  Vue.use = (p, ...options) => {
6475
6490
  if (p && isFunction(p.install)) {
@@ -11055,19 +11070,6 @@ function h(type, propsOrChildren, children) {
11055
11070
  }
11056
11071
  }
11057
11072
 
11058
- const ssrContextKey = Symbol.for("v-scx");
11059
- const useSSRContext = () => {
11060
- {
11061
- const ctx = inject(ssrContextKey);
11062
- if (!ctx) {
11063
- !!(process.env.NODE_ENV !== "production") && warn$1(
11064
- `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`
11065
- );
11066
- }
11067
- return ctx;
11068
- }
11069
- };
11070
-
11071
11073
  function initCustomFormatter() {
11072
11074
  if (!!!(process.env.NODE_ENV !== "production") || typeof window === "undefined") {
11073
11075
  return;
@@ -11269,7 +11271,7 @@ function isMemoSame(cached, memo) {
11269
11271
  return true;
11270
11272
  }
11271
11273
 
11272
- const version = "3.4.0-rc.3";
11274
+ const version = "3.4.1";
11273
11275
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
11274
11276
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11275
11277
  const devtools = !!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__ ? devtools$1 : void 0;
@@ -3790,6 +3790,13 @@ If this is a native custom element, make sure to exclude it from component resol
3790
3790
  }
3791
3791
  }
3792
3792
 
3793
+ const ssrContextKey = Symbol.for("v-scx");
3794
+ const useSSRContext = () => {
3795
+ {
3796
+ warn$1(`useSSRContext() is not supported in the global build.`);
3797
+ }
3798
+ };
3799
+
3793
3800
  function watchEffect(effect, options) {
3794
3801
  return doWatch(effect, null, options);
3795
3802
  }
@@ -5824,6 +5831,7 @@ If this is a native custom element, make sure to exclude it from component resol
5824
5831
  warn$1(`useModel() called with prop "${name}" which is not declared.`);
5825
5832
  return ref();
5826
5833
  }
5834
+ const camelizedName = camelize(name);
5827
5835
  const res = customRef((track, trigger) => {
5828
5836
  let localValue;
5829
5837
  watchSyncEffect(() => {
@@ -5840,7 +5848,8 @@ If this is a native custom element, make sure to exclude it from component resol
5840
5848
  },
5841
5849
  set(value) {
5842
5850
  const rawProps = i.vnode.props;
5843
- if (!(rawProps && name in rawProps) && hasChanged(value, localValue)) {
5851
+ if (!(rawProps && // check if parent has passed v-model
5852
+ (name in rawProps || camelizedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps)) && hasChanged(value, localValue)) {
5844
5853
  localValue = value;
5845
5854
  trigger();
5846
5855
  }
@@ -5854,7 +5863,7 @@ If this is a native custom element, make sure to exclude it from component resol
5854
5863
  return {
5855
5864
  next() {
5856
5865
  if (i2 < 2) {
5857
- return { value: i2++ ? props[modifierKey] : res, done: false };
5866
+ return { value: i2++ ? props[modifierKey] || {} : res, done: false };
5858
5867
  } else {
5859
5868
  return { done: true };
5860
5869
  }
@@ -6434,7 +6443,7 @@ If this is a native custom element, make sure to exclude it from component resol
6434
6443
  return vm;
6435
6444
  }
6436
6445
  }
6437
- Vue.version = `2.6.14-compat:${"3.4.0-rc.3"}`;
6446
+ Vue.version = `2.6.14-compat:${"3.4.1"}`;
6438
6447
  Vue.config = singletonApp.config;
6439
6448
  Vue.use = (p, ...options) => {
6440
6449
  if (p && isFunction(p.install)) {
@@ -10936,13 +10945,6 @@ Component that was made reactive: `,
10936
10945
  }
10937
10946
  }
10938
10947
 
10939
- const ssrContextKey = Symbol.for("v-scx");
10940
- const useSSRContext = () => {
10941
- {
10942
- warn$1(`useSSRContext() is not supported in the global build.`);
10943
- }
10944
- };
10945
-
10946
10948
  function initCustomFormatter() {
10947
10949
  if (typeof window === "undefined") {
10948
10950
  return;
@@ -11144,7 +11146,7 @@ Component that was made reactive: `,
11144
11146
  return true;
11145
11147
  }
11146
11148
 
11147
- const version = "3.4.0-rc.3";
11149
+ const version = "3.4.1";
11148
11150
  const warn = warn$1 ;
11149
11151
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11150
11152
  const devtools = devtools$1 ;