@vue/compat 3.5.4 → 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.4
2
+ * @vue/compat v3.5.5
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -663,9 +663,11 @@ function prepareDeps(sub) {
663
663
  function cleanupDeps(sub) {
664
664
  let head;
665
665
  let tail = sub.depsTail;
666
- for (let link = tail; link; link = link.prevDep) {
666
+ let link = tail;
667
+ while (link) {
668
+ const prev = link.prevDep;
667
669
  if (link.version === -1) {
668
- if (link === tail) tail = link.prevDep;
670
+ if (link === tail) tail = prev;
669
671
  removeSub(link);
670
672
  removeDep(link);
671
673
  } else {
@@ -673,6 +675,7 @@ function cleanupDeps(sub) {
673
675
  }
674
676
  link.dep.activeLink = link.prevActiveLink;
675
677
  link.prevActiveLink = void 0;
678
+ link = prev;
676
679
  }
677
680
  sub.deps = head;
678
681
  sub.depsTail = tail;
@@ -801,6 +804,14 @@ function cleanupEffect(e) {
801
804
  }
802
805
 
803
806
  let globalVersion = 0;
807
+ class Link {
808
+ constructor(sub, dep) {
809
+ this.sub = sub;
810
+ this.dep = dep;
811
+ this.version = dep.version;
812
+ this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
813
+ }
814
+ }
804
815
  class Dep {
805
816
  constructor(computed) {
806
817
  this.computed = computed;
@@ -823,16 +834,7 @@ class Dep {
823
834
  }
824
835
  let link = this.activeLink;
825
836
  if (link === void 0 || link.sub !== activeSub) {
826
- link = this.activeLink = {
827
- dep: this,
828
- sub: activeSub,
829
- version: this.version,
830
- nextDep: void 0,
831
- prevDep: void 0,
832
- nextSub: void 0,
833
- prevSub: void 0,
834
- prevActiveLink: void 0
835
- };
837
+ link = this.activeLink = new Link(activeSub, this);
836
838
  if (!activeSub.deps) {
837
839
  activeSub.deps = activeSub.depsTail = link;
838
840
  } else {
@@ -2760,7 +2762,9 @@ function reload(id, newComp) {
2760
2762
  dirtyInstances.delete(instance);
2761
2763
  } else if (instance.parent) {
2762
2764
  queueJob(() => {
2765
+ isHmrUpdating = true;
2763
2766
  instance.parent.update();
2767
+ isHmrUpdating = false;
2764
2768
  dirtyInstances.delete(instance);
2765
2769
  });
2766
2770
  } else if (instance.appContext.reload) {
@@ -3582,6 +3586,9 @@ const TeleportImpl = {
3582
3586
  insert(mainAnchor, container, anchor);
3583
3587
  const mount = (container2, anchor2) => {
3584
3588
  if (shapeFlag & 16) {
3589
+ if (parentComponent && parentComponent.isCE) {
3590
+ parentComponent.ce._teleportTarget = container2;
3591
+ }
3585
3592
  mountChildren(
3586
3593
  children,
3587
3594
  container2,
@@ -4616,7 +4623,11 @@ Server rendered element contains more child nodes than client vdom.`
4616
4623
  remove(cur);
4617
4624
  }
4618
4625
  } else if (shapeFlag & 8) {
4619
- if (el.textContent !== vnode.children) {
4626
+ let clientText = vnode.children;
4627
+ if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
4628
+ clientText = clientText.slice(1);
4629
+ }
4630
+ if (el.textContent !== clientText) {
4620
4631
  if (!isMismatchAllowed(el, 0 /* TEXT */)) {
4621
4632
  (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(
4622
4633
  `Hydration text content mismatch on`,
@@ -4826,7 +4837,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4826
4837
  }
4827
4838
  };
4828
4839
  const isTemplateNode = (node) => {
4829
- return node.nodeType === 1 && node.tagName.toLowerCase() === "template";
4840
+ return node.nodeType === 1 && node.tagName === "TEMPLATE";
4830
4841
  };
4831
4842
  return [hydrate, hydrateNode];
4832
4843
  }
@@ -5178,7 +5189,7 @@ function defineAsyncComponent(source) {
5178
5189
  load().then(() => {
5179
5190
  loaded.value = true;
5180
5191
  if (instance.parent && isKeepAlive(instance.parent.vnode)) {
5181
- queueJob(instance.parent.update);
5192
+ instance.parent.update();
5182
5193
  }
5183
5194
  }).catch((err) => {
5184
5195
  onError(err);
@@ -7131,7 +7142,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7131
7142
  return vm;
7132
7143
  }
7133
7144
  }
7134
- Vue.version = `2.6.14-compat:${"3.5.4"}`;
7145
+ Vue.version = `2.6.14-compat:${"3.5.5"}`;
7135
7146
  Vue.config = singletonApp.config;
7136
7147
  Vue.use = (plugin, ...options) => {
7137
7148
  if (plugin && isFunction(plugin.install)) {
@@ -8993,6 +9004,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8993
9004
  }
8994
9005
  }
8995
9006
  if (instance.asyncDep) {
9007
+ if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating) initialVNode.el = null;
8996
9008
  parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
8997
9009
  if (!initialVNode.el) {
8998
9010
  const placeholder = instance.subTree = createVNode(Comment);
@@ -12298,7 +12310,7 @@ function isMemoSame(cached, memo) {
12298
12310
  return true;
12299
12311
  }
12300
12312
 
12301
- const version = "3.5.4";
12313
+ const version = "3.5.5";
12302
12314
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
12303
12315
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12304
12316
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -13286,6 +13298,7 @@ class VueElement extends BaseClass {
13286
13298
  }
13287
13299
  }
13288
13300
  connectedCallback() {
13301
+ if (!this.isConnected) return;
13289
13302
  if (!this.shadowRoot) {
13290
13303
  this._parseSlots();
13291
13304
  }
@@ -13328,7 +13341,7 @@ class VueElement extends BaseClass {
13328
13341
  this._ob = null;
13329
13342
  }
13330
13343
  this._app && this._app.unmount();
13331
- this._instance.ce = void 0;
13344
+ if (this._instance) this._instance.ce = void 0;
13332
13345
  this._app = this._instance = null;
13333
13346
  }
13334
13347
  });
@@ -13547,7 +13560,7 @@ class VueElement extends BaseClass {
13547
13560
  }
13548
13561
  }
13549
13562
  /**
13550
- * Only called when shaddowRoot is false
13563
+ * Only called when shadowRoot is false
13551
13564
  */
13552
13565
  _parseSlots() {
13553
13566
  const slots = this._slots = {};
@@ -13559,10 +13572,10 @@ class VueElement extends BaseClass {
13559
13572
  }
13560
13573
  }
13561
13574
  /**
13562
- * Only called when shaddowRoot is false
13575
+ * Only called when shadowRoot is false
13563
13576
  */
13564
13577
  _renderSlots() {
13565
- const outlets = this.querySelectorAll("slot");
13578
+ const outlets = (this._teleportTarget || this).querySelectorAll("slot");
13566
13579
  const scopeId = this._instance.type.__scopeId;
13567
13580
  for (let i = 0; i < outlets.length; i++) {
13568
13581
  const o = outlets[i];
@@ -13750,7 +13763,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
13750
13763
  child,
13751
13764
  resolveTransitionHooks(child, cssTransitionProps, state, instance)
13752
13765
  );
13753
- } else if (!!(process.env.NODE_ENV !== "production")) {
13766
+ } else if (!!(process.env.NODE_ENV !== "production") && child.type !== Text) {
13754
13767
  warn(`<TransitionGroup> children must be keyed.`);
13755
13768
  }
13756
13769
  }
@@ -14986,7 +14999,7 @@ class Tokenizer {
14986
14999
  this.sequenceIndex += 1;
14987
15000
  } else if (this.sequenceIndex === 0) {
14988
15001
  if (this.currentSequence === Sequences.TitleEnd || this.currentSequence === Sequences.TextareaEnd && !this.inSFCRoot) {
14989
- if (c === this.delimiterOpen[0]) {
15002
+ if (!this.inVPre && c === this.delimiterOpen[0]) {
14990
15003
  this.state = 2;
14991
15004
  this.delimiterIndex = 0;
14992
15005
  this.stateInterpolationOpen(c);
@@ -15956,6 +15969,7 @@ const defaultParserOptions = {
15956
15969
  getNamespace: () => 0,
15957
15970
  isVoidTag: NO,
15958
15971
  isPreTag: NO,
15972
+ isIgnoreNewlineTag: NO,
15959
15973
  isCustomElement: NO,
15960
15974
  onError: defaultOnError,
15961
15975
  onWarn: defaultOnWarn,
@@ -16398,7 +16412,7 @@ function onCloseTag(el, end, isImplied = false) {
16398
16412
  el.innerLoc.end.offset
16399
16413
  );
16400
16414
  }
16401
- const { tag, ns } = el;
16415
+ const { tag, ns, children } = el;
16402
16416
  if (!inVPre) {
16403
16417
  if (tag === "slot") {
16404
16418
  el.tagType = 2;
@@ -16409,7 +16423,13 @@ function onCloseTag(el, end, isImplied = false) {
16409
16423
  }
16410
16424
  }
16411
16425
  if (!tokenizer.inRCDATA) {
16412
- el.children = condenseWhitespace(el.children, el.tag);
16426
+ el.children = condenseWhitespace(children);
16427
+ }
16428
+ if (ns === 0 && currentOptions.isIgnoreNewlineTag(tag)) {
16429
+ const first = children[0];
16430
+ if (first && first.type === 2) {
16431
+ first.content = first.content.replace(/^\r?\n/, "");
16432
+ }
16413
16433
  }
16414
16434
  if (ns === 0 && currentOptions.isPreTag(tag)) {
16415
16435
  inPre--;
@@ -16561,12 +16581,6 @@ function condenseWhitespace(nodes, tag) {
16561
16581
  }
16562
16582
  }
16563
16583
  }
16564
- if (inPre && tag && currentOptions.isPreTag(tag)) {
16565
- const first = nodes[0];
16566
- if (first && first.type === 2) {
16567
- first.content = first.content.replace(/^\r?\n/, "");
16568
- }
16569
- }
16570
16584
  return removedWhitespace ? nodes.filter(Boolean) : nodes;
16571
16585
  }
16572
16586
  function isAllWhitespace(str) {
@@ -19835,6 +19849,7 @@ const parserOptions = {
19835
19849
  isVoidTag,
19836
19850
  isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
19837
19851
  isPreTag: (tag) => tag === "pre",
19852
+ isIgnoreNewlineTag: (tag) => tag === "pre" || tag === "textarea",
19838
19853
  decodeEntities: decodeHtmlBrowser ,
19839
19854
  isBuiltInComponent: (tag) => {
19840
19855
  if (tag === "Transition" || tag === "transition") {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.5.4
2
+ * @vue/compat v3.5.5
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -666,9 +666,11 @@ var Vue = (function () {
666
666
  function cleanupDeps(sub) {
667
667
  let head;
668
668
  let tail = sub.depsTail;
669
- for (let link = tail; link; link = link.prevDep) {
669
+ let link = tail;
670
+ while (link) {
671
+ const prev = link.prevDep;
670
672
  if (link.version === -1) {
671
- if (link === tail) tail = link.prevDep;
673
+ if (link === tail) tail = prev;
672
674
  removeSub(link);
673
675
  removeDep(link);
674
676
  } else {
@@ -676,6 +678,7 @@ var Vue = (function () {
676
678
  }
677
679
  link.dep.activeLink = link.prevActiveLink;
678
680
  link.prevActiveLink = void 0;
681
+ link = prev;
679
682
  }
680
683
  sub.deps = head;
681
684
  sub.depsTail = tail;
@@ -804,6 +807,14 @@ var Vue = (function () {
804
807
  }
805
808
 
806
809
  let globalVersion = 0;
810
+ class Link {
811
+ constructor(sub, dep) {
812
+ this.sub = sub;
813
+ this.dep = dep;
814
+ this.version = dep.version;
815
+ this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
816
+ }
817
+ }
807
818
  class Dep {
808
819
  constructor(computed) {
809
820
  this.computed = computed;
@@ -826,16 +837,7 @@ var Vue = (function () {
826
837
  }
827
838
  let link = this.activeLink;
828
839
  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
- };
840
+ link = this.activeLink = new Link(activeSub, this);
839
841
  if (!activeSub.deps) {
840
842
  activeSub.deps = activeSub.depsTail = link;
841
843
  } else {
@@ -2748,7 +2750,9 @@ var Vue = (function () {
2748
2750
  dirtyInstances.delete(instance);
2749
2751
  } else if (instance.parent) {
2750
2752
  queueJob(() => {
2753
+ isHmrUpdating = true;
2751
2754
  instance.parent.update();
2755
+ isHmrUpdating = false;
2752
2756
  dirtyInstances.delete(instance);
2753
2757
  });
2754
2758
  } else if (instance.appContext.reload) {
@@ -3567,6 +3571,9 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3567
3571
  insert(mainAnchor, container, anchor);
3568
3572
  const mount = (container2, anchor2) => {
3569
3573
  if (shapeFlag & 16) {
3574
+ if (parentComponent && parentComponent.isCE) {
3575
+ parentComponent.ce._teleportTarget = container2;
3576
+ }
3570
3577
  mountChildren(
3571
3578
  children,
3572
3579
  container2,
@@ -4600,7 +4607,11 @@ Server rendered element contains more child nodes than client vdom.`
4600
4607
  remove(cur);
4601
4608
  }
4602
4609
  } else if (shapeFlag & 8) {
4603
- if (el.textContent !== vnode.children) {
4610
+ let clientText = vnode.children;
4611
+ if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
4612
+ clientText = clientText.slice(1);
4613
+ }
4614
+ if (el.textContent !== clientText) {
4604
4615
  if (!isMismatchAllowed(el, 0 /* TEXT */)) {
4605
4616
  warn$1(
4606
4617
  `Hydration text content mismatch on`,
@@ -4799,7 +4810,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4799
4810
  }
4800
4811
  };
4801
4812
  const isTemplateNode = (node) => {
4802
- return node.nodeType === 1 && node.tagName.toLowerCase() === "template";
4813
+ return node.nodeType === 1 && node.tagName === "TEMPLATE";
4803
4814
  };
4804
4815
  return [hydrate, hydrateNode];
4805
4816
  }
@@ -5151,7 +5162,7 @@ Server rendered element contains fewer child nodes than client vdom.`
5151
5162
  load().then(() => {
5152
5163
  loaded.value = true;
5153
5164
  if (instance.parent && isKeepAlive(instance.parent.vnode)) {
5154
- queueJob(instance.parent.update);
5165
+ instance.parent.update();
5155
5166
  }
5156
5167
  }).catch((err) => {
5157
5168
  onError(err);
@@ -7093,7 +7104,7 @@ If this is a native custom element, make sure to exclude it from component resol
7093
7104
  return vm;
7094
7105
  }
7095
7106
  }
7096
- Vue.version = `2.6.14-compat:${"3.5.4"}`;
7107
+ Vue.version = `2.6.14-compat:${"3.5.5"}`;
7097
7108
  Vue.config = singletonApp.config;
7098
7109
  Vue.use = (plugin, ...options) => {
7099
7110
  if (plugin && isFunction(plugin.install)) {
@@ -8915,6 +8926,7 @@ If you want to remount the same app, move your app creation logic into a factory
8915
8926
  }
8916
8927
  }
8917
8928
  if (instance.asyncDep) {
8929
+ if (isHmrUpdating) initialVNode.el = null;
8918
8930
  parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
8919
8931
  if (!initialVNode.el) {
8920
8932
  const placeholder = instance.subTree = createVNode(Comment);
@@ -12170,7 +12182,7 @@ Component that was made reactive: `,
12170
12182
  return true;
12171
12183
  }
12172
12184
 
12173
- const version = "3.5.4";
12185
+ const version = "3.5.5";
12174
12186
  const warn = warn$1 ;
12175
12187
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12176
12188
  const devtools = devtools$1 ;
@@ -13139,6 +13151,7 @@ Expected function or array of functions, received type ${typeof value}.`
13139
13151
  }
13140
13152
  }
13141
13153
  connectedCallback() {
13154
+ if (!this.isConnected) return;
13142
13155
  if (!this.shadowRoot) {
13143
13156
  this._parseSlots();
13144
13157
  }
@@ -13181,7 +13194,7 @@ Expected function or array of functions, received type ${typeof value}.`
13181
13194
  this._ob = null;
13182
13195
  }
13183
13196
  this._app && this._app.unmount();
13184
- this._instance.ce = void 0;
13197
+ if (this._instance) this._instance.ce = void 0;
13185
13198
  this._app = this._instance = null;
13186
13199
  }
13187
13200
  });
@@ -13400,7 +13413,7 @@ Expected function or array of functions, received type ${typeof value}.`
13400
13413
  }
13401
13414
  }
13402
13415
  /**
13403
- * Only called when shaddowRoot is false
13416
+ * Only called when shadowRoot is false
13404
13417
  */
13405
13418
  _parseSlots() {
13406
13419
  const slots = this._slots = {};
@@ -13412,10 +13425,10 @@ Expected function or array of functions, received type ${typeof value}.`
13412
13425
  }
13413
13426
  }
13414
13427
  /**
13415
- * Only called when shaddowRoot is false
13428
+ * Only called when shadowRoot is false
13416
13429
  */
13417
13430
  _renderSlots() {
13418
- const outlets = this.querySelectorAll("slot");
13431
+ const outlets = (this._teleportTarget || this).querySelectorAll("slot");
13419
13432
  const scopeId = this._instance.type.__scopeId;
13420
13433
  for (let i = 0; i < outlets.length; i++) {
13421
13434
  const o = outlets[i];
@@ -13591,7 +13604,7 @@ Expected function or array of functions, received type ${typeof value}.`
13591
13604
  child,
13592
13605
  resolveTransitionHooks(child, cssTransitionProps, state, instance)
13593
13606
  );
13594
- } else {
13607
+ } else if (child.type !== Text) {
13595
13608
  warn(`<TransitionGroup> children must be keyed.`);
13596
13609
  }
13597
13610
  }
@@ -14792,7 +14805,7 @@ Make sure to use the production build (*.prod.js) when deploying for production.
14792
14805
  this.sequenceIndex += 1;
14793
14806
  } else if (this.sequenceIndex === 0) {
14794
14807
  if (this.currentSequence === Sequences.TitleEnd || this.currentSequence === Sequences.TextareaEnd && !this.inSFCRoot) {
14795
- if (c === this.delimiterOpen[0]) {
14808
+ if (!this.inVPre && c === this.delimiterOpen[0]) {
14796
14809
  this.state = 2;
14797
14810
  this.delimiterIndex = 0;
14798
14811
  this.stateInterpolationOpen(c);
@@ -15762,6 +15775,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
15762
15775
  getNamespace: () => 0,
15763
15776
  isVoidTag: NO,
15764
15777
  isPreTag: NO,
15778
+ isIgnoreNewlineTag: NO,
15765
15779
  isCustomElement: NO,
15766
15780
  onError: defaultOnError,
15767
15781
  onWarn: defaultOnWarn,
@@ -16204,7 +16218,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
16204
16218
  el.innerLoc.end.offset
16205
16219
  );
16206
16220
  }
16207
- const { tag, ns } = el;
16221
+ const { tag, ns, children } = el;
16208
16222
  if (!inVPre) {
16209
16223
  if (tag === "slot") {
16210
16224
  el.tagType = 2;
@@ -16215,7 +16229,13 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
16215
16229
  }
16216
16230
  }
16217
16231
  if (!tokenizer.inRCDATA) {
16218
- el.children = condenseWhitespace(el.children, el.tag);
16232
+ el.children = condenseWhitespace(children);
16233
+ }
16234
+ if (ns === 0 && currentOptions.isIgnoreNewlineTag(tag)) {
16235
+ const first = children[0];
16236
+ if (first && first.type === 2) {
16237
+ first.content = first.content.replace(/^\r?\n/, "");
16238
+ }
16219
16239
  }
16220
16240
  if (ns === 0 && currentOptions.isPreTag(tag)) {
16221
16241
  inPre--;
@@ -16367,12 +16387,6 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
16367
16387
  }
16368
16388
  }
16369
16389
  }
16370
- if (inPre && tag && currentOptions.isPreTag(tag)) {
16371
- const first = nodes[0];
16372
- if (first && first.type === 2) {
16373
- first.content = first.content.replace(/^\r?\n/, "");
16374
- }
16375
- }
16376
16390
  return removedWhitespace ? nodes.filter(Boolean) : nodes;
16377
16391
  }
16378
16392
  function isAllWhitespace(str) {
@@ -19638,6 +19652,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
19638
19652
  isVoidTag,
19639
19653
  isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
19640
19654
  isPreTag: (tag) => tag === "pre",
19655
+ isIgnoreNewlineTag: (tag) => tag === "pre" || tag === "textarea",
19641
19656
  decodeEntities: decodeHtmlBrowser ,
19642
19657
  isBuiltInComponent: (tag) => {
19643
19658
  if (tag === "Transition" || tag === "transition") {