@cabloy/vue-runtime-core 3.4.40 → 3.4.42

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.
@@ -3854,6 +3854,12 @@ function createHydrationFunctions(rendererInternals) {
3854
3854
  }
3855
3855
  return nextNode;
3856
3856
  };
3857
+ function _getValidZova(instance) {
3858
+ while (instance) {
3859
+ if (instance.zova) return instance.zova;
3860
+ instance = instance.parent;
3861
+ }
3862
+ }
3857
3863
  const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
3858
3864
  optimized = optimized || !!vnode.dynamicChildren;
3859
3865
  const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
@@ -3916,10 +3922,29 @@ Server rendered element contains more child nodes than client vdom.`
3916
3922
  {
3917
3923
  const isCustomElement = el.tagName.includes("-");
3918
3924
  for (const key in props) {
3919
- if (// #11189 skip if this node has directives that have created hooks
3920
- // as it could have mutated the DOM in any possible way
3921
- !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) {
3922
- logMismatchError();
3925
+ let ignore;
3926
+ let clientValue = props[key];
3927
+ const zova = _getValidZova(parentComponent);
3928
+ if (zova) {
3929
+ const res = zova.meta.ssr._hydratePropHasMismatch(
3930
+ el,
3931
+ key,
3932
+ clientValue,
3933
+ vnode,
3934
+ parentComponent
3935
+ );
3936
+ if (res.ignore) {
3937
+ ignore = true;
3938
+ } else {
3939
+ clientValue = res.clientValue;
3940
+ }
3941
+ }
3942
+ if (!ignore) {
3943
+ if (// #11189 skip if this node has directives that have created hooks
3944
+ // as it could have mutated the DOM in any possible way
3945
+ !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, clientValue, vnode, parentComponent)) {
3946
+ logMismatchError();
3947
+ }
3923
3948
  }
3924
3949
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || shared.isOn(key) && !shared.isReservedProp(key) || // force hydrate v-bind with .prop modifiers
3925
3950
  key[0] === "." || isCustomElement) {
@@ -4098,27 +4123,11 @@ Server rendered element contains fewer child nodes than client vdom.`
4098
4123
  };
4099
4124
  return [hydrate, hydrateNode];
4100
4125
  }
4101
- function _getValidZova(instance) {
4102
- while (instance) {
4103
- if (instance.zova) return instance.zova;
4104
- instance = instance.parent;
4105
- }
4106
- }
4107
4126
  function propHasMismatch(el, key, clientValue, vnode, instance) {
4108
4127
  let mismatchType;
4109
4128
  let mismatchKey;
4110
4129
  let actual;
4111
4130
  let expected;
4112
- const zova = _getValidZova(instance);
4113
- if (zova) {
4114
- clientValue = zova.meta.ssr._hydratePropHasMismatch(
4115
- el,
4116
- key,
4117
- clientValue,
4118
- vnode,
4119
- instance
4120
- );
4121
- }
4122
4131
  if (key === "class") {
4123
4132
  actual = el.getAttribute("class");
4124
4133
  expected = shared.normalizeClass(clientValue);
@@ -2903,6 +2903,12 @@ function createHydrationFunctions(rendererInternals) {
2903
2903
  }
2904
2904
  return nextNode;
2905
2905
  };
2906
+ function _getValidZova(instance) {
2907
+ while (instance) {
2908
+ if (instance.zova) return instance.zova;
2909
+ instance = instance.parent;
2910
+ }
2911
+ }
2906
2912
  const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
2907
2913
  optimized = optimized || !!vnode.dynamicChildren;
2908
2914
  const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
@@ -2948,6 +2954,20 @@ function createHydrationFunctions(rendererInternals) {
2948
2954
  if (forcePatch || !optimized || patchFlag & (16 | 32)) {
2949
2955
  const isCustomElement = el.tagName.includes("-");
2950
2956
  for (const key in props) {
2957
+ let clientValue = props[key];
2958
+ const zova = _getValidZova(parentComponent);
2959
+ if (zova) {
2960
+ const res = zova.meta.ssr._hydratePropHasMismatch(
2961
+ el,
2962
+ key,
2963
+ clientValue,
2964
+ vnode,
2965
+ parentComponent
2966
+ );
2967
+ if (res.ignore) ; else {
2968
+ clientValue = res.clientValue;
2969
+ }
2970
+ }
2951
2971
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || shared.isOn(key) && !shared.isReservedProp(key) || // force hydrate v-bind with .prop modifiers
2952
2972
  key[0] === "." || isCustomElement) {
2953
2973
  patchProp(el, key, null, props[key], void 0, parentComponent);
@@ -3860,6 +3860,12 @@ function createHydrationFunctions(rendererInternals) {
3860
3860
  }
3861
3861
  return nextNode;
3862
3862
  };
3863
+ function _getValidZova(instance) {
3864
+ while (instance) {
3865
+ if (instance.zova) return instance.zova;
3866
+ instance = instance.parent;
3867
+ }
3868
+ }
3863
3869
  const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
3864
3870
  optimized = optimized || !!vnode.dynamicChildren;
3865
3871
  const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
@@ -3922,10 +3928,29 @@ Server rendered element contains more child nodes than client vdom.`
3922
3928
  if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ || forcePatch || !optimized || patchFlag & (16 | 32)) {
3923
3929
  const isCustomElement = el.tagName.includes("-");
3924
3930
  for (const key in props) {
3925
- if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && // #11189 skip if this node has directives that have created hooks
3926
- // as it could have mutated the DOM in any possible way
3927
- !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) {
3928
- logMismatchError();
3931
+ let ignore;
3932
+ let clientValue = props[key];
3933
+ const zova = _getValidZova(parentComponent);
3934
+ if (zova) {
3935
+ const res = zova.meta.ssr._hydratePropHasMismatch(
3936
+ el,
3937
+ key,
3938
+ clientValue,
3939
+ vnode,
3940
+ parentComponent
3941
+ );
3942
+ if (res.ignore) {
3943
+ ignore = true;
3944
+ } else {
3945
+ clientValue = res.clientValue;
3946
+ }
3947
+ }
3948
+ if (!ignore) {
3949
+ if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && // #11189 skip if this node has directives that have created hooks
3950
+ // as it could have mutated the DOM in any possible way
3951
+ !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, clientValue, vnode, parentComponent)) {
3952
+ logMismatchError();
3953
+ }
3929
3954
  }
3930
3955
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
3931
3956
  key[0] === "." || isCustomElement) {
@@ -4115,27 +4140,11 @@ Server rendered element contains fewer child nodes than client vdom.`
4115
4140
  };
4116
4141
  return [hydrate, hydrateNode];
4117
4142
  }
4118
- function _getValidZova(instance) {
4119
- while (instance) {
4120
- if (instance.zova) return instance.zova;
4121
- instance = instance.parent;
4122
- }
4123
- }
4124
4143
  function propHasMismatch(el, key, clientValue, vnode, instance) {
4125
4144
  let mismatchType;
4126
4145
  let mismatchKey;
4127
4146
  let actual;
4128
4147
  let expected;
4129
- const zova = _getValidZova(instance);
4130
- if (zova) {
4131
- clientValue = zova.meta.ssr._hydratePropHasMismatch(
4132
- el,
4133
- key,
4134
- clientValue,
4135
- vnode,
4136
- instance
4137
- );
4138
- }
4139
4148
  if (key === "class") {
4140
4149
  actual = el.getAttribute("class");
4141
4150
  expected = normalizeClass(clientValue);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cabloy/vue-runtime-core",
3
- "version": "3.4.40",
3
+ "version": "3.4.42",
4
4
  "description": "@vue/runtime-core",
5
5
  "main": "index.js",
6
6
  "module": "dist/runtime-core.esm-bundler.js",
@@ -47,6 +47,6 @@
47
47
  "homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
48
48
  "dependencies": {
49
49
  "@vue/shared": "3.4.37",
50
- "@vue/reactivity": "npm:@cabloy/vue-reactivity@3.4.40"
50
+ "@vue/reactivity": "npm:@cabloy/vue-reactivity@3.4.42"
51
51
  }
52
52
  }