@vue/compat 3.3.8 → 3.3.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.
@@ -936,7 +936,7 @@ function createReadonlyMethod(type) {
936
936
  toRaw(this)
937
937
  );
938
938
  }
939
- return type === "delete" ? false : this;
939
+ return type === "delete" ? false : type === "clear" ? void 0 : this;
940
940
  };
941
941
  }
942
942
  function createInstrumentations() {
@@ -2664,9 +2664,19 @@ function renderComponentRoot(instance) {
2664
2664
  try {
2665
2665
  if (vnode.shapeFlag & 4) {
2666
2666
  const proxyToUse = withProxy || proxy;
2667
+ const thisProxy = setupState.__isScriptSetup ? new Proxy(proxyToUse, {
2668
+ get(target, key, receiver) {
2669
+ warn(
2670
+ `Property '${String(
2671
+ key
2672
+ )}' was accessed via 'this'. Avoid using 'this' in templates.`
2673
+ );
2674
+ return Reflect.get(target, key, receiver);
2675
+ }
2676
+ }) : proxyToUse;
2667
2677
  result = normalizeVNode(
2668
2678
  render.call(
2669
- proxyToUse,
2679
+ thisProxy,
2670
2680
  proxyToUse,
2671
2681
  renderCache,
2672
2682
  props,
@@ -3696,6 +3706,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3696
3706
  let onCleanup = (fn) => {
3697
3707
  cleanup = effect.onStop = () => {
3698
3708
  callWithErrorHandling(fn, instance, 4);
3709
+ cleanup = effect.onStop = void 0;
3699
3710
  };
3700
3711
  };
3701
3712
  let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
@@ -4172,7 +4183,11 @@ function emptyPlaceholder(vnode) {
4172
4183
  }
4173
4184
  }
4174
4185
  function getKeepAliveChild(vnode) {
4175
- return isKeepAlive(vnode) ? vnode.children ? vnode.children[0] : void 0 : vnode;
4186
+ return isKeepAlive(vnode) ? (
4187
+ // #7121 ensure get the child component subtree in case
4188
+ // it's been replaced during HMR
4189
+ vnode.component ? vnode.component.subTree : vnode.children ? vnode.children[0] : void 0
4190
+ ) : vnode;
4176
4191
  }
4177
4192
  function setTransitionHooks(vnode, hooks) {
4178
4193
  if (vnode.shapeFlag & 6 && vnode.component) {
@@ -6189,7 +6204,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6189
6204
  return vm;
6190
6205
  }
6191
6206
  }
6192
- Vue.version = `2.6.14-compat:${"3.3.8"}`;
6207
+ Vue.version = `2.6.14-compat:${"3.3.9"}`;
6193
6208
  Vue.config = singletonApp.config;
6194
6209
  Vue.use = (p, ...options) => {
6195
6210
  if (p && isFunction(p.install)) {
@@ -7217,6 +7232,9 @@ function assertType(value, type) {
7217
7232
  };
7218
7233
  }
7219
7234
  function getInvalidTypeMessage(name, value, expectedTypes) {
7235
+ if (expectedTypes.length === 0) {
7236
+ return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`;
7237
+ }
7220
7238
  let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
7221
7239
  const expectedType = expectedTypes[0];
7222
7240
  const receivedType = toRawType(value);
@@ -7488,6 +7506,20 @@ function createHydrationFunctions(rendererInternals) {
7488
7506
  const { type, ref, shapeFlag, patchFlag } = vnode;
7489
7507
  let domType = node.nodeType;
7490
7508
  vnode.el = node;
7509
+ {
7510
+ if (!("__vnode" in node)) {
7511
+ Object.defineProperty(node, "__vnode", {
7512
+ value: vnode,
7513
+ enumerable: false
7514
+ });
7515
+ }
7516
+ if (!("__vueParentComponent" in node)) {
7517
+ Object.defineProperty(node, "__vueParentComponent", {
7518
+ value: parentComponent,
7519
+ enumerable: false
7520
+ });
7521
+ }
7522
+ }
7491
7523
  if (patchFlag === -2) {
7492
7524
  optimized = false;
7493
7525
  vnode.dynamicChildren = null;
@@ -7649,15 +7681,16 @@ function createHydrationFunctions(rendererInternals) {
7649
7681
  const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
7650
7682
  optimized = optimized || !!vnode.dynamicChildren;
7651
7683
  const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
7652
- const forcePatchValue = type === "input" && dirs || type === "option";
7684
+ const forcePatch = type === "input" || type === "option";
7653
7685
  {
7654
7686
  if (dirs) {
7655
7687
  invokeDirectiveHook(vnode, null, parentComponent, "created");
7656
7688
  }
7657
7689
  if (props) {
7658
- if (forcePatchValue || !optimized || patchFlag & (16 | 32)) {
7690
+ if (forcePatch || !optimized || patchFlag & (16 | 32)) {
7659
7691
  for (const key in props) {
7660
- if (forcePatchValue && key.endsWith("value") || isOn(key) && !isReservedProp(key)) {
7692
+ if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
7693
+ key[0] === ".") {
7661
7694
  patchProp(
7662
7695
  el,
7663
7696
  key,
@@ -9448,6 +9481,7 @@ const resolveTarget = (props, select) => {
9448
9481
  }
9449
9482
  };
9450
9483
  const TeleportImpl = {
9484
+ name: "Teleport",
9451
9485
  __isTeleport: true,
9452
9486
  process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals) {
9453
9487
  const {
@@ -9927,7 +9961,7 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
9927
9961
  if (shapeFlag & 4 && isProxy(type)) {
9928
9962
  type = toRaw(type);
9929
9963
  warn(
9930
- `Vue received a Component which was made a reactive object. This can lead to unnecessary performance overhead, and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`,
9964
+ `Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`,
9931
9965
  `
9932
9966
  Component that was made reactive: `,
9933
9967
  type
@@ -10763,7 +10797,7 @@ function isMemoSame(cached, memo) {
10763
10797
  return true;
10764
10798
  }
10765
10799
 
10766
- const version = "3.3.8";
10800
+ const version = "3.3.9";
10767
10801
  const ssrUtils = null;
10768
10802
  const resolveFilter = resolveFilter$1 ;
10769
10803
  const _compatUtils = {
@@ -12004,21 +12038,20 @@ const vModelText = {
12004
12038
  el[assignKey] = getModelAssigner(vnode);
12005
12039
  if (el.composing)
12006
12040
  return;
12041
+ const elValue = number || el.type === "number" ? looseToNumber(el.value) : el.value;
12042
+ const newValue = value == null ? "" : value;
12043
+ if (elValue === newValue) {
12044
+ return;
12045
+ }
12007
12046
  if (document.activeElement === el && el.type !== "range") {
12008
12047
  if (lazy) {
12009
12048
  return;
12010
12049
  }
12011
- if (trim && el.value.trim() === value) {
12050
+ if (trim && el.value.trim() === newValue) {
12012
12051
  return;
12013
12052
  }
12014
- if ((number || el.type === "number") && looseToNumber(el.value) === value) {
12015
- return;
12016
- }
12017
- }
12018
- const newValue = value == null ? "" : value;
12019
- if (el.value !== newValue) {
12020
- el.value = newValue;
12021
12053
  }
12054
+ el.value = newValue;
12022
12055
  }
12023
12056
  };
12024
12057
  const vModelCheckbox = {