@vue/runtime-dom 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/runtime-dom v3.5.3
2
+ * @vue/runtime-dom v3.5.5
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -822,6 +822,7 @@ class VueElement extends BaseClass {
822
822
  }
823
823
  }
824
824
  connectedCallback() {
825
+ if (!this.isConnected) return;
825
826
  if (!this.shadowRoot) {
826
827
  this._parseSlots();
827
828
  }
@@ -864,7 +865,7 @@ class VueElement extends BaseClass {
864
865
  this._ob = null;
865
866
  }
866
867
  this._app && this._app.unmount();
867
- this._instance.ce = void 0;
868
+ if (this._instance) this._instance.ce = void 0;
868
869
  this._app = this._instance = null;
869
870
  }
870
871
  });
@@ -1083,7 +1084,7 @@ class VueElement extends BaseClass {
1083
1084
  }
1084
1085
  }
1085
1086
  /**
1086
- * Only called when shaddowRoot is false
1087
+ * Only called when shadowRoot is false
1087
1088
  */
1088
1089
  _parseSlots() {
1089
1090
  const slots = this._slots = {};
@@ -1095,10 +1096,10 @@ class VueElement extends BaseClass {
1095
1096
  }
1096
1097
  }
1097
1098
  /**
1098
- * Only called when shaddowRoot is false
1099
+ * Only called when shadowRoot is false
1099
1100
  */
1100
1101
  _renderSlots() {
1101
- const outlets = this.querySelectorAll("slot");
1102
+ const outlets = (this._teleportTarget || this).querySelectorAll("slot");
1102
1103
  const scopeId = this._instance.type.__scopeId;
1103
1104
  for (let i = 0; i < outlets.length; i++) {
1104
1105
  const o = outlets[i];
@@ -1277,7 +1278,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
1277
1278
  child,
1278
1279
  runtimeCore.resolveTransitionHooks(child, cssTransitionProps, state, instance)
1279
1280
  );
1280
- } else {
1281
+ } else if (child.type !== runtimeCore.Text) {
1281
1282
  runtimeCore.warn(`<TransitionGroup> children must be keyed.`);
1282
1283
  }
1283
1284
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.5.3
2
+ * @vue/runtime-dom v3.5.5
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -786,6 +786,7 @@ class VueElement extends BaseClass {
786
786
  }
787
787
  }
788
788
  connectedCallback() {
789
+ if (!this.isConnected) return;
789
790
  if (!this.shadowRoot) {
790
791
  this._parseSlots();
791
792
  }
@@ -828,7 +829,7 @@ class VueElement extends BaseClass {
828
829
  this._ob = null;
829
830
  }
830
831
  this._app && this._app.unmount();
831
- this._instance.ce = void 0;
832
+ if (this._instance) this._instance.ce = void 0;
832
833
  this._app = this._instance = null;
833
834
  }
834
835
  });
@@ -1013,7 +1014,7 @@ class VueElement extends BaseClass {
1013
1014
  }
1014
1015
  }
1015
1016
  /**
1016
- * Only called when shaddowRoot is false
1017
+ * Only called when shadowRoot is false
1017
1018
  */
1018
1019
  _parseSlots() {
1019
1020
  const slots = this._slots = {};
@@ -1025,10 +1026,10 @@ class VueElement extends BaseClass {
1025
1026
  }
1026
1027
  }
1027
1028
  /**
1028
- * Only called when shaddowRoot is false
1029
+ * Only called when shadowRoot is false
1029
1030
  */
1030
1031
  _renderSlots() {
1031
- const outlets = this.querySelectorAll("slot");
1032
+ const outlets = (this._teleportTarget || this).querySelectorAll("slot");
1032
1033
  const scopeId = this._instance.type.__scopeId;
1033
1034
  for (let i = 0; i < outlets.length; i++) {
1034
1035
  const o = outlets[i];
@@ -159,11 +159,11 @@ export declare class VueElement extends BaseClass implements ComponentCustomElem
159
159
  private _createVNode;
160
160
  private _applyStyles;
161
161
  /**
162
- * Only called when shaddowRoot is false
162
+ * Only called when shadowRoot is false
163
163
  */
164
164
  private _parseSlots;
165
165
  /**
166
- * Only called when shaddowRoot is false
166
+ * Only called when shadowRoot is false
167
167
  */
168
168
  private _renderSlots;
169
169
  }
@@ -1,13 +1,14 @@
1
1
  /**
2
- * @vue/runtime-dom v3.5.3
2
+ * @vue/runtime-dom v3.5.5
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
6
6
  /*! #__NO_SIDE_EFFECTS__ */
7
7
  // @__NO_SIDE_EFFECTS__
8
- function makeMap(str, expectsLowerCase) {
9
- const set = new Set(str.split(","));
10
- return (val) => set.has(val);
8
+ function makeMap(str) {
9
+ const map = /* @__PURE__ */ Object.create(null);
10
+ for (const key of str.split(",")) map[key] = 1;
11
+ return (val) => val in map;
11
12
  }
12
13
 
13
14
  const EMPTY_OBJ = Object.freeze({}) ;
@@ -595,9 +596,11 @@ function prepareDeps(sub) {
595
596
  function cleanupDeps(sub) {
596
597
  let head;
597
598
  let tail = sub.depsTail;
598
- for (let link = tail; link; link = link.prevDep) {
599
+ let link = tail;
600
+ while (link) {
601
+ const prev = link.prevDep;
599
602
  if (link.version === -1) {
600
- if (link === tail) tail = link.prevDep;
603
+ if (link === tail) tail = prev;
601
604
  removeSub(link);
602
605
  removeDep(link);
603
606
  } else {
@@ -605,13 +608,14 @@ function cleanupDeps(sub) {
605
608
  }
606
609
  link.dep.activeLink = link.prevActiveLink;
607
610
  link.prevActiveLink = void 0;
611
+ link = prev;
608
612
  }
609
613
  sub.deps = head;
610
614
  sub.depsTail = tail;
611
615
  }
612
616
  function isDirty(sub) {
613
617
  for (let link = sub.deps; link; link = link.nextDep) {
614
- if (link.dep.version !== link.version || link.dep.computed && refreshComputed(link.dep.computed) === false || link.dep.version !== link.version) {
618
+ if (link.dep.version !== link.version || link.dep.computed && refreshComputed(link.dep.computed) || link.dep.version !== link.version) {
615
619
  return true;
616
620
  }
617
621
  }
@@ -621,9 +625,6 @@ function isDirty(sub) {
621
625
  return false;
622
626
  }
623
627
  function refreshComputed(computed) {
624
- if (computed.flags & 2) {
625
- return false;
626
- }
627
628
  if (computed.flags & 4 && !(computed.flags & 16)) {
628
629
  return;
629
630
  }
@@ -736,6 +737,14 @@ function cleanupEffect(e) {
736
737
  }
737
738
 
738
739
  let globalVersion = 0;
740
+ class Link {
741
+ constructor(sub, dep) {
742
+ this.sub = sub;
743
+ this.dep = dep;
744
+ this.version = dep.version;
745
+ this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
746
+ }
747
+ }
739
748
  class Dep {
740
749
  constructor(computed) {
741
750
  this.computed = computed;
@@ -758,16 +767,7 @@ class Dep {
758
767
  }
759
768
  let link = this.activeLink;
760
769
  if (link === void 0 || link.sub !== activeSub) {
761
- link = this.activeLink = {
762
- dep: this,
763
- sub: activeSub,
764
- version: this.version,
765
- nextDep: void 0,
766
- prevDep: void 0,
767
- nextSub: void 0,
768
- prevSub: void 0,
769
- prevActiveLink: void 0
770
- };
770
+ link = this.activeLink = new Link(activeSub, this);
771
771
  if (!activeSub.deps) {
772
772
  activeSub.deps = activeSub.depsTail = link;
773
773
  } else {
@@ -890,9 +890,23 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
890
890
  globalVersion++;
891
891
  return;
892
892
  }
893
- let deps = [];
893
+ const run = (dep) => {
894
+ if (dep) {
895
+ {
896
+ dep.trigger({
897
+ target,
898
+ type,
899
+ key,
900
+ newValue,
901
+ oldValue,
902
+ oldTarget
903
+ });
904
+ }
905
+ }
906
+ };
907
+ startBatch();
894
908
  if (type === "clear") {
895
- deps = [...depsMap.values()];
909
+ depsMap.forEach(run);
896
910
  } else {
897
911
  const targetIsArray = isArray(target);
898
912
  const isArrayIndex = targetIsArray && isIntegerKey(key);
@@ -900,57 +914,43 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
900
914
  const newLength = Number(newValue);
901
915
  depsMap.forEach((dep, key2) => {
902
916
  if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) {
903
- deps.push(dep);
917
+ run(dep);
904
918
  }
905
919
  });
906
920
  } else {
907
- const push = (dep) => dep && deps.push(dep);
908
921
  if (key !== void 0) {
909
- push(depsMap.get(key));
922
+ run(depsMap.get(key));
910
923
  }
911
924
  if (isArrayIndex) {
912
- push(depsMap.get(ARRAY_ITERATE_KEY));
925
+ run(depsMap.get(ARRAY_ITERATE_KEY));
913
926
  }
914
927
  switch (type) {
915
928
  case "add":
916
929
  if (!targetIsArray) {
917
- push(depsMap.get(ITERATE_KEY));
930
+ run(depsMap.get(ITERATE_KEY));
918
931
  if (isMap(target)) {
919
- push(depsMap.get(MAP_KEY_ITERATE_KEY));
932
+ run(depsMap.get(MAP_KEY_ITERATE_KEY));
920
933
  }
921
934
  } else if (isArrayIndex) {
922
- push(depsMap.get("length"));
935
+ run(depsMap.get("length"));
923
936
  }
924
937
  break;
925
938
  case "delete":
926
939
  if (!targetIsArray) {
927
- push(depsMap.get(ITERATE_KEY));
940
+ run(depsMap.get(ITERATE_KEY));
928
941
  if (isMap(target)) {
929
- push(depsMap.get(MAP_KEY_ITERATE_KEY));
942
+ run(depsMap.get(MAP_KEY_ITERATE_KEY));
930
943
  }
931
944
  }
932
945
  break;
933
946
  case "set":
934
947
  if (isMap(target)) {
935
- push(depsMap.get(ITERATE_KEY));
948
+ run(depsMap.get(ITERATE_KEY));
936
949
  }
937
950
  break;
938
951
  }
939
952
  }
940
953
  }
941
- startBatch();
942
- for (const dep of deps) {
943
- {
944
- dep.trigger({
945
- target,
946
- type,
947
- key,
948
- newValue,
949
- oldValue,
950
- oldTarget
951
- });
952
- }
953
- }
954
954
  endBatch();
955
955
  }
956
956
  function getDepFromReactive(object, key) {
@@ -1688,7 +1688,7 @@ function toRaw(observed) {
1688
1688
  return raw ? toRaw(raw) : observed;
1689
1689
  }
1690
1690
  function markRaw(value) {
1691
- if (Object.isExtensible(value)) {
1691
+ if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) {
1692
1692
  def(value, "__v_skip", true);
1693
1693
  }
1694
1694
  return value;
@@ -1898,8 +1898,8 @@ class ComputedRefImpl {
1898
1898
  * @internal
1899
1899
  */
1900
1900
  notify() {
1901
+ this.flags |= 16;
1901
1902
  if (activeSub !== this) {
1902
- this.flags |= 16;
1903
1903
  this.dep.notify();
1904
1904
  }
1905
1905
  }
@@ -2587,23 +2587,19 @@ function flushJobs(seen) {
2587
2587
  }
2588
2588
  }
2589
2589
  function checkRecursiveUpdates(seen, fn) {
2590
- if (!seen.has(fn)) {
2591
- seen.set(fn, 1);
2592
- } else {
2593
- const count = seen.get(fn);
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;
2603
- } else {
2604
- seen.set(fn, count + 1);
2605
- }
2590
+ const count = seen.get(fn) || 0;
2591
+ if (count > RECURSION_LIMIT) {
2592
+ const instance = fn.i;
2593
+ const componentName = instance && getComponentName(instance.type);
2594
+ handleError(
2595
+ `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.`,
2596
+ null,
2597
+ 10
2598
+ );
2599
+ return true;
2606
2600
  }
2601
+ seen.set(fn, count + 1);
2602
+ return false;
2607
2603
  }
2608
2604
 
2609
2605
  let isHmrUpdating = false;
@@ -2684,7 +2680,9 @@ function reload(id, newComp) {
2684
2680
  dirtyInstances.delete(instance);
2685
2681
  } else if (instance.parent) {
2686
2682
  queueJob(() => {
2683
+ isHmrUpdating = true;
2687
2684
  instance.parent.update();
2685
+ isHmrUpdating = false;
2688
2686
  dirtyInstances.delete(instance);
2689
2687
  });
2690
2688
  } else if (instance.appContext.reload) {
@@ -2975,6 +2973,9 @@ const TeleportImpl = {
2975
2973
  insert(mainAnchor, container, anchor);
2976
2974
  const mount = (container2, anchor2) => {
2977
2975
  if (shapeFlag & 16) {
2976
+ if (parentComponent && parentComponent.isCE) {
2977
+ parentComponent.ce._teleportTarget = container2;
2978
+ }
2978
2979
  mountChildren(
2979
2980
  children,
2980
2981
  container2,
@@ -4005,7 +4006,11 @@ Server rendered element contains more child nodes than client vdom.`
4005
4006
  remove(cur);
4006
4007
  }
4007
4008
  } else if (shapeFlag & 8) {
4008
- if (el.textContent !== vnode.children) {
4009
+ let clientText = vnode.children;
4010
+ if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
4011
+ clientText = clientText.slice(1);
4012
+ }
4013
+ if (el.textContent !== clientText) {
4009
4014
  if (!isMismatchAllowed(el, 0 /* TEXT */)) {
4010
4015
  warn$1(
4011
4016
  `Hydration text content mismatch on`,
@@ -4204,7 +4209,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4204
4209
  }
4205
4210
  };
4206
4211
  const isTemplateNode = (node) => {
4207
- return node.nodeType === 1 && node.tagName.toLowerCase() === "template";
4212
+ return node.nodeType === 1 && node.tagName === "TEMPLATE";
4208
4213
  };
4209
4214
  return [hydrate, hydrateNode];
4210
4215
  }
@@ -4556,7 +4561,7 @@ function defineAsyncComponent(source) {
4556
4561
  load().then(() => {
4557
4562
  loaded.value = true;
4558
4563
  if (instance.parent && isKeepAlive(instance.parent.vnode)) {
4559
- queueJob(instance.parent.update);
4564
+ instance.parent.update();
4560
4565
  }
4561
4566
  }).catch((err) => {
4562
4567
  onError(err);
@@ -4957,13 +4962,15 @@ function renderList(source, renderItem, cache, index) {
4957
4962
  const sourceIsArray = isArray(source);
4958
4963
  if (sourceIsArray || isString(source)) {
4959
4964
  const sourceIsReactiveArray = sourceIsArray && isReactive(source);
4965
+ let needsWrap = false;
4960
4966
  if (sourceIsReactiveArray) {
4967
+ needsWrap = !isShallow(source);
4961
4968
  source = shallowReadArray(source);
4962
4969
  }
4963
4970
  ret = new Array(source.length);
4964
4971
  for (let i = 0, l = source.length; i < l; i++) {
4965
4972
  ret[i] = renderItem(
4966
- sourceIsReactiveArray ? toReactive(source[i]) : source[i],
4973
+ needsWrap ? toReactive(source[i]) : source[i],
4967
4974
  i,
4968
4975
  void 0,
4969
4976
  cached && cached[i]
@@ -7236,6 +7243,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7236
7243
  }
7237
7244
  }
7238
7245
  if (instance.asyncDep) {
7246
+ if (isHmrUpdating) initialVNode.el = null;
7239
7247
  parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
7240
7248
  if (!initialVNode.el) {
7241
7249
  const placeholder = instance.subTree = createVNode(Comment);
@@ -10387,7 +10395,7 @@ function isMemoSame(cached, memo) {
10387
10395
  return true;
10388
10396
  }
10389
10397
 
10390
- const version = "3.5.3";
10398
+ const version = "3.5.5";
10391
10399
  const warn = warn$1 ;
10392
10400
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10393
10401
  const devtools = devtools$1 ;
@@ -11287,6 +11295,7 @@ class VueElement extends BaseClass {
11287
11295
  }
11288
11296
  }
11289
11297
  connectedCallback() {
11298
+ if (!this.isConnected) return;
11290
11299
  if (!this.shadowRoot) {
11291
11300
  this._parseSlots();
11292
11301
  }
@@ -11329,7 +11338,7 @@ class VueElement extends BaseClass {
11329
11338
  this._ob = null;
11330
11339
  }
11331
11340
  this._app && this._app.unmount();
11332
- this._instance.ce = void 0;
11341
+ if (this._instance) this._instance.ce = void 0;
11333
11342
  this._app = this._instance = null;
11334
11343
  }
11335
11344
  });
@@ -11548,7 +11557,7 @@ class VueElement extends BaseClass {
11548
11557
  }
11549
11558
  }
11550
11559
  /**
11551
- * Only called when shaddowRoot is false
11560
+ * Only called when shadowRoot is false
11552
11561
  */
11553
11562
  _parseSlots() {
11554
11563
  const slots = this._slots = {};
@@ -11560,10 +11569,10 @@ class VueElement extends BaseClass {
11560
11569
  }
11561
11570
  }
11562
11571
  /**
11563
- * Only called when shaddowRoot is false
11572
+ * Only called when shadowRoot is false
11564
11573
  */
11565
11574
  _renderSlots() {
11566
- const outlets = this.querySelectorAll("slot");
11575
+ const outlets = (this._teleportTarget || this).querySelectorAll("slot");
11567
11576
  const scopeId = this._instance.type.__scopeId;
11568
11577
  for (let i = 0; i < outlets.length; i++) {
11569
11578
  const o = outlets[i];
@@ -11742,7 +11751,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
11742
11751
  child,
11743
11752
  resolveTransitionHooks(child, cssTransitionProps, state, instance)
11744
11753
  );
11745
- } else {
11754
+ } else if (child.type !== Text) {
11746
11755
  warn(`<TransitionGroup> children must be keyed.`);
11747
11756
  }
11748
11757
  }