@vue/runtime-dom 3.5.4 → 3.5.6

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.4
2
+ * @vue/runtime-dom v3.5.6
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.4
2
+ * @vue/runtime-dom v3.5.6
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,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.5.4
2
+ * @vue/runtime-dom v3.5.6
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -465,7 +465,7 @@ class ReactiveEffect {
465
465
  /**
466
466
  * @internal
467
467
  */
468
- this.nextEffect = void 0;
468
+ this.next = void 0;
469
469
  /**
470
470
  * @internal
471
471
  */
@@ -495,9 +495,7 @@ class ReactiveEffect {
495
495
  return;
496
496
  }
497
497
  if (!(this.flags & 8)) {
498
- this.flags |= 8;
499
- this.nextEffect = batchedEffect;
500
- batchedEffect = this;
498
+ batch(this);
501
499
  }
502
500
  }
503
501
  run() {
@@ -558,7 +556,12 @@ class ReactiveEffect {
558
556
  }
559
557
  }
560
558
  let batchDepth = 0;
561
- let batchedEffect;
559
+ let batchedSub;
560
+ function batch(sub) {
561
+ sub.flags |= 8;
562
+ sub.next = batchedSub;
563
+ batchedSub = sub;
564
+ }
562
565
  function startBatch() {
563
566
  batchDepth++;
564
567
  }
@@ -567,15 +570,16 @@ function endBatch() {
567
570
  return;
568
571
  }
569
572
  let error;
570
- while (batchedEffect) {
571
- let e = batchedEffect;
572
- batchedEffect = void 0;
573
+ while (batchedSub) {
574
+ let e = batchedSub;
575
+ batchedSub = void 0;
573
576
  while (e) {
574
- const next = e.nextEffect;
575
- e.nextEffect = void 0;
577
+ const next = e.next;
578
+ e.next = void 0;
576
579
  e.flags &= ~8;
577
580
  if (e.flags & 1) {
578
581
  try {
582
+ ;
579
583
  e.trigger();
580
584
  } catch (err) {
581
585
  if (!error) error = err;
@@ -596,9 +600,11 @@ function prepareDeps(sub) {
596
600
  function cleanupDeps(sub) {
597
601
  let head;
598
602
  let tail = sub.depsTail;
599
- for (let link = tail; link; link = link.prevDep) {
603
+ let link = tail;
604
+ while (link) {
605
+ const prev = link.prevDep;
600
606
  if (link.version === -1) {
601
- if (link === tail) tail = link.prevDep;
607
+ if (link === tail) tail = prev;
602
608
  removeSub(link);
603
609
  removeDep(link);
604
610
  } else {
@@ -606,13 +612,14 @@ function cleanupDeps(sub) {
606
612
  }
607
613
  link.dep.activeLink = link.prevActiveLink;
608
614
  link.prevActiveLink = void 0;
615
+ link = prev;
609
616
  }
610
617
  sub.deps = head;
611
618
  sub.depsTail = tail;
612
619
  }
613
620
  function isDirty(sub) {
614
621
  for (let link = sub.deps; link; link = link.nextDep) {
615
- if (link.dep.version !== link.version || link.dep.computed && refreshComputed(link.dep.computed) || link.dep.version !== link.version) {
622
+ if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) {
616
623
  return true;
617
624
  }
618
625
  }
@@ -632,7 +639,7 @@ function refreshComputed(computed) {
632
639
  computed.globalVersion = globalVersion;
633
640
  const dep = computed.dep;
634
641
  computed.flags |= 2;
635
- if (dep.version > 0 && !computed.isSSR && !isDirty(computed)) {
642
+ if (dep.version > 0 && !computed.isSSR && computed.deps && !isDirty(computed)) {
636
643
  computed.flags &= ~2;
637
644
  return;
638
645
  }
@@ -734,6 +741,14 @@ function cleanupEffect(e) {
734
741
  }
735
742
 
736
743
  let globalVersion = 0;
744
+ class Link {
745
+ constructor(sub, dep) {
746
+ this.sub = sub;
747
+ this.dep = dep;
748
+ this.version = dep.version;
749
+ this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
750
+ }
751
+ }
737
752
  class Dep {
738
753
  constructor(computed) {
739
754
  this.computed = computed;
@@ -756,16 +771,7 @@ class Dep {
756
771
  }
757
772
  let link = this.activeLink;
758
773
  if (link === void 0 || link.sub !== activeSub) {
759
- link = this.activeLink = {
760
- dep: this,
761
- sub: activeSub,
762
- version: this.version,
763
- nextDep: void 0,
764
- prevDep: void 0,
765
- nextSub: void 0,
766
- prevSub: void 0,
767
- prevActiveLink: void 0
768
- };
774
+ link = this.activeLink = new Link(activeSub, this);
769
775
  if (!activeSub.deps) {
770
776
  activeSub.deps = activeSub.depsTail = link;
771
777
  } else {
@@ -828,7 +834,10 @@ class Dep {
828
834
  }
829
835
  }
830
836
  for (let link = this.subs; link; link = link.prevSub) {
831
- link.sub.notify();
837
+ if (link.sub.notify()) {
838
+ ;
839
+ link.sub.dep.notify();
840
+ }
832
841
  }
833
842
  } finally {
834
843
  endBatch();
@@ -1897,8 +1906,10 @@ class ComputedRefImpl {
1897
1906
  */
1898
1907
  notify() {
1899
1908
  this.flags |= 16;
1900
- if (activeSub !== this) {
1901
- this.dep.notify();
1909
+ if (!(this.flags & 8) && // avoid infinite self recursion
1910
+ activeSub !== this) {
1911
+ batch(this);
1912
+ return true;
1902
1913
  }
1903
1914
  }
1904
1915
  get value() {
@@ -2046,20 +2057,12 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2046
2057
  remove(scope.effects, effect);
2047
2058
  }
2048
2059
  };
2049
- if (once) {
2050
- if (cb) {
2051
- const _cb = cb;
2052
- cb = (...args) => {
2053
- _cb(...args);
2054
- watchHandle();
2055
- };
2056
- } else {
2057
- const _getter = getter;
2058
- getter = () => {
2059
- _getter();
2060
- watchHandle();
2061
- };
2062
- }
2060
+ if (once && cb) {
2061
+ const _cb = cb;
2062
+ cb = (...args) => {
2063
+ _cb(...args);
2064
+ watchHandle();
2065
+ };
2063
2066
  }
2064
2067
  let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
2065
2068
  const job = (immediateFirstRun) => {
@@ -2678,7 +2681,9 @@ function reload(id, newComp) {
2678
2681
  dirtyInstances.delete(instance);
2679
2682
  } else if (instance.parent) {
2680
2683
  queueJob(() => {
2684
+ isHmrUpdating = true;
2681
2685
  instance.parent.update();
2686
+ isHmrUpdating = false;
2682
2687
  dirtyInstances.delete(instance);
2683
2688
  });
2684
2689
  } else if (instance.appContext.reload) {
@@ -2969,6 +2974,9 @@ const TeleportImpl = {
2969
2974
  insert(mainAnchor, container, anchor);
2970
2975
  const mount = (container2, anchor2) => {
2971
2976
  if (shapeFlag & 16) {
2977
+ if (parentComponent && parentComponent.isCE) {
2978
+ parentComponent.ce._teleportTarget = container2;
2979
+ }
2972
2980
  mountChildren(
2973
2981
  children,
2974
2982
  container2,
@@ -3999,7 +4007,11 @@ Server rendered element contains more child nodes than client vdom.`
3999
4007
  remove(cur);
4000
4008
  }
4001
4009
  } else if (shapeFlag & 8) {
4002
- if (el.textContent !== vnode.children) {
4010
+ let clientText = vnode.children;
4011
+ if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
4012
+ clientText = clientText.slice(1);
4013
+ }
4014
+ if (el.textContent !== clientText) {
4003
4015
  if (!isMismatchAllowed(el, 0 /* TEXT */)) {
4004
4016
  warn$1(
4005
4017
  `Hydration text content mismatch on`,
@@ -4198,7 +4210,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4198
4210
  }
4199
4211
  };
4200
4212
  const isTemplateNode = (node) => {
4201
- return node.nodeType === 1 && node.tagName.toLowerCase() === "template";
4213
+ return node.nodeType === 1 && node.tagName === "TEMPLATE";
4202
4214
  };
4203
4215
  return [hydrate, hydrateNode];
4204
4216
  }
@@ -4550,7 +4562,7 @@ function defineAsyncComponent(source) {
4550
4562
  load().then(() => {
4551
4563
  loaded.value = true;
4552
4564
  if (instance.parent && isKeepAlive(instance.parent.vnode)) {
4553
- queueJob(instance.parent.update);
4565
+ instance.parent.update();
4554
4566
  }
4555
4567
  }).catch((err) => {
4556
4568
  onError(err);
@@ -7232,6 +7244,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7232
7244
  }
7233
7245
  }
7234
7246
  if (instance.asyncDep) {
7247
+ if (isHmrUpdating) initialVNode.el = null;
7235
7248
  parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
7236
7249
  if (!initialVNode.el) {
7237
7250
  const placeholder = instance.subTree = createVNode(Comment);
@@ -8194,11 +8207,12 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
8194
8207
  } else if (!cb || immediate) {
8195
8208
  baseWatchOptions.once = true;
8196
8209
  } else {
8197
- return {
8198
- stop: NOOP,
8199
- resume: NOOP,
8200
- pause: NOOP
8210
+ const watchStopHandle = () => {
8201
8211
  };
8212
+ watchStopHandle.stop = NOOP;
8213
+ watchStopHandle.resume = NOOP;
8214
+ watchStopHandle.pause = NOOP;
8215
+ return watchStopHandle;
8202
8216
  }
8203
8217
  }
8204
8218
  const instance = currentInstance;
@@ -10383,7 +10397,7 @@ function isMemoSame(cached, memo) {
10383
10397
  return true;
10384
10398
  }
10385
10399
 
10386
- const version = "3.5.4";
10400
+ const version = "3.5.6";
10387
10401
  const warn = warn$1 ;
10388
10402
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10389
10403
  const devtools = devtools$1 ;
@@ -11283,6 +11297,7 @@ class VueElement extends BaseClass {
11283
11297
  }
11284
11298
  }
11285
11299
  connectedCallback() {
11300
+ if (!this.isConnected) return;
11286
11301
  if (!this.shadowRoot) {
11287
11302
  this._parseSlots();
11288
11303
  }
@@ -11325,7 +11340,7 @@ class VueElement extends BaseClass {
11325
11340
  this._ob = null;
11326
11341
  }
11327
11342
  this._app && this._app.unmount();
11328
- this._instance.ce = void 0;
11343
+ if (this._instance) this._instance.ce = void 0;
11329
11344
  this._app = this._instance = null;
11330
11345
  }
11331
11346
  });
@@ -11544,7 +11559,7 @@ class VueElement extends BaseClass {
11544
11559
  }
11545
11560
  }
11546
11561
  /**
11547
- * Only called when shaddowRoot is false
11562
+ * Only called when shadowRoot is false
11548
11563
  */
11549
11564
  _parseSlots() {
11550
11565
  const slots = this._slots = {};
@@ -11556,10 +11571,10 @@ class VueElement extends BaseClass {
11556
11571
  }
11557
11572
  }
11558
11573
  /**
11559
- * Only called when shaddowRoot is false
11574
+ * Only called when shadowRoot is false
11560
11575
  */
11561
11576
  _renderSlots() {
11562
- const outlets = this.querySelectorAll("slot");
11577
+ const outlets = (this._teleportTarget || this).querySelectorAll("slot");
11563
11578
  const scopeId = this._instance.type.__scopeId;
11564
11579
  for (let i = 0; i < outlets.length; i++) {
11565
11580
  const o = outlets[i];
@@ -11738,7 +11753,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
11738
11753
  child,
11739
11754
  resolveTransitionHooks(child, cssTransitionProps, state, instance)
11740
11755
  );
11741
- } else {
11756
+ } else if (child.type !== Text) {
11742
11757
  warn(`<TransitionGroup> children must be keyed.`);
11743
11758
  }
11744
11759
  }