vue 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 v3.5.4
2
+ * vue v3.5.6
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.5.4
2
+ * vue v3.5.6
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -535,7 +535,7 @@ var Vue = (function (exports) {
535
535
  /**
536
536
  * @internal
537
537
  */
538
- this.nextEffect = void 0;
538
+ this.next = void 0;
539
539
  /**
540
540
  * @internal
541
541
  */
@@ -565,9 +565,7 @@ var Vue = (function (exports) {
565
565
  return;
566
566
  }
567
567
  if (!(this.flags & 8)) {
568
- this.flags |= 8;
569
- this.nextEffect = batchedEffect;
570
- batchedEffect = this;
568
+ batch(this);
571
569
  }
572
570
  }
573
571
  run() {
@@ -628,7 +626,12 @@ var Vue = (function (exports) {
628
626
  }
629
627
  }
630
628
  let batchDepth = 0;
631
- let batchedEffect;
629
+ let batchedSub;
630
+ function batch(sub) {
631
+ sub.flags |= 8;
632
+ sub.next = batchedSub;
633
+ batchedSub = sub;
634
+ }
632
635
  function startBatch() {
633
636
  batchDepth++;
634
637
  }
@@ -637,15 +640,16 @@ var Vue = (function (exports) {
637
640
  return;
638
641
  }
639
642
  let error;
640
- while (batchedEffect) {
641
- let e = batchedEffect;
642
- batchedEffect = void 0;
643
+ while (batchedSub) {
644
+ let e = batchedSub;
645
+ batchedSub = void 0;
643
646
  while (e) {
644
- const next = e.nextEffect;
645
- e.nextEffect = void 0;
647
+ const next = e.next;
648
+ e.next = void 0;
646
649
  e.flags &= ~8;
647
650
  if (e.flags & 1) {
648
651
  try {
652
+ ;
649
653
  e.trigger();
650
654
  } catch (err) {
651
655
  if (!error) error = err;
@@ -666,9 +670,11 @@ var Vue = (function (exports) {
666
670
  function cleanupDeps(sub) {
667
671
  let head;
668
672
  let tail = sub.depsTail;
669
- for (let link = tail; link; link = link.prevDep) {
673
+ let link = tail;
674
+ while (link) {
675
+ const prev = link.prevDep;
670
676
  if (link.version === -1) {
671
- if (link === tail) tail = link.prevDep;
677
+ if (link === tail) tail = prev;
672
678
  removeSub(link);
673
679
  removeDep(link);
674
680
  } else {
@@ -676,13 +682,14 @@ var Vue = (function (exports) {
676
682
  }
677
683
  link.dep.activeLink = link.prevActiveLink;
678
684
  link.prevActiveLink = void 0;
685
+ link = prev;
679
686
  }
680
687
  sub.deps = head;
681
688
  sub.depsTail = tail;
682
689
  }
683
690
  function isDirty(sub) {
684
691
  for (let link = sub.deps; link; link = link.nextDep) {
685
- if (link.dep.version !== link.version || link.dep.computed && refreshComputed(link.dep.computed) || link.dep.version !== link.version) {
692
+ if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) {
686
693
  return true;
687
694
  }
688
695
  }
@@ -702,7 +709,7 @@ var Vue = (function (exports) {
702
709
  computed.globalVersion = globalVersion;
703
710
  const dep = computed.dep;
704
711
  computed.flags |= 2;
705
- if (dep.version > 0 && !computed.isSSR && !isDirty(computed)) {
712
+ if (dep.version > 0 && !computed.isSSR && computed.deps && !isDirty(computed)) {
706
713
  computed.flags &= ~2;
707
714
  return;
708
715
  }
@@ -804,6 +811,14 @@ var Vue = (function (exports) {
804
811
  }
805
812
 
806
813
  let globalVersion = 0;
814
+ class Link {
815
+ constructor(sub, dep) {
816
+ this.sub = sub;
817
+ this.dep = dep;
818
+ this.version = dep.version;
819
+ this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
820
+ }
821
+ }
807
822
  class Dep {
808
823
  constructor(computed) {
809
824
  this.computed = computed;
@@ -826,16 +841,7 @@ var Vue = (function (exports) {
826
841
  }
827
842
  let link = this.activeLink;
828
843
  if (link === void 0 || link.sub !== activeSub) {
829
- link = this.activeLink = {
830
- dep: this,
831
- sub: activeSub,
832
- version: this.version,
833
- nextDep: void 0,
834
- prevDep: void 0,
835
- nextSub: void 0,
836
- prevSub: void 0,
837
- prevActiveLink: void 0
838
- };
844
+ link = this.activeLink = new Link(activeSub, this);
839
845
  if (!activeSub.deps) {
840
846
  activeSub.deps = activeSub.depsTail = link;
841
847
  } else {
@@ -898,7 +904,10 @@ var Vue = (function (exports) {
898
904
  }
899
905
  }
900
906
  for (let link = this.subs; link; link = link.prevSub) {
901
- link.sub.notify();
907
+ if (link.sub.notify()) {
908
+ ;
909
+ link.sub.dep.notify();
910
+ }
902
911
  }
903
912
  } finally {
904
913
  endBatch();
@@ -1967,8 +1976,10 @@ var Vue = (function (exports) {
1967
1976
  */
1968
1977
  notify() {
1969
1978
  this.flags |= 16;
1970
- if (activeSub !== this) {
1971
- this.dep.notify();
1979
+ if (!(this.flags & 8) && // avoid infinite self recursion
1980
+ activeSub !== this) {
1981
+ batch(this);
1982
+ return true;
1972
1983
  }
1973
1984
  }
1974
1985
  get value() {
@@ -2116,20 +2127,12 @@ var Vue = (function (exports) {
2116
2127
  remove(scope.effects, effect);
2117
2128
  }
2118
2129
  };
2119
- if (once) {
2120
- if (cb) {
2121
- const _cb = cb;
2122
- cb = (...args) => {
2123
- _cb(...args);
2124
- watchHandle();
2125
- };
2126
- } else {
2127
- const _getter = getter;
2128
- getter = () => {
2129
- _getter();
2130
- watchHandle();
2131
- };
2132
- }
2130
+ if (once && cb) {
2131
+ const _cb = cb;
2132
+ cb = (...args) => {
2133
+ _cb(...args);
2134
+ watchHandle();
2135
+ };
2133
2136
  }
2134
2137
  let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
2135
2138
  const job = (immediateFirstRun) => {
@@ -2748,7 +2751,9 @@ var Vue = (function (exports) {
2748
2751
  dirtyInstances.delete(instance);
2749
2752
  } else if (instance.parent) {
2750
2753
  queueJob(() => {
2754
+ isHmrUpdating = true;
2751
2755
  instance.parent.update();
2756
+ isHmrUpdating = false;
2752
2757
  dirtyInstances.delete(instance);
2753
2758
  });
2754
2759
  } else if (instance.appContext.reload) {
@@ -3039,6 +3044,9 @@ var Vue = (function (exports) {
3039
3044
  insert(mainAnchor, container, anchor);
3040
3045
  const mount = (container2, anchor2) => {
3041
3046
  if (shapeFlag & 16) {
3047
+ if (parentComponent && parentComponent.isCE) {
3048
+ parentComponent.ce._teleportTarget = container2;
3049
+ }
3042
3050
  mountChildren(
3043
3051
  children,
3044
3052
  container2,
@@ -4069,7 +4077,11 @@ Server rendered element contains more child nodes than client vdom.`
4069
4077
  remove(cur);
4070
4078
  }
4071
4079
  } else if (shapeFlag & 8) {
4072
- if (el.textContent !== vnode.children) {
4080
+ let clientText = vnode.children;
4081
+ if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
4082
+ clientText = clientText.slice(1);
4083
+ }
4084
+ if (el.textContent !== clientText) {
4073
4085
  if (!isMismatchAllowed(el, 0 /* TEXT */)) {
4074
4086
  warn$1(
4075
4087
  `Hydration text content mismatch on`,
@@ -4268,7 +4280,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4268
4280
  }
4269
4281
  };
4270
4282
  const isTemplateNode = (node) => {
4271
- return node.nodeType === 1 && node.tagName.toLowerCase() === "template";
4283
+ return node.nodeType === 1 && node.tagName === "TEMPLATE";
4272
4284
  };
4273
4285
  return [hydrate, hydrateNode];
4274
4286
  }
@@ -4620,7 +4632,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4620
4632
  load().then(() => {
4621
4633
  loaded.value = true;
4622
4634
  if (instance.parent && isKeepAlive(instance.parent.vnode)) {
4623
- queueJob(instance.parent.update);
4635
+ instance.parent.update();
4624
4636
  }
4625
4637
  }).catch((err) => {
4626
4638
  onError(err);
@@ -7293,6 +7305,7 @@ If you want to remount the same app, move your app creation logic into a factory
7293
7305
  }
7294
7306
  }
7295
7307
  if (instance.asyncDep) {
7308
+ if (isHmrUpdating) initialVNode.el = null;
7296
7309
  parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
7297
7310
  if (!initialVNode.el) {
7298
7311
  const placeholder = instance.subTree = createVNode(Comment);
@@ -10408,7 +10421,7 @@ Component that was made reactive: `,
10408
10421
  return true;
10409
10422
  }
10410
10423
 
10411
- const version = "3.5.4";
10424
+ const version = "3.5.6";
10412
10425
  const warn = warn$1 ;
10413
10426
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10414
10427
  const devtools = devtools$1 ;
@@ -11289,6 +11302,7 @@ Expected function or array of functions, received type ${typeof value}.`
11289
11302
  }
11290
11303
  }
11291
11304
  connectedCallback() {
11305
+ if (!this.isConnected) return;
11292
11306
  if (!this.shadowRoot) {
11293
11307
  this._parseSlots();
11294
11308
  }
@@ -11331,7 +11345,7 @@ Expected function or array of functions, received type ${typeof value}.`
11331
11345
  this._ob = null;
11332
11346
  }
11333
11347
  this._app && this._app.unmount();
11334
- this._instance.ce = void 0;
11348
+ if (this._instance) this._instance.ce = void 0;
11335
11349
  this._app = this._instance = null;
11336
11350
  }
11337
11351
  });
@@ -11550,7 +11564,7 @@ Expected function or array of functions, received type ${typeof value}.`
11550
11564
  }
11551
11565
  }
11552
11566
  /**
11553
- * Only called when shaddowRoot is false
11567
+ * Only called when shadowRoot is false
11554
11568
  */
11555
11569
  _parseSlots() {
11556
11570
  const slots = this._slots = {};
@@ -11562,10 +11576,10 @@ Expected function or array of functions, received type ${typeof value}.`
11562
11576
  }
11563
11577
  }
11564
11578
  /**
11565
- * Only called when shaddowRoot is false
11579
+ * Only called when shadowRoot is false
11566
11580
  */
11567
11581
  _renderSlots() {
11568
- const outlets = this.querySelectorAll("slot");
11582
+ const outlets = (this._teleportTarget || this).querySelectorAll("slot");
11569
11583
  const scopeId = this._instance.type.__scopeId;
11570
11584
  for (let i = 0; i < outlets.length; i++) {
11571
11585
  const o = outlets[i];
@@ -11732,7 +11746,7 @@ Expected function or array of functions, received type ${typeof value}.`
11732
11746
  child,
11733
11747
  resolveTransitionHooks(child, cssTransitionProps, state, instance)
11734
11748
  );
11735
- } else {
11749
+ } else if (child.type !== Text) {
11736
11750
  warn(`<TransitionGroup> children must be keyed.`);
11737
11751
  }
11738
11752
  }
@@ -12693,7 +12707,7 @@ Make sure to use the production build (*.prod.js) when deploying for production.
12693
12707
  this.sequenceIndex += 1;
12694
12708
  } else if (this.sequenceIndex === 0) {
12695
12709
  if (this.currentSequence === Sequences.TitleEnd || this.currentSequence === Sequences.TextareaEnd && !this.inSFCRoot) {
12696
- if (c === this.delimiterOpen[0]) {
12710
+ if (!this.inVPre && c === this.delimiterOpen[0]) {
12697
12711
  this.state = 2;
12698
12712
  this.delimiterIndex = 0;
12699
12713
  this.stateInterpolationOpen(c);
@@ -13596,6 +13610,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
13596
13610
  getNamespace: () => 0,
13597
13611
  isVoidTag: NO,
13598
13612
  isPreTag: NO,
13613
+ isIgnoreNewlineTag: NO,
13599
13614
  isCustomElement: NO,
13600
13615
  onError: defaultOnError,
13601
13616
  onWarn: defaultOnWarn,
@@ -14026,7 +14041,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
14026
14041
  el.innerLoc.end.offset
14027
14042
  );
14028
14043
  }
14029
- const { tag, ns } = el;
14044
+ const { tag, ns, children } = el;
14030
14045
  if (!inVPre) {
14031
14046
  if (tag === "slot") {
14032
14047
  el.tagType = 2;
@@ -14037,7 +14052,13 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
14037
14052
  }
14038
14053
  }
14039
14054
  if (!tokenizer.inRCDATA) {
14040
- el.children = condenseWhitespace(el.children, el.tag);
14055
+ el.children = condenseWhitespace(children);
14056
+ }
14057
+ if (ns === 0 && currentOptions.isIgnoreNewlineTag(tag)) {
14058
+ const first = children[0];
14059
+ if (first && first.type === 2) {
14060
+ first.content = first.content.replace(/^\r?\n/, "");
14061
+ }
14041
14062
  }
14042
14063
  if (ns === 0 && currentOptions.isPreTag(tag)) {
14043
14064
  inPre--;
@@ -14118,12 +14139,6 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
14118
14139
  }
14119
14140
  }
14120
14141
  }
14121
- if (inPre && tag && currentOptions.isPreTag(tag)) {
14122
- const first = nodes[0];
14123
- if (first && first.type === 2) {
14124
- first.content = first.content.replace(/^\r?\n/, "");
14125
- }
14126
- }
14127
14142
  return removedWhitespace ? nodes.filter(Boolean) : nodes;
14128
14143
  }
14129
14144
  function isAllWhitespace(str) {
@@ -17184,6 +17199,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
17184
17199
  isVoidTag,
17185
17200
  isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
17186
17201
  isPreTag: (tag) => tag === "pre",
17202
+ isIgnoreNewlineTag: (tag) => tag === "pre" || tag === "textarea",
17187
17203
  decodeEntities: decodeHtmlBrowser ,
17188
17204
  isBuiltInComponent: (tag) => {
17189
17205
  if (tag === "Transition" || tag === "transition") {