@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
  **/
@@ -596,9 +596,11 @@ function prepareDeps(sub) {
596
596
  function cleanupDeps(sub) {
597
597
  let head;
598
598
  let tail = sub.depsTail;
599
- for (let link = tail; link; link = link.prevDep) {
599
+ let link = tail;
600
+ while (link) {
601
+ const prev = link.prevDep;
600
602
  if (link.version === -1) {
601
- if (link === tail) tail = link.prevDep;
603
+ if (link === tail) tail = prev;
602
604
  removeSub(link);
603
605
  removeDep(link);
604
606
  } else {
@@ -606,6 +608,7 @@ function cleanupDeps(sub) {
606
608
  }
607
609
  link.dep.activeLink = link.prevActiveLink;
608
610
  link.prevActiveLink = void 0;
611
+ link = prev;
609
612
  }
610
613
  sub.deps = head;
611
614
  sub.depsTail = tail;
@@ -734,6 +737,14 @@ function cleanupEffect(e) {
734
737
  }
735
738
 
736
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
+ }
737
748
  class Dep {
738
749
  constructor(computed) {
739
750
  this.computed = computed;
@@ -756,16 +767,7 @@ class Dep {
756
767
  }
757
768
  let link = this.activeLink;
758
769
  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
- };
770
+ link = this.activeLink = new Link(activeSub, this);
769
771
  if (!activeSub.deps) {
770
772
  activeSub.deps = activeSub.depsTail = link;
771
773
  } else {
@@ -2678,7 +2680,9 @@ function reload(id, newComp) {
2678
2680
  dirtyInstances.delete(instance);
2679
2681
  } else if (instance.parent) {
2680
2682
  queueJob(() => {
2683
+ isHmrUpdating = true;
2681
2684
  instance.parent.update();
2685
+ isHmrUpdating = false;
2682
2686
  dirtyInstances.delete(instance);
2683
2687
  });
2684
2688
  } else if (instance.appContext.reload) {
@@ -3497,6 +3501,9 @@ const TeleportImpl = {
3497
3501
  insert(mainAnchor, container, anchor);
3498
3502
  const mount = (container2, anchor2) => {
3499
3503
  if (shapeFlag & 16) {
3504
+ if (parentComponent && parentComponent.isCE) {
3505
+ parentComponent.ce._teleportTarget = container2;
3506
+ }
3500
3507
  mountChildren(
3501
3508
  children,
3502
3509
  container2,
@@ -4530,7 +4537,11 @@ Server rendered element contains more child nodes than client vdom.`
4530
4537
  remove(cur);
4531
4538
  }
4532
4539
  } else if (shapeFlag & 8) {
4533
- if (el.textContent !== vnode.children) {
4540
+ let clientText = vnode.children;
4541
+ if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
4542
+ clientText = clientText.slice(1);
4543
+ }
4544
+ if (el.textContent !== clientText) {
4534
4545
  if (!isMismatchAllowed(el, 0 /* TEXT */)) {
4535
4546
  warn$1(
4536
4547
  `Hydration text content mismatch on`,
@@ -4729,7 +4740,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4729
4740
  }
4730
4741
  };
4731
4742
  const isTemplateNode = (node) => {
4732
- return node.nodeType === 1 && node.tagName.toLowerCase() === "template";
4743
+ return node.nodeType === 1 && node.tagName === "TEMPLATE";
4733
4744
  };
4734
4745
  return [hydrate, hydrateNode];
4735
4746
  }
@@ -5081,7 +5092,7 @@ function defineAsyncComponent(source) {
5081
5092
  load().then(() => {
5082
5093
  loaded.value = true;
5083
5094
  if (instance.parent && isKeepAlive(instance.parent.vnode)) {
5084
- queueJob(instance.parent.update);
5095
+ instance.parent.update();
5085
5096
  }
5086
5097
  }).catch((err) => {
5087
5098
  onError(err);
@@ -7032,7 +7043,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7032
7043
  return vm;
7033
7044
  }
7034
7045
  }
7035
- Vue.version = `2.6.14-compat:${"3.5.4"}`;
7046
+ Vue.version = `2.6.14-compat:${"3.5.5"}`;
7036
7047
  Vue.config = singletonApp.config;
7037
7048
  Vue.use = (plugin, ...options) => {
7038
7049
  if (plugin && isFunction(plugin.install)) {
@@ -8854,6 +8865,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8854
8865
  }
8855
8866
  }
8856
8867
  if (instance.asyncDep) {
8868
+ if (isHmrUpdating) initialVNode.el = null;
8857
8869
  parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
8858
8870
  if (!initialVNode.el) {
8859
8871
  const placeholder = instance.subTree = createVNode(Comment);
@@ -12145,7 +12157,7 @@ function isMemoSame(cached, memo) {
12145
12157
  return true;
12146
12158
  }
12147
12159
 
12148
- const version = "3.5.4";
12160
+ const version = "3.5.5";
12149
12161
  const warn = warn$1 ;
12150
12162
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12151
12163
  const devtools = devtools$1 ;
@@ -13133,6 +13145,7 @@ class VueElement extends BaseClass {
13133
13145
  }
13134
13146
  }
13135
13147
  connectedCallback() {
13148
+ if (!this.isConnected) return;
13136
13149
  if (!this.shadowRoot) {
13137
13150
  this._parseSlots();
13138
13151
  }
@@ -13175,7 +13188,7 @@ class VueElement extends BaseClass {
13175
13188
  this._ob = null;
13176
13189
  }
13177
13190
  this._app && this._app.unmount();
13178
- this._instance.ce = void 0;
13191
+ if (this._instance) this._instance.ce = void 0;
13179
13192
  this._app = this._instance = null;
13180
13193
  }
13181
13194
  });
@@ -13394,7 +13407,7 @@ class VueElement extends BaseClass {
13394
13407
  }
13395
13408
  }
13396
13409
  /**
13397
- * Only called when shaddowRoot is false
13410
+ * Only called when shadowRoot is false
13398
13411
  */
13399
13412
  _parseSlots() {
13400
13413
  const slots = this._slots = {};
@@ -13406,10 +13419,10 @@ class VueElement extends BaseClass {
13406
13419
  }
13407
13420
  }
13408
13421
  /**
13409
- * Only called when shaddowRoot is false
13422
+ * Only called when shadowRoot is false
13410
13423
  */
13411
13424
  _renderSlots() {
13412
- const outlets = this.querySelectorAll("slot");
13425
+ const outlets = (this._teleportTarget || this).querySelectorAll("slot");
13413
13426
  const scopeId = this._instance.type.__scopeId;
13414
13427
  for (let i = 0; i < outlets.length; i++) {
13415
13428
  const o = outlets[i];
@@ -13597,7 +13610,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
13597
13610
  child,
13598
13611
  resolveTransitionHooks(child, cssTransitionProps, state, instance)
13599
13612
  );
13600
- } else {
13613
+ } else if (child.type !== Text) {
13601
13614
  warn(`<TransitionGroup> children must be keyed.`);
13602
13615
  }
13603
13616
  }