@vue/compat 3.5.3 → 3.5.5

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.5.3
2
+ * @vue/compat v3.5.5
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -8,9 +8,10 @@ var Vue = (function () {
8
8
 
9
9
  /*! #__NO_SIDE_EFFECTS__ */
10
10
  // @__NO_SIDE_EFFECTS__
11
- function makeMap(str, expectsLowerCase) {
12
- const set = new Set(str.split(","));
13
- return (val) => set.has(val);
11
+ function makeMap(str) {
12
+ const map = /* @__PURE__ */ Object.create(null);
13
+ for (const key of str.split(",")) map[key] = 1;
14
+ return (val) => val in map;
14
15
  }
15
16
 
16
17
  const EMPTY_OBJ = Object.freeze({}) ;
@@ -598,9 +599,11 @@ var Vue = (function () {
598
599
  function cleanupDeps(sub) {
599
600
  let head;
600
601
  let tail = sub.depsTail;
601
- for (let link = tail; link; link = link.prevDep) {
602
+ let link = tail;
603
+ while (link) {
604
+ const prev = link.prevDep;
602
605
  if (link.version === -1) {
603
- if (link === tail) tail = link.prevDep;
606
+ if (link === tail) tail = prev;
604
607
  removeSub(link);
605
608
  removeDep(link);
606
609
  } else {
@@ -608,13 +611,14 @@ var Vue = (function () {
608
611
  }
609
612
  link.dep.activeLink = link.prevActiveLink;
610
613
  link.prevActiveLink = void 0;
614
+ link = prev;
611
615
  }
612
616
  sub.deps = head;
613
617
  sub.depsTail = tail;
614
618
  }
615
619
  function isDirty(sub) {
616
620
  for (let link = sub.deps; link; link = link.nextDep) {
617
- if (link.dep.version !== link.version || link.dep.computed && refreshComputed(link.dep.computed) === false || link.dep.version !== link.version) {
621
+ if (link.dep.version !== link.version || link.dep.computed && refreshComputed(link.dep.computed) || link.dep.version !== link.version) {
618
622
  return true;
619
623
  }
620
624
  }
@@ -624,9 +628,6 @@ var Vue = (function () {
624
628
  return false;
625
629
  }
626
630
  function refreshComputed(computed) {
627
- if (computed.flags & 2) {
628
- return false;
629
- }
630
631
  if (computed.flags & 4 && !(computed.flags & 16)) {
631
632
  return;
632
633
  }
@@ -739,6 +740,14 @@ var Vue = (function () {
739
740
  }
740
741
 
741
742
  let globalVersion = 0;
743
+ class Link {
744
+ constructor(sub, dep) {
745
+ this.sub = sub;
746
+ this.dep = dep;
747
+ this.version = dep.version;
748
+ this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
749
+ }
750
+ }
742
751
  class Dep {
743
752
  constructor(computed) {
744
753
  this.computed = computed;
@@ -761,16 +770,7 @@ var Vue = (function () {
761
770
  }
762
771
  let link = this.activeLink;
763
772
  if (link === void 0 || link.sub !== activeSub) {
764
- link = this.activeLink = {
765
- dep: this,
766
- sub: activeSub,
767
- version: this.version,
768
- nextDep: void 0,
769
- prevDep: void 0,
770
- nextSub: void 0,
771
- prevSub: void 0,
772
- prevActiveLink: void 0
773
- };
773
+ link = this.activeLink = new Link(activeSub, this);
774
774
  if (!activeSub.deps) {
775
775
  activeSub.deps = activeSub.depsTail = link;
776
776
  } else {
@@ -893,9 +893,23 @@ var Vue = (function () {
893
893
  globalVersion++;
894
894
  return;
895
895
  }
896
- let deps = [];
896
+ const run = (dep) => {
897
+ if (dep) {
898
+ {
899
+ dep.trigger({
900
+ target,
901
+ type,
902
+ key,
903
+ newValue,
904
+ oldValue,
905
+ oldTarget
906
+ });
907
+ }
908
+ }
909
+ };
910
+ startBatch();
897
911
  if (type === "clear") {
898
- deps = [...depsMap.values()];
912
+ depsMap.forEach(run);
899
913
  } else {
900
914
  const targetIsArray = isArray(target);
901
915
  const isArrayIndex = targetIsArray && isIntegerKey(key);
@@ -903,57 +917,43 @@ var Vue = (function () {
903
917
  const newLength = Number(newValue);
904
918
  depsMap.forEach((dep, key2) => {
905
919
  if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) {
906
- deps.push(dep);
920
+ run(dep);
907
921
  }
908
922
  });
909
923
  } else {
910
- const push = (dep) => dep && deps.push(dep);
911
924
  if (key !== void 0) {
912
- push(depsMap.get(key));
925
+ run(depsMap.get(key));
913
926
  }
914
927
  if (isArrayIndex) {
915
- push(depsMap.get(ARRAY_ITERATE_KEY));
928
+ run(depsMap.get(ARRAY_ITERATE_KEY));
916
929
  }
917
930
  switch (type) {
918
931
  case "add":
919
932
  if (!targetIsArray) {
920
- push(depsMap.get(ITERATE_KEY));
933
+ run(depsMap.get(ITERATE_KEY));
921
934
  if (isMap(target)) {
922
- push(depsMap.get(MAP_KEY_ITERATE_KEY));
935
+ run(depsMap.get(MAP_KEY_ITERATE_KEY));
923
936
  }
924
937
  } else if (isArrayIndex) {
925
- push(depsMap.get("length"));
938
+ run(depsMap.get("length"));
926
939
  }
927
940
  break;
928
941
  case "delete":
929
942
  if (!targetIsArray) {
930
- push(depsMap.get(ITERATE_KEY));
943
+ run(depsMap.get(ITERATE_KEY));
931
944
  if (isMap(target)) {
932
- push(depsMap.get(MAP_KEY_ITERATE_KEY));
945
+ run(depsMap.get(MAP_KEY_ITERATE_KEY));
933
946
  }
934
947
  }
935
948
  break;
936
949
  case "set":
937
950
  if (isMap(target)) {
938
- push(depsMap.get(ITERATE_KEY));
951
+ run(depsMap.get(ITERATE_KEY));
939
952
  }
940
953
  break;
941
954
  }
942
955
  }
943
956
  }
944
- startBatch();
945
- for (const dep of deps) {
946
- {
947
- dep.trigger({
948
- target,
949
- type,
950
- key,
951
- newValue,
952
- oldValue,
953
- oldTarget
954
- });
955
- }
956
- }
957
957
  endBatch();
958
958
  }
959
959
  function getDepFromReactive(object, key) {
@@ -1691,7 +1691,7 @@ var Vue = (function () {
1691
1691
  return raw ? toRaw(raw) : observed;
1692
1692
  }
1693
1693
  function markRaw(value) {
1694
- if (Object.isExtensible(value)) {
1694
+ if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) {
1695
1695
  def(value, "__v_skip", true);
1696
1696
  }
1697
1697
  return value;
@@ -1901,8 +1901,8 @@ var Vue = (function () {
1901
1901
  * @internal
1902
1902
  */
1903
1903
  notify() {
1904
+ this.flags |= 16;
1904
1905
  if (activeSub !== this) {
1905
- this.flags |= 16;
1906
1906
  this.dep.notify();
1907
1907
  }
1908
1908
  }
@@ -2590,23 +2590,19 @@ var Vue = (function () {
2590
2590
  }
2591
2591
  }
2592
2592
  function checkRecursiveUpdates(seen, fn) {
2593
- if (!seen.has(fn)) {
2594
- seen.set(fn, 1);
2595
- } else {
2596
- const count = seen.get(fn);
2597
- if (count > RECURSION_LIMIT) {
2598
- const instance = fn.i;
2599
- const componentName = instance && getComponentName(instance.type);
2600
- handleError(
2601
- `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
2602
- null,
2603
- 10
2604
- );
2605
- return true;
2606
- } else {
2607
- seen.set(fn, count + 1);
2608
- }
2593
+ const count = seen.get(fn) || 0;
2594
+ if (count > RECURSION_LIMIT) {
2595
+ const instance = fn.i;
2596
+ const componentName = instance && getComponentName(instance.type);
2597
+ handleError(
2598
+ `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
2599
+ null,
2600
+ 10
2601
+ );
2602
+ return true;
2609
2603
  }
2604
+ seen.set(fn, count + 1);
2605
+ return false;
2610
2606
  }
2611
2607
 
2612
2608
  let isHmrUpdating = false;
@@ -2687,7 +2683,9 @@ var Vue = (function () {
2687
2683
  dirtyInstances.delete(instance);
2688
2684
  } else if (instance.parent) {
2689
2685
  queueJob(() => {
2686
+ isHmrUpdating = true;
2690
2687
  instance.parent.update();
2688
+ isHmrUpdating = false;
2691
2689
  dirtyInstances.delete(instance);
2692
2690
  });
2693
2691
  } else if (instance.appContext.reload) {
@@ -3506,6 +3504,9 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3506
3504
  insert(mainAnchor, container, anchor);
3507
3505
  const mount = (container2, anchor2) => {
3508
3506
  if (shapeFlag & 16) {
3507
+ if (parentComponent && parentComponent.isCE) {
3508
+ parentComponent.ce._teleportTarget = container2;
3509
+ }
3509
3510
  mountChildren(
3510
3511
  children,
3511
3512
  container2,
@@ -4539,7 +4540,11 @@ Server rendered element contains more child nodes than client vdom.`
4539
4540
  remove(cur);
4540
4541
  }
4541
4542
  } else if (shapeFlag & 8) {
4542
- if (el.textContent !== vnode.children) {
4543
+ let clientText = vnode.children;
4544
+ if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
4545
+ clientText = clientText.slice(1);
4546
+ }
4547
+ if (el.textContent !== clientText) {
4543
4548
  if (!isMismatchAllowed(el, 0 /* TEXT */)) {
4544
4549
  warn$1(
4545
4550
  `Hydration text content mismatch on`,
@@ -4738,7 +4743,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4738
4743
  }
4739
4744
  };
4740
4745
  const isTemplateNode = (node) => {
4741
- return node.nodeType === 1 && node.tagName.toLowerCase() === "template";
4746
+ return node.nodeType === 1 && node.tagName === "TEMPLATE";
4742
4747
  };
4743
4748
  return [hydrate, hydrateNode];
4744
4749
  }
@@ -5090,7 +5095,7 @@ Server rendered element contains fewer child nodes than client vdom.`
5090
5095
  load().then(() => {
5091
5096
  loaded.value = true;
5092
5097
  if (instance.parent && isKeepAlive(instance.parent.vnode)) {
5093
- queueJob(instance.parent.update);
5098
+ instance.parent.update();
5094
5099
  }
5095
5100
  }).catch((err) => {
5096
5101
  onError(err);
@@ -5776,13 +5781,15 @@ If this is a native custom element, make sure to exclude it from component resol
5776
5781
  const sourceIsArray = isArray(source);
5777
5782
  if (sourceIsArray || isString(source)) {
5778
5783
  const sourceIsReactiveArray = sourceIsArray && isReactive(source);
5784
+ let needsWrap = false;
5779
5785
  if (sourceIsReactiveArray) {
5786
+ needsWrap = !isShallow(source);
5780
5787
  source = shallowReadArray(source);
5781
5788
  }
5782
5789
  ret = new Array(source.length);
5783
5790
  for (let i = 0, l = source.length; i < l; i++) {
5784
5791
  ret[i] = renderItem(
5785
- sourceIsReactiveArray ? toReactive(source[i]) : source[i],
5792
+ needsWrap ? toReactive(source[i]) : source[i],
5786
5793
  i,
5787
5794
  void 0,
5788
5795
  cached && cached[i]
@@ -7030,7 +7037,7 @@ If this is a native custom element, make sure to exclude it from component resol
7030
7037
  return vm;
7031
7038
  }
7032
7039
  }
7033
- Vue.version = `2.6.14-compat:${"3.5.3"}`;
7040
+ Vue.version = `2.6.14-compat:${"3.5.5"}`;
7034
7041
  Vue.config = singletonApp.config;
7035
7042
  Vue.use = (plugin, ...options) => {
7036
7043
  if (plugin && isFunction(plugin.install)) {
@@ -8852,6 +8859,7 @@ If you want to remount the same app, move your app creation logic into a factory
8852
8859
  }
8853
8860
  }
8854
8861
  if (instance.asyncDep) {
8862
+ if (isHmrUpdating) initialVNode.el = null;
8855
8863
  parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
8856
8864
  if (!initialVNode.el) {
8857
8865
  const placeholder = instance.subTree = createVNode(Comment);
@@ -12107,7 +12115,7 @@ Component that was made reactive: `,
12107
12115
  return true;
12108
12116
  }
12109
12117
 
12110
- const version = "3.5.3";
12118
+ const version = "3.5.5";
12111
12119
  const warn = warn$1 ;
12112
12120
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12113
12121
  const devtools = devtools$1 ;
@@ -13076,6 +13084,7 @@ Expected function or array of functions, received type ${typeof value}.`
13076
13084
  }
13077
13085
  }
13078
13086
  connectedCallback() {
13087
+ if (!this.isConnected) return;
13079
13088
  if (!this.shadowRoot) {
13080
13089
  this._parseSlots();
13081
13090
  }
@@ -13118,7 +13127,7 @@ Expected function or array of functions, received type ${typeof value}.`
13118
13127
  this._ob = null;
13119
13128
  }
13120
13129
  this._app && this._app.unmount();
13121
- this._instance.ce = void 0;
13130
+ if (this._instance) this._instance.ce = void 0;
13122
13131
  this._app = this._instance = null;
13123
13132
  }
13124
13133
  });
@@ -13337,7 +13346,7 @@ Expected function or array of functions, received type ${typeof value}.`
13337
13346
  }
13338
13347
  }
13339
13348
  /**
13340
- * Only called when shaddowRoot is false
13349
+ * Only called when shadowRoot is false
13341
13350
  */
13342
13351
  _parseSlots() {
13343
13352
  const slots = this._slots = {};
@@ -13349,10 +13358,10 @@ Expected function or array of functions, received type ${typeof value}.`
13349
13358
  }
13350
13359
  }
13351
13360
  /**
13352
- * Only called when shaddowRoot is false
13361
+ * Only called when shadowRoot is false
13353
13362
  */
13354
13363
  _renderSlots() {
13355
- const outlets = this.querySelectorAll("slot");
13364
+ const outlets = (this._teleportTarget || this).querySelectorAll("slot");
13356
13365
  const scopeId = this._instance.type.__scopeId;
13357
13366
  for (let i = 0; i < outlets.length; i++) {
13358
13367
  const o = outlets[i];
@@ -13528,7 +13537,7 @@ Expected function or array of functions, received type ${typeof value}.`
13528
13537
  child,
13529
13538
  resolveTransitionHooks(child, cssTransitionProps, state, instance)
13530
13539
  );
13531
- } else {
13540
+ } else if (child.type !== Text) {
13532
13541
  warn(`<TransitionGroup> children must be keyed.`);
13533
13542
  }
13534
13543
  }