@vue/runtime-core 3.3.6 → 3.3.8

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.
@@ -242,8 +242,13 @@ function findInsertionIndex(id) {
242
242
  let end = queue.length;
243
243
  while (start < end) {
244
244
  const middle = start + end >>> 1;
245
- const middleJobId = getId(queue[middle]);
246
- middleJobId < id ? start = middle + 1 : end = middle;
245
+ const middleJob = queue[middle];
246
+ const middleJobId = getId(middleJob);
247
+ if (middleJobId < id || middleJobId === id && middleJob.pre) {
248
+ start = middle + 1;
249
+ } else {
250
+ end = middle;
251
+ }
247
252
  }
248
253
  return start;
249
254
  }
@@ -1045,6 +1050,61 @@ function updateHOCHostEl({ vnode, parent }, el) {
1045
1050
  }
1046
1051
  }
1047
1052
 
1053
+ const COMPONENTS = "components";
1054
+ const DIRECTIVES = "directives";
1055
+ function resolveComponent(name, maybeSelfReference) {
1056
+ return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
1057
+ }
1058
+ const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
1059
+ function resolveDynamicComponent(component) {
1060
+ if (shared.isString(component)) {
1061
+ return resolveAsset(COMPONENTS, component, false) || component;
1062
+ } else {
1063
+ return component || NULL_DYNAMIC_COMPONENT;
1064
+ }
1065
+ }
1066
+ function resolveDirective(name) {
1067
+ return resolveAsset(DIRECTIVES, name);
1068
+ }
1069
+ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
1070
+ const instance = currentRenderingInstance || currentInstance;
1071
+ if (instance) {
1072
+ const Component = instance.type;
1073
+ if (type === COMPONENTS) {
1074
+ const selfName = getComponentName(
1075
+ Component,
1076
+ false
1077
+ /* do not include inferred name to avoid breaking existing code */
1078
+ );
1079
+ if (selfName && (selfName === name || selfName === shared.camelize(name) || selfName === shared.capitalize(shared.camelize(name)))) {
1080
+ return Component;
1081
+ }
1082
+ }
1083
+ const res = (
1084
+ // local registration
1085
+ // check instance[type] first which is resolved for options API
1086
+ resolve(instance[type] || Component[type], name) || // global registration
1087
+ resolve(instance.appContext[type], name)
1088
+ );
1089
+ if (!res && maybeSelfReference) {
1090
+ return Component;
1091
+ }
1092
+ if (warnMissing && !res) {
1093
+ const extra = type === COMPONENTS ? `
1094
+ If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
1095
+ warn(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
1096
+ }
1097
+ return res;
1098
+ } else {
1099
+ warn(
1100
+ `resolve${shared.capitalize(type.slice(0, -1))} can only be used in render() or setup().`
1101
+ );
1102
+ }
1103
+ }
1104
+ function resolve(registry, name) {
1105
+ return registry && (registry[name] || registry[shared.camelize(name)] || registry[shared.capitalize(shared.camelize(name))]);
1106
+ }
1107
+
1048
1108
  const isSuspense = (type) => type.__isSuspense;
1049
1109
  const SuspenseImpl = {
1050
1110
  name: "Suspense",
@@ -1358,14 +1418,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
1358
1418
  parentComponent: parentComponent2,
1359
1419
  container: container2
1360
1420
  } = suspense;
1421
+ let delayEnter = false;
1361
1422
  if (suspense.isHydrating) {
1362
1423
  suspense.isHydrating = false;
1363
1424
  } else if (!resume) {
1364
- const delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
1425
+ delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
1365
1426
  if (delayEnter) {
1366
1427
  activeBranch.transition.afterLeave = () => {
1367
1428
  if (pendingId === suspense.pendingId) {
1368
1429
  move(pendingBranch, container2, anchor2, 0);
1430
+ queuePostFlushCb(effects);
1369
1431
  }
1370
1432
  };
1371
1433
  }
@@ -1391,7 +1453,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
1391
1453
  }
1392
1454
  parent = parent.parent;
1393
1455
  }
1394
- if (!hasUnresolvedAncestor) {
1456
+ if (!hasUnresolvedAncestor && !delayEnter) {
1395
1457
  queuePostFlushCb(effects);
1396
1458
  }
1397
1459
  suspense.effects = [];
@@ -1577,7 +1639,7 @@ function normalizeSuspenseSlot(s) {
1577
1639
  }
1578
1640
  if (shared.isArray(s)) {
1579
1641
  const singleChild = filterSingleRoot(s);
1580
- if (!singleChild) {
1642
+ if (!singleChild && s.filter((child) => child !== NULL_DYNAMIC_COMPONENT).length > 0) {
1581
1643
  warn(`<Suspense> slots expect a single root node.`);
1582
1644
  }
1583
1645
  s = singleChild;
@@ -2689,61 +2751,6 @@ function onErrorCaptured(hook, target = currentInstance) {
2689
2751
  injectHook("ec", hook, target);
2690
2752
  }
2691
2753
 
2692
- const COMPONENTS = "components";
2693
- const DIRECTIVES = "directives";
2694
- function resolveComponent(name, maybeSelfReference) {
2695
- return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
2696
- }
2697
- const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
2698
- function resolveDynamicComponent(component) {
2699
- if (shared.isString(component)) {
2700
- return resolveAsset(COMPONENTS, component, false) || component;
2701
- } else {
2702
- return component || NULL_DYNAMIC_COMPONENT;
2703
- }
2704
- }
2705
- function resolveDirective(name) {
2706
- return resolveAsset(DIRECTIVES, name);
2707
- }
2708
- function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
2709
- const instance = currentRenderingInstance || currentInstance;
2710
- if (instance) {
2711
- const Component = instance.type;
2712
- if (type === COMPONENTS) {
2713
- const selfName = getComponentName(
2714
- Component,
2715
- false
2716
- /* do not include inferred name to avoid breaking existing code */
2717
- );
2718
- if (selfName && (selfName === name || selfName === shared.camelize(name) || selfName === shared.capitalize(shared.camelize(name)))) {
2719
- return Component;
2720
- }
2721
- }
2722
- const res = (
2723
- // local registration
2724
- // check instance[type] first which is resolved for options API
2725
- resolve(instance[type] || Component[type], name) || // global registration
2726
- resolve(instance.appContext[type], name)
2727
- );
2728
- if (!res && maybeSelfReference) {
2729
- return Component;
2730
- }
2731
- if (warnMissing && !res) {
2732
- const extra = type === COMPONENTS ? `
2733
- If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
2734
- warn(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
2735
- }
2736
- return res;
2737
- } else {
2738
- warn(
2739
- `resolve${shared.capitalize(type.slice(0, -1))} can only be used in render() or setup().`
2740
- );
2741
- }
2742
- }
2743
- function resolve(registry, name) {
2744
- return registry && (registry[name] || registry[shared.camelize(name)] || registry[shared.capitalize(shared.camelize(name))]);
2745
- }
2746
-
2747
2754
  function renderList(source, renderItem, cache, index) {
2748
2755
  let ret;
2749
2756
  const cached = cache && cache[index];
@@ -4559,7 +4566,14 @@ function createHydrationFunctions(rendererInternals) {
4559
4566
  }
4560
4567
  break;
4561
4568
  case Comment:
4562
- if (domType !== 8 /* COMMENT */ || isFragmentStart) {
4569
+ if (isTemplateNode(node)) {
4570
+ nextNode = nextSibling(node);
4571
+ replaceNode(
4572
+ vnode.el = node.content.firstChild,
4573
+ node,
4574
+ parentComponent
4575
+ );
4576
+ } else if (domType !== 8 /* COMMENT */ || isFragmentStart) {
4563
4577
  nextNode = onMismatch();
4564
4578
  } else {
4565
4579
  nextNode = nextSibling(node);
@@ -4602,7 +4616,7 @@ function createHydrationFunctions(rendererInternals) {
4602
4616
  break;
4603
4617
  default:
4604
4618
  if (shapeFlag & 1) {
4605
- if (domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) {
4619
+ if ((domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
4606
4620
  nextNode = onMismatch();
4607
4621
  } else {
4608
4622
  nextNode = hydrateElement(
@@ -4617,6 +4631,13 @@ function createHydrationFunctions(rendererInternals) {
4617
4631
  } else if (shapeFlag & 6) {
4618
4632
  vnode.slotScopeIds = slotScopeIds;
4619
4633
  const container = parentNode(node);
4634
+ if (isFragmentStart) {
4635
+ nextNode = locateClosingAnchor(node);
4636
+ } else if (isComment(node) && node.data === "teleport start") {
4637
+ nextNode = locateClosingAnchor(node, node.data, "teleport end");
4638
+ } else {
4639
+ nextNode = nextSibling(node);
4640
+ }
4620
4641
  mountComponent(
4621
4642
  vnode,
4622
4643
  container,
@@ -4626,10 +4647,6 @@ function createHydrationFunctions(rendererInternals) {
4626
4647
  isSVGContainer(container),
4627
4648
  optimized
4628
4649
  );
4629
- nextNode = isFragmentStart ? locateClosingAsyncAnchor(node) : nextSibling(node);
4630
- if (nextNode && isComment(nextNode) && nextNode.data === "teleport end") {
4631
- nextNode = nextSibling(nextNode);
4632
- }
4633
4650
  if (isAsyncWrapper(vnode)) {
4634
4651
  let subTree;
4635
4652
  if (isFragmentStart) {
@@ -4679,7 +4696,7 @@ function createHydrationFunctions(rendererInternals) {
4679
4696
  };
4680
4697
  const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
4681
4698
  optimized = optimized || !!vnode.dynamicChildren;
4682
- const { type, props, patchFlag, shapeFlag, dirs } = vnode;
4699
+ const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
4683
4700
  const forcePatchValue = type === "input" && dirs || type === "option";
4684
4701
  {
4685
4702
  if (dirs) {
@@ -4716,12 +4733,23 @@ function createHydrationFunctions(rendererInternals) {
4716
4733
  if (vnodeHooks = props && props.onVnodeBeforeMount) {
4717
4734
  invokeVNodeHook(vnodeHooks, parentComponent, vnode);
4718
4735
  }
4736
+ let needCallTransitionHooks = false;
4737
+ if (isTemplateNode(el)) {
4738
+ needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
4739
+ const content = el.content.firstChild;
4740
+ if (needCallTransitionHooks) {
4741
+ transition.beforeEnter(content);
4742
+ }
4743
+ replaceNode(content, el, parentComponent);
4744
+ vnode.el = el = content;
4745
+ }
4719
4746
  if (dirs) {
4720
4747
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
4721
4748
  }
4722
- if ((vnodeHooks = props && props.onVnodeMounted) || dirs) {
4749
+ if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
4723
4750
  queueEffectWithSuspense(() => {
4724
4751
  vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
4752
+ needCallTransitionHooks && transition.enter(el);
4725
4753
  dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
4726
4754
  }, parentSuspense);
4727
4755
  }
@@ -4839,7 +4867,7 @@ function createHydrationFunctions(rendererInternals) {
4839
4867
  );
4840
4868
  vnode.el = null;
4841
4869
  if (isFragment) {
4842
- const end = locateClosingAsyncAnchor(node);
4870
+ const end = locateClosingAnchor(node);
4843
4871
  while (true) {
4844
4872
  const next2 = nextSibling(node);
4845
4873
  if (next2 && next2 !== end) {
@@ -4864,14 +4892,14 @@ function createHydrationFunctions(rendererInternals) {
4864
4892
  );
4865
4893
  return next;
4866
4894
  };
4867
- const locateClosingAsyncAnchor = (node) => {
4895
+ const locateClosingAnchor = (node, open = "[", close = "]") => {
4868
4896
  let match = 0;
4869
4897
  while (node) {
4870
4898
  node = nextSibling(node);
4871
4899
  if (node && isComment(node)) {
4872
- if (node.data === "[")
4900
+ if (node.data === open)
4873
4901
  match++;
4874
- if (node.data === "]") {
4902
+ if (node.data === close) {
4875
4903
  if (match === 0) {
4876
4904
  return nextSibling(node);
4877
4905
  } else {
@@ -4882,6 +4910,22 @@ function createHydrationFunctions(rendererInternals) {
4882
4910
  }
4883
4911
  return node;
4884
4912
  };
4913
+ const replaceNode = (newNode, oldNode, parentComponent) => {
4914
+ const parentNode2 = oldNode.parentNode;
4915
+ if (parentNode2) {
4916
+ parentNode2.replaceChild(newNode, oldNode);
4917
+ }
4918
+ let parent = parentComponent;
4919
+ while (parent) {
4920
+ if (parent.vnode.el === oldNode) {
4921
+ parent.vnode.el = parent.subTree.el = newNode;
4922
+ }
4923
+ parent = parent.parent;
4924
+ }
4925
+ };
4926
+ const isTemplateNode = (node) => {
4927
+ return node.nodeType === 1 /* ELEMENT */ && node.tagName.toLowerCase() === "template";
4928
+ };
4885
4929
  return [hydrate, hydrateNode];
4886
4930
  }
4887
4931
 
@@ -5209,7 +5253,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5209
5253
  if (dirs) {
5210
5254
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
5211
5255
  }
5212
- const needCallTransitionHooks = (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
5256
+ const needCallTransitionHooks = needTransition(parentSuspense, transition);
5213
5257
  if (needCallTransitionHooks) {
5214
5258
  transition.beforeEnter(el);
5215
5259
  }
@@ -6101,8 +6145,8 @@ function baseCreateRenderer(options, createHydrationFns) {
6101
6145
  moveStaticNode(vnode, container, anchor);
6102
6146
  return;
6103
6147
  }
6104
- const needTransition = moveType !== 2 && shapeFlag & 1 && transition;
6105
- if (needTransition) {
6148
+ const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
6149
+ if (needTransition2) {
6106
6150
  if (moveType === 0) {
6107
6151
  transition.beforeEnter(el);
6108
6152
  hostInsert(el, container, anchor);
@@ -6322,6 +6366,9 @@ function baseCreateRenderer(options, createHydrationFns) {
6322
6366
  function toggleRecurse({ effect, update }, allowed) {
6323
6367
  effect.allowRecurse = update.allowRecurse = allowed;
6324
6368
  }
6369
+ function needTransition(parentSuspense, transition) {
6370
+ return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
6371
+ }
6325
6372
  function traverseStaticChildren(n1, n2, shallow = false) {
6326
6373
  const ch1 = n1.children;
6327
6374
  const ch2 = n2.children;
@@ -7673,7 +7720,7 @@ function isMemoSame(cached, memo) {
7673
7720
  return true;
7674
7721
  }
7675
7722
 
7676
- const version = "3.3.6";
7723
+ const version = "3.3.8";
7677
7724
  const _ssrUtils = {
7678
7725
  createComponentInstance,
7679
7726
  setupComponent,
@@ -91,8 +91,13 @@ function findInsertionIndex(id) {
91
91
  let end = queue.length;
92
92
  while (start < end) {
93
93
  const middle = start + end >>> 1;
94
- const middleJobId = getId(queue[middle]);
95
- middleJobId < id ? start = middle + 1 : end = middle;
94
+ const middleJob = queue[middle];
95
+ const middleJobId = getId(middleJob);
96
+ if (middleJobId < id || middleJobId === id && middleJob.pre) {
97
+ start = middle + 1;
98
+ } else {
99
+ end = middle;
100
+ }
96
101
  }
97
102
  return start;
98
103
  }
@@ -563,6 +568,52 @@ function updateHOCHostEl({ vnode, parent }, el) {
563
568
  }
564
569
  }
565
570
 
571
+ const COMPONENTS = "components";
572
+ const DIRECTIVES = "directives";
573
+ function resolveComponent(name, maybeSelfReference) {
574
+ return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
575
+ }
576
+ const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
577
+ function resolveDynamicComponent(component) {
578
+ if (shared.isString(component)) {
579
+ return resolveAsset(COMPONENTS, component, false) || component;
580
+ } else {
581
+ return component || NULL_DYNAMIC_COMPONENT;
582
+ }
583
+ }
584
+ function resolveDirective(name) {
585
+ return resolveAsset(DIRECTIVES, name);
586
+ }
587
+ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
588
+ const instance = currentRenderingInstance || currentInstance;
589
+ if (instance) {
590
+ const Component = instance.type;
591
+ if (type === COMPONENTS) {
592
+ const selfName = getComponentName(
593
+ Component,
594
+ false
595
+ /* do not include inferred name to avoid breaking existing code */
596
+ );
597
+ if (selfName && (selfName === name || selfName === shared.camelize(name) || selfName === shared.capitalize(shared.camelize(name)))) {
598
+ return Component;
599
+ }
600
+ }
601
+ const res = (
602
+ // local registration
603
+ // check instance[type] first which is resolved for options API
604
+ resolve(instance[type] || Component[type], name) || // global registration
605
+ resolve(instance.appContext[type], name)
606
+ );
607
+ if (!res && maybeSelfReference) {
608
+ return Component;
609
+ }
610
+ return res;
611
+ }
612
+ }
613
+ function resolve(registry, name) {
614
+ return registry && (registry[name] || registry[shared.camelize(name)] || registry[shared.capitalize(shared.camelize(name))]);
615
+ }
616
+
566
617
  const isSuspense = (type) => type.__isSuspense;
567
618
  const SuspenseImpl = {
568
619
  name: "Suspense",
@@ -854,14 +905,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
854
905
  parentComponent: parentComponent2,
855
906
  container: container2
856
907
  } = suspense;
908
+ let delayEnter = false;
857
909
  if (suspense.isHydrating) {
858
910
  suspense.isHydrating = false;
859
911
  } else if (!resume) {
860
- const delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
912
+ delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
861
913
  if (delayEnter) {
862
914
  activeBranch.transition.afterLeave = () => {
863
915
  if (pendingId === suspense.pendingId) {
864
916
  move(pendingBranch, container2, anchor2, 0);
917
+ queuePostFlushCb(effects);
865
918
  }
866
919
  };
867
920
  }
@@ -887,7 +940,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
887
940
  }
888
941
  parent = parent.parent;
889
942
  }
890
- if (!hasUnresolvedAncestor) {
943
+ if (!hasUnresolvedAncestor && !delayEnter) {
891
944
  queuePostFlushCb(effects);
892
945
  }
893
946
  suspense.effects = [];
@@ -2104,52 +2157,6 @@ function onErrorCaptured(hook, target = currentInstance) {
2104
2157
  injectHook("ec", hook, target);
2105
2158
  }
2106
2159
 
2107
- const COMPONENTS = "components";
2108
- const DIRECTIVES = "directives";
2109
- function resolveComponent(name, maybeSelfReference) {
2110
- return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
2111
- }
2112
- const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
2113
- function resolveDynamicComponent(component) {
2114
- if (shared.isString(component)) {
2115
- return resolveAsset(COMPONENTS, component, false) || component;
2116
- } else {
2117
- return component || NULL_DYNAMIC_COMPONENT;
2118
- }
2119
- }
2120
- function resolveDirective(name) {
2121
- return resolveAsset(DIRECTIVES, name);
2122
- }
2123
- function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
2124
- const instance = currentRenderingInstance || currentInstance;
2125
- if (instance) {
2126
- const Component = instance.type;
2127
- if (type === COMPONENTS) {
2128
- const selfName = getComponentName(
2129
- Component,
2130
- false
2131
- /* do not include inferred name to avoid breaking existing code */
2132
- );
2133
- if (selfName && (selfName === name || selfName === shared.camelize(name) || selfName === shared.capitalize(shared.camelize(name)))) {
2134
- return Component;
2135
- }
2136
- }
2137
- const res = (
2138
- // local registration
2139
- // check instance[type] first which is resolved for options API
2140
- resolve(instance[type] || Component[type], name) || // global registration
2141
- resolve(instance.appContext[type], name)
2142
- );
2143
- if (!res && maybeSelfReference) {
2144
- return Component;
2145
- }
2146
- return res;
2147
- }
2148
- }
2149
- function resolve(registry, name) {
2150
- return registry && (registry[name] || registry[shared.camelize(name)] || registry[shared.capitalize(shared.camelize(name))]);
2151
- }
2152
-
2153
2160
  function renderList(source, renderItem, cache, index) {
2154
2161
  let ret;
2155
2162
  const cached = cache && cache[index];
@@ -3491,7 +3498,14 @@ function createHydrationFunctions(rendererInternals) {
3491
3498
  }
3492
3499
  break;
3493
3500
  case Comment:
3494
- if (domType !== 8 /* COMMENT */ || isFragmentStart) {
3501
+ if (isTemplateNode(node)) {
3502
+ nextNode = nextSibling(node);
3503
+ replaceNode(
3504
+ vnode.el = node.content.firstChild,
3505
+ node,
3506
+ parentComponent
3507
+ );
3508
+ } else if (domType !== 8 /* COMMENT */ || isFragmentStart) {
3495
3509
  nextNode = onMismatch();
3496
3510
  } else {
3497
3511
  nextNode = nextSibling(node);
@@ -3534,7 +3548,7 @@ function createHydrationFunctions(rendererInternals) {
3534
3548
  break;
3535
3549
  default:
3536
3550
  if (shapeFlag & 1) {
3537
- if (domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) {
3551
+ if ((domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
3538
3552
  nextNode = onMismatch();
3539
3553
  } else {
3540
3554
  nextNode = hydrateElement(
@@ -3549,6 +3563,13 @@ function createHydrationFunctions(rendererInternals) {
3549
3563
  } else if (shapeFlag & 6) {
3550
3564
  vnode.slotScopeIds = slotScopeIds;
3551
3565
  const container = parentNode(node);
3566
+ if (isFragmentStart) {
3567
+ nextNode = locateClosingAnchor(node);
3568
+ } else if (isComment(node) && node.data === "teleport start") {
3569
+ nextNode = locateClosingAnchor(node, node.data, "teleport end");
3570
+ } else {
3571
+ nextNode = nextSibling(node);
3572
+ }
3552
3573
  mountComponent(
3553
3574
  vnode,
3554
3575
  container,
@@ -3558,10 +3579,6 @@ function createHydrationFunctions(rendererInternals) {
3558
3579
  isSVGContainer(container),
3559
3580
  optimized
3560
3581
  );
3561
- nextNode = isFragmentStart ? locateClosingAsyncAnchor(node) : nextSibling(node);
3562
- if (nextNode && isComment(nextNode) && nextNode.data === "teleport end") {
3563
- nextNode = nextSibling(nextNode);
3564
- }
3565
3582
  if (isAsyncWrapper(vnode)) {
3566
3583
  let subTree;
3567
3584
  if (isFragmentStart) {
@@ -3609,7 +3626,7 @@ function createHydrationFunctions(rendererInternals) {
3609
3626
  };
3610
3627
  const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
3611
3628
  optimized = optimized || !!vnode.dynamicChildren;
3612
- const { type, props, patchFlag, shapeFlag, dirs } = vnode;
3629
+ const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
3613
3630
  const forcePatchValue = type === "input" && dirs || type === "option";
3614
3631
  if (forcePatchValue || patchFlag !== -1) {
3615
3632
  if (dirs) {
@@ -3646,12 +3663,23 @@ function createHydrationFunctions(rendererInternals) {
3646
3663
  if (vnodeHooks = props && props.onVnodeBeforeMount) {
3647
3664
  invokeVNodeHook(vnodeHooks, parentComponent, vnode);
3648
3665
  }
3666
+ let needCallTransitionHooks = false;
3667
+ if (isTemplateNode(el)) {
3668
+ needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
3669
+ const content = el.content.firstChild;
3670
+ if (needCallTransitionHooks) {
3671
+ transition.beforeEnter(content);
3672
+ }
3673
+ replaceNode(content, el, parentComponent);
3674
+ vnode.el = el = content;
3675
+ }
3649
3676
  if (dirs) {
3650
3677
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
3651
3678
  }
3652
- if ((vnodeHooks = props && props.onVnodeMounted) || dirs) {
3679
+ if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
3653
3680
  queueEffectWithSuspense(() => {
3654
3681
  vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
3682
+ needCallTransitionHooks && transition.enter(el);
3655
3683
  dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
3656
3684
  }, parentSuspense);
3657
3685
  }
@@ -3741,7 +3769,7 @@ function createHydrationFunctions(rendererInternals) {
3741
3769
  hasMismatch = true;
3742
3770
  vnode.el = null;
3743
3771
  if (isFragment) {
3744
- const end = locateClosingAsyncAnchor(node);
3772
+ const end = locateClosingAnchor(node);
3745
3773
  while (true) {
3746
3774
  const next2 = nextSibling(node);
3747
3775
  if (next2 && next2 !== end) {
@@ -3766,14 +3794,14 @@ function createHydrationFunctions(rendererInternals) {
3766
3794
  );
3767
3795
  return next;
3768
3796
  };
3769
- const locateClosingAsyncAnchor = (node) => {
3797
+ const locateClosingAnchor = (node, open = "[", close = "]") => {
3770
3798
  let match = 0;
3771
3799
  while (node) {
3772
3800
  node = nextSibling(node);
3773
3801
  if (node && isComment(node)) {
3774
- if (node.data === "[")
3802
+ if (node.data === open)
3775
3803
  match++;
3776
- if (node.data === "]") {
3804
+ if (node.data === close) {
3777
3805
  if (match === 0) {
3778
3806
  return nextSibling(node);
3779
3807
  } else {
@@ -3784,6 +3812,22 @@ function createHydrationFunctions(rendererInternals) {
3784
3812
  }
3785
3813
  return node;
3786
3814
  };
3815
+ const replaceNode = (newNode, oldNode, parentComponent) => {
3816
+ const parentNode2 = oldNode.parentNode;
3817
+ if (parentNode2) {
3818
+ parentNode2.replaceChild(newNode, oldNode);
3819
+ }
3820
+ let parent = parentComponent;
3821
+ while (parent) {
3822
+ if (parent.vnode.el === oldNode) {
3823
+ parent.vnode.el = parent.subTree.el = newNode;
3824
+ }
3825
+ parent = parent.parent;
3826
+ }
3827
+ };
3828
+ const isTemplateNode = (node) => {
3829
+ return node.nodeType === 1 /* ELEMENT */ && node.tagName.toLowerCase() === "template";
3830
+ };
3787
3831
  return [hydrate, hydrateNode];
3788
3832
  }
3789
3833
 
@@ -4039,7 +4083,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4039
4083
  if (dirs) {
4040
4084
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
4041
4085
  }
4042
- const needCallTransitionHooks = (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
4086
+ const needCallTransitionHooks = needTransition(parentSuspense, transition);
4043
4087
  if (needCallTransitionHooks) {
4044
4088
  transition.beforeEnter(el);
4045
4089
  }
@@ -4840,8 +4884,8 @@ function baseCreateRenderer(options, createHydrationFns) {
4840
4884
  moveStaticNode(vnode, container, anchor);
4841
4885
  return;
4842
4886
  }
4843
- const needTransition = moveType !== 2 && shapeFlag & 1 && transition;
4844
- if (needTransition) {
4887
+ const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
4888
+ if (needTransition2) {
4845
4889
  if (moveType === 0) {
4846
4890
  transition.beforeEnter(el);
4847
4891
  hostInsert(el, container, anchor);
@@ -5047,6 +5091,9 @@ function baseCreateRenderer(options, createHydrationFns) {
5047
5091
  function toggleRecurse({ effect, update }, allowed) {
5048
5092
  effect.allowRecurse = update.allowRecurse = allowed;
5049
5093
  }
5094
+ function needTransition(parentSuspense, transition) {
5095
+ return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
5096
+ }
5050
5097
  function traverseStaticChildren(n1, n2, shallow = false) {
5051
5098
  const ch1 = n1.children;
5052
5099
  const ch2 = n2.children;
@@ -6022,7 +6069,7 @@ function isMemoSame(cached, memo) {
6022
6069
  return true;
6023
6070
  }
6024
6071
 
6025
- const version = "3.3.6";
6072
+ const version = "3.3.8";
6026
6073
  const _ssrUtils = {
6027
6074
  createComponentInstance,
6028
6075
  setupComponent,
@@ -114,7 +114,7 @@ D = {}, // return from data()
114
114
  C extends ComputedOptions = {}, M extends MethodOptions = {}, E extends EmitsOptions = {}, PublicProps = P, Defaults = {}, MakeDefaultsOptional extends boolean = false, Options = ComponentOptionsBase<any, any, any, any, any, any, any, any, any>, I extends ComponentInjectOptions = {}, S extends SlotsType = {}> = {
115
115
  $: ComponentInternalInstance;
116
116
  $data: D;
117
- $props: Prettify<MakeDefaultsOptional extends true ? Partial<Defaults> & Omit<P & PublicProps, keyof Defaults> : P & PublicProps>;
117
+ $props: MakeDefaultsOptional extends true ? Partial<Defaults> & Omit<Prettify<P> & PublicProps, keyof Defaults> : Prettify<P> & PublicProps;
118
118
  $attrs: Data;
119
119
  $refs: Data;
120
120
  $slots: UnwrapSlotsType<S>;
@@ -207,6 +207,69 @@ export type RootHydrateFunction = (vnode: VNode<Node, Element>, container: (Elem
207
207
  _vnode?: VNode;
208
208
  }) => void;
209
209
 
210
+ type Hook<T = () => void> = T | T[];
211
+ export interface BaseTransitionProps<HostElement = RendererElement> {
212
+ mode?: 'in-out' | 'out-in' | 'default';
213
+ appear?: boolean;
214
+ persisted?: boolean;
215
+ onBeforeEnter?: Hook<(el: HostElement) => void>;
216
+ onEnter?: Hook<(el: HostElement, done: () => void) => void>;
217
+ onAfterEnter?: Hook<(el: HostElement) => void>;
218
+ onEnterCancelled?: Hook<(el: HostElement) => void>;
219
+ onBeforeLeave?: Hook<(el: HostElement) => void>;
220
+ onLeave?: Hook<(el: HostElement, done: () => void) => void>;
221
+ onAfterLeave?: Hook<(el: HostElement) => void>;
222
+ onLeaveCancelled?: Hook<(el: HostElement) => void>;
223
+ onBeforeAppear?: Hook<(el: HostElement) => void>;
224
+ onAppear?: Hook<(el: HostElement, done: () => void) => void>;
225
+ onAfterAppear?: Hook<(el: HostElement) => void>;
226
+ onAppearCancelled?: Hook<(el: HostElement) => void>;
227
+ }
228
+ export interface TransitionHooks<HostElement = RendererElement> {
229
+ mode: BaseTransitionProps['mode'];
230
+ persisted: boolean;
231
+ beforeEnter(el: HostElement): void;
232
+ enter(el: HostElement): void;
233
+ leave(el: HostElement, remove: () => void): void;
234
+ clone(vnode: VNode): TransitionHooks<HostElement>;
235
+ afterLeave?(): void;
236
+ delayLeave?(el: HostElement, earlyRemove: () => void, delayedLeave: () => void): void;
237
+ delayedLeave?(): void;
238
+ }
239
+ export interface TransitionState {
240
+ isMounted: boolean;
241
+ isLeaving: boolean;
242
+ isUnmounting: boolean;
243
+ leavingVNodes: Map<any, Record<string, VNode>>;
244
+ }
245
+ export declare function useTransitionState(): TransitionState;
246
+ export declare const BaseTransitionPropsValidators: {
247
+ mode: StringConstructor;
248
+ appear: BooleanConstructor;
249
+ persisted: BooleanConstructor;
250
+ onBeforeEnter: (ArrayConstructor | FunctionConstructor)[];
251
+ onEnter: (ArrayConstructor | FunctionConstructor)[];
252
+ onAfterEnter: (ArrayConstructor | FunctionConstructor)[];
253
+ onEnterCancelled: (ArrayConstructor | FunctionConstructor)[];
254
+ onBeforeLeave: (ArrayConstructor | FunctionConstructor)[];
255
+ onLeave: (ArrayConstructor | FunctionConstructor)[];
256
+ onAfterLeave: (ArrayConstructor | FunctionConstructor)[];
257
+ onLeaveCancelled: (ArrayConstructor | FunctionConstructor)[];
258
+ onBeforeAppear: (ArrayConstructor | FunctionConstructor)[];
259
+ onAppear: (ArrayConstructor | FunctionConstructor)[];
260
+ onAfterAppear: (ArrayConstructor | FunctionConstructor)[];
261
+ onAppearCancelled: (ArrayConstructor | FunctionConstructor)[];
262
+ };
263
+ export declare const BaseTransition: new () => {
264
+ $props: BaseTransitionProps<any>;
265
+ $slots: {
266
+ default(): VNode[];
267
+ };
268
+ };
269
+ export declare function resolveTransitionHooks(vnode: VNode, props: BaseTransitionProps<any>, state: TransitionState, instance: ComponentInternalInstance): TransitionHooks;
270
+ export declare function setTransitionHooks(vnode: VNode, hooks: TransitionHooks): void;
271
+ export declare function getTransitionRawChildren(children: VNode[], keepComment?: boolean, parentKey?: VNode['key']): VNode[];
272
+
210
273
  export interface Renderer<HostElement = RendererElement> {
211
274
  render: RootRenderFunction<HostElement>;
212
275
  createApp: CreateAppFunction<HostElement>;
@@ -745,69 +808,6 @@ export type Plugin<Options = any[]> = (PluginInstallFunction<Options> & {
745
808
  };
746
809
  export type CreateAppFunction<HostElement> = (rootComponent: Component, rootProps?: Data | null) => App<HostElement>;
747
810
 
748
- type Hook<T = () => void> = T | T[];
749
- export interface BaseTransitionProps<HostElement = RendererElement> {
750
- mode?: 'in-out' | 'out-in' | 'default';
751
- appear?: boolean;
752
- persisted?: boolean;
753
- onBeforeEnter?: Hook<(el: HostElement) => void>;
754
- onEnter?: Hook<(el: HostElement, done: () => void) => void>;
755
- onAfterEnter?: Hook<(el: HostElement) => void>;
756
- onEnterCancelled?: Hook<(el: HostElement) => void>;
757
- onBeforeLeave?: Hook<(el: HostElement) => void>;
758
- onLeave?: Hook<(el: HostElement, done: () => void) => void>;
759
- onAfterLeave?: Hook<(el: HostElement) => void>;
760
- onLeaveCancelled?: Hook<(el: HostElement) => void>;
761
- onBeforeAppear?: Hook<(el: HostElement) => void>;
762
- onAppear?: Hook<(el: HostElement, done: () => void) => void>;
763
- onAfterAppear?: Hook<(el: HostElement) => void>;
764
- onAppearCancelled?: Hook<(el: HostElement) => void>;
765
- }
766
- export interface TransitionHooks<HostElement = RendererElement> {
767
- mode: BaseTransitionProps['mode'];
768
- persisted: boolean;
769
- beforeEnter(el: HostElement): void;
770
- enter(el: HostElement): void;
771
- leave(el: HostElement, remove: () => void): void;
772
- clone(vnode: VNode): TransitionHooks<HostElement>;
773
- afterLeave?(): void;
774
- delayLeave?(el: HostElement, earlyRemove: () => void, delayedLeave: () => void): void;
775
- delayedLeave?(): void;
776
- }
777
- export interface TransitionState {
778
- isMounted: boolean;
779
- isLeaving: boolean;
780
- isUnmounting: boolean;
781
- leavingVNodes: Map<any, Record<string, VNode>>;
782
- }
783
- export declare function useTransitionState(): TransitionState;
784
- export declare const BaseTransitionPropsValidators: {
785
- mode: StringConstructor;
786
- appear: BooleanConstructor;
787
- persisted: BooleanConstructor;
788
- onBeforeEnter: (ArrayConstructor | FunctionConstructor)[];
789
- onEnter: (ArrayConstructor | FunctionConstructor)[];
790
- onAfterEnter: (ArrayConstructor | FunctionConstructor)[];
791
- onEnterCancelled: (ArrayConstructor | FunctionConstructor)[];
792
- onBeforeLeave: (ArrayConstructor | FunctionConstructor)[];
793
- onLeave: (ArrayConstructor | FunctionConstructor)[];
794
- onAfterLeave: (ArrayConstructor | FunctionConstructor)[];
795
- onLeaveCancelled: (ArrayConstructor | FunctionConstructor)[];
796
- onBeforeAppear: (ArrayConstructor | FunctionConstructor)[];
797
- onAppear: (ArrayConstructor | FunctionConstructor)[];
798
- onAfterAppear: (ArrayConstructor | FunctionConstructor)[];
799
- onAppearCancelled: (ArrayConstructor | FunctionConstructor)[];
800
- };
801
- export declare const BaseTransition: new () => {
802
- $props: BaseTransitionProps<any>;
803
- $slots: {
804
- default(): VNode[];
805
- };
806
- };
807
- export declare function resolveTransitionHooks(vnode: VNode, props: BaseTransitionProps<any>, state: TransitionState, instance: ComponentInternalInstance): TransitionHooks;
808
- export declare function setTransitionHooks(vnode: VNode, hooks: TransitionHooks): void;
809
- export declare function getTransitionRawChildren(children: VNode[], keepComment?: boolean, parentKey?: VNode['key']): VNode[];
810
-
811
811
  type TeleportVNode = VNode<RendererNode, RendererElement, TeleportProps>;
812
812
  export interface TeleportProps {
813
813
  to: string | RendererElement | null | undefined;
@@ -883,7 +883,7 @@ export type VNodeProps = {
883
883
  onVnodeBeforeUnmount?: VNodeMountHook | VNodeMountHook[];
884
884
  onVnodeUnmounted?: VNodeMountHook | VNodeMountHook[];
885
885
  };
886
- type VNodeChildAtom = VNode | string | number | boolean | null | undefined | void;
886
+ type VNodeChildAtom = VNode | typeof NULL_DYNAMIC_COMPONENT | string | number | boolean | null | undefined | void;
887
887
  export type VNodeArrayChildren = Array<VNodeArrayChildren | VNodeChildAtom>;
888
888
  export type VNodeChild = VNodeChildAtom | VNodeArrayChildren;
889
889
  export type VNodeNormalizedChildren = string | VNodeArrayChildren | RawSlots | null;
@@ -1383,6 +1383,8 @@ export declare function h(type: Constructor, children?: RawChildren): VNode;
1383
1383
  export declare function h<P>(type: Constructor<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
1384
1384
  export declare function h(type: DefineComponent, children?: RawChildren): VNode;
1385
1385
  export declare function h<P>(type: DefineComponent<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
1386
+ export declare function h(type: string | Component, children?: RawChildren): VNode;
1387
+ export declare function h<P>(type: string | Component<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
1386
1388
 
1387
1389
  export declare const ssrContextKey: unique symbol;
1388
1390
  export declare const useSSRContext: <T = Record<string, any>>() => T | undefined;
@@ -1,6 +1,6 @@
1
1
  import { pauseTracking, resetTracking, isRef, toRaw, getCurrentScope, isShallow as isShallow$1, isReactive, ReactiveEffect, ref, shallowReadonly, track, reactive, shallowReactive, trigger, isProxy, proxyRefs, markRaw, EffectScope, computed as computed$1, isReadonly } from '@vue/reactivity';
2
2
  export { EffectScope, ReactiveEffect, customRef, effect, effectScope, getCurrentScope, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity';
3
- import { isString, isFunction, isPromise, isArray, NOOP, getGlobalThis, extend, EMPTY_OBJ, toHandlerKey, looseToNumber, hyphenate, camelize, isObject, isOn, hasOwn, isModelListener, toNumber, hasChanged, remove, isSet, isMap, isPlainObject, isBuiltInDirective, invokeArrayFns, isRegExp, capitalize, isGloballyAllowed, NO, def, isReservedProp, EMPTY_ARR, toRawType, makeMap, normalizeClass, normalizeStyle } from '@vue/shared';
3
+ import { isString, isFunction, isPromise, isArray, NOOP, getGlobalThis, extend, EMPTY_OBJ, toHandlerKey, looseToNumber, hyphenate, camelize, isObject, isOn, hasOwn, isModelListener, capitalize, toNumber, hasChanged, remove, isSet, isMap, isPlainObject, isBuiltInDirective, invokeArrayFns, isRegExp, isGloballyAllowed, NO, def, isReservedProp, EMPTY_ARR, toRawType, makeMap, normalizeClass, normalizeStyle } from '@vue/shared';
4
4
  export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
5
5
 
6
6
  const stack = [];
@@ -246,8 +246,13 @@ function findInsertionIndex(id) {
246
246
  let end = queue.length;
247
247
  while (start < end) {
248
248
  const middle = start + end >>> 1;
249
- const middleJobId = getId(queue[middle]);
250
- middleJobId < id ? start = middle + 1 : end = middle;
249
+ const middleJob = queue[middle];
250
+ const middleJobId = getId(middleJob);
251
+ if (middleJobId < id || middleJobId === id && middleJob.pre) {
252
+ start = middle + 1;
253
+ } else {
254
+ end = middle;
255
+ }
251
256
  }
252
257
  return start;
253
258
  }
@@ -1049,6 +1054,61 @@ function updateHOCHostEl({ vnode, parent }, el) {
1049
1054
  }
1050
1055
  }
1051
1056
 
1057
+ const COMPONENTS = "components";
1058
+ const DIRECTIVES = "directives";
1059
+ function resolveComponent(name, maybeSelfReference) {
1060
+ return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
1061
+ }
1062
+ const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
1063
+ function resolveDynamicComponent(component) {
1064
+ if (isString(component)) {
1065
+ return resolveAsset(COMPONENTS, component, false) || component;
1066
+ } else {
1067
+ return component || NULL_DYNAMIC_COMPONENT;
1068
+ }
1069
+ }
1070
+ function resolveDirective(name) {
1071
+ return resolveAsset(DIRECTIVES, name);
1072
+ }
1073
+ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
1074
+ const instance = currentRenderingInstance || currentInstance;
1075
+ if (instance) {
1076
+ const Component = instance.type;
1077
+ if (type === COMPONENTS) {
1078
+ const selfName = getComponentName(
1079
+ Component,
1080
+ false
1081
+ /* do not include inferred name to avoid breaking existing code */
1082
+ );
1083
+ if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
1084
+ return Component;
1085
+ }
1086
+ }
1087
+ const res = (
1088
+ // local registration
1089
+ // check instance[type] first which is resolved for options API
1090
+ resolve(instance[type] || Component[type], name) || // global registration
1091
+ resolve(instance.appContext[type], name)
1092
+ );
1093
+ if (!res && maybeSelfReference) {
1094
+ return Component;
1095
+ }
1096
+ if (!!(process.env.NODE_ENV !== "production") && warnMissing && !res) {
1097
+ const extra = type === COMPONENTS ? `
1098
+ If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
1099
+ warn(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
1100
+ }
1101
+ return res;
1102
+ } else if (!!(process.env.NODE_ENV !== "production")) {
1103
+ warn(
1104
+ `resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`
1105
+ );
1106
+ }
1107
+ }
1108
+ function resolve(registry, name) {
1109
+ return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
1110
+ }
1111
+
1052
1112
  const isSuspense = (type) => type.__isSuspense;
1053
1113
  const SuspenseImpl = {
1054
1114
  name: "Suspense",
@@ -1362,14 +1422,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
1362
1422
  parentComponent: parentComponent2,
1363
1423
  container: container2
1364
1424
  } = suspense;
1425
+ let delayEnter = false;
1365
1426
  if (suspense.isHydrating) {
1366
1427
  suspense.isHydrating = false;
1367
1428
  } else if (!resume) {
1368
- const delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
1429
+ delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
1369
1430
  if (delayEnter) {
1370
1431
  activeBranch.transition.afterLeave = () => {
1371
1432
  if (pendingId === suspense.pendingId) {
1372
1433
  move(pendingBranch, container2, anchor2, 0);
1434
+ queuePostFlushCb(effects);
1373
1435
  }
1374
1436
  };
1375
1437
  }
@@ -1395,7 +1457,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
1395
1457
  }
1396
1458
  parent = parent.parent;
1397
1459
  }
1398
- if (!hasUnresolvedAncestor) {
1460
+ if (!hasUnresolvedAncestor && !delayEnter) {
1399
1461
  queuePostFlushCb(effects);
1400
1462
  }
1401
1463
  suspense.effects = [];
@@ -1581,7 +1643,7 @@ function normalizeSuspenseSlot(s) {
1581
1643
  }
1582
1644
  if (isArray(s)) {
1583
1645
  const singleChild = filterSingleRoot(s);
1584
- if (!!(process.env.NODE_ENV !== "production") && !singleChild) {
1646
+ if (!!(process.env.NODE_ENV !== "production") && !singleChild && s.filter((child) => child !== NULL_DYNAMIC_COMPONENT).length > 0) {
1585
1647
  warn(`<Suspense> slots expect a single root node.`);
1586
1648
  }
1587
1649
  s = singleChild;
@@ -2695,61 +2757,6 @@ function onErrorCaptured(hook, target = currentInstance) {
2695
2757
  injectHook("ec", hook, target);
2696
2758
  }
2697
2759
 
2698
- const COMPONENTS = "components";
2699
- const DIRECTIVES = "directives";
2700
- function resolveComponent(name, maybeSelfReference) {
2701
- return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
2702
- }
2703
- const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
2704
- function resolveDynamicComponent(component) {
2705
- if (isString(component)) {
2706
- return resolveAsset(COMPONENTS, component, false) || component;
2707
- } else {
2708
- return component || NULL_DYNAMIC_COMPONENT;
2709
- }
2710
- }
2711
- function resolveDirective(name) {
2712
- return resolveAsset(DIRECTIVES, name);
2713
- }
2714
- function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
2715
- const instance = currentRenderingInstance || currentInstance;
2716
- if (instance) {
2717
- const Component = instance.type;
2718
- if (type === COMPONENTS) {
2719
- const selfName = getComponentName(
2720
- Component,
2721
- false
2722
- /* do not include inferred name to avoid breaking existing code */
2723
- );
2724
- if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
2725
- return Component;
2726
- }
2727
- }
2728
- const res = (
2729
- // local registration
2730
- // check instance[type] first which is resolved for options API
2731
- resolve(instance[type] || Component[type], name) || // global registration
2732
- resolve(instance.appContext[type], name)
2733
- );
2734
- if (!res && maybeSelfReference) {
2735
- return Component;
2736
- }
2737
- if (!!(process.env.NODE_ENV !== "production") && warnMissing && !res) {
2738
- const extra = type === COMPONENTS ? `
2739
- If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
2740
- warn(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
2741
- }
2742
- return res;
2743
- } else if (!!(process.env.NODE_ENV !== "production")) {
2744
- warn(
2745
- `resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`
2746
- );
2747
- }
2748
- }
2749
- function resolve(registry, name) {
2750
- return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
2751
- }
2752
-
2753
2760
  function renderList(source, renderItem, cache, index) {
2754
2761
  let ret;
2755
2762
  const cached = cache && cache[index];
@@ -4569,7 +4576,14 @@ function createHydrationFunctions(rendererInternals) {
4569
4576
  }
4570
4577
  break;
4571
4578
  case Comment:
4572
- if (domType !== 8 /* COMMENT */ || isFragmentStart) {
4579
+ if (isTemplateNode(node)) {
4580
+ nextNode = nextSibling(node);
4581
+ replaceNode(
4582
+ vnode.el = node.content.firstChild,
4583
+ node,
4584
+ parentComponent
4585
+ );
4586
+ } else if (domType !== 8 /* COMMENT */ || isFragmentStart) {
4573
4587
  nextNode = onMismatch();
4574
4588
  } else {
4575
4589
  nextNode = nextSibling(node);
@@ -4612,7 +4626,7 @@ function createHydrationFunctions(rendererInternals) {
4612
4626
  break;
4613
4627
  default:
4614
4628
  if (shapeFlag & 1) {
4615
- if (domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) {
4629
+ if ((domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
4616
4630
  nextNode = onMismatch();
4617
4631
  } else {
4618
4632
  nextNode = hydrateElement(
@@ -4627,6 +4641,13 @@ function createHydrationFunctions(rendererInternals) {
4627
4641
  } else if (shapeFlag & 6) {
4628
4642
  vnode.slotScopeIds = slotScopeIds;
4629
4643
  const container = parentNode(node);
4644
+ if (isFragmentStart) {
4645
+ nextNode = locateClosingAnchor(node);
4646
+ } else if (isComment(node) && node.data === "teleport start") {
4647
+ nextNode = locateClosingAnchor(node, node.data, "teleport end");
4648
+ } else {
4649
+ nextNode = nextSibling(node);
4650
+ }
4630
4651
  mountComponent(
4631
4652
  vnode,
4632
4653
  container,
@@ -4636,10 +4657,6 @@ function createHydrationFunctions(rendererInternals) {
4636
4657
  isSVGContainer(container),
4637
4658
  optimized
4638
4659
  );
4639
- nextNode = isFragmentStart ? locateClosingAsyncAnchor(node) : nextSibling(node);
4640
- if (nextNode && isComment(nextNode) && nextNode.data === "teleport end") {
4641
- nextNode = nextSibling(nextNode);
4642
- }
4643
4660
  if (isAsyncWrapper(vnode)) {
4644
4661
  let subTree;
4645
4662
  if (isFragmentStart) {
@@ -4689,7 +4706,7 @@ function createHydrationFunctions(rendererInternals) {
4689
4706
  };
4690
4707
  const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
4691
4708
  optimized = optimized || !!vnode.dynamicChildren;
4692
- const { type, props, patchFlag, shapeFlag, dirs } = vnode;
4709
+ const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
4693
4710
  const forcePatchValue = type === "input" && dirs || type === "option";
4694
4711
  if (!!(process.env.NODE_ENV !== "production") || forcePatchValue || patchFlag !== -1) {
4695
4712
  if (dirs) {
@@ -4726,12 +4743,23 @@ function createHydrationFunctions(rendererInternals) {
4726
4743
  if (vnodeHooks = props && props.onVnodeBeforeMount) {
4727
4744
  invokeVNodeHook(vnodeHooks, parentComponent, vnode);
4728
4745
  }
4746
+ let needCallTransitionHooks = false;
4747
+ if (isTemplateNode(el)) {
4748
+ needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
4749
+ const content = el.content.firstChild;
4750
+ if (needCallTransitionHooks) {
4751
+ transition.beforeEnter(content);
4752
+ }
4753
+ replaceNode(content, el, parentComponent);
4754
+ vnode.el = el = content;
4755
+ }
4729
4756
  if (dirs) {
4730
4757
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
4731
4758
  }
4732
- if ((vnodeHooks = props && props.onVnodeMounted) || dirs) {
4759
+ if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
4733
4760
  queueEffectWithSuspense(() => {
4734
4761
  vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
4762
+ needCallTransitionHooks && transition.enter(el);
4735
4763
  dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
4736
4764
  }, parentSuspense);
4737
4765
  }
@@ -4849,7 +4877,7 @@ function createHydrationFunctions(rendererInternals) {
4849
4877
  );
4850
4878
  vnode.el = null;
4851
4879
  if (isFragment) {
4852
- const end = locateClosingAsyncAnchor(node);
4880
+ const end = locateClosingAnchor(node);
4853
4881
  while (true) {
4854
4882
  const next2 = nextSibling(node);
4855
4883
  if (next2 && next2 !== end) {
@@ -4874,14 +4902,14 @@ function createHydrationFunctions(rendererInternals) {
4874
4902
  );
4875
4903
  return next;
4876
4904
  };
4877
- const locateClosingAsyncAnchor = (node) => {
4905
+ const locateClosingAnchor = (node, open = "[", close = "]") => {
4878
4906
  let match = 0;
4879
4907
  while (node) {
4880
4908
  node = nextSibling(node);
4881
4909
  if (node && isComment(node)) {
4882
- if (node.data === "[")
4910
+ if (node.data === open)
4883
4911
  match++;
4884
- if (node.data === "]") {
4912
+ if (node.data === close) {
4885
4913
  if (match === 0) {
4886
4914
  return nextSibling(node);
4887
4915
  } else {
@@ -4892,6 +4920,22 @@ function createHydrationFunctions(rendererInternals) {
4892
4920
  }
4893
4921
  return node;
4894
4922
  };
4923
+ const replaceNode = (newNode, oldNode, parentComponent) => {
4924
+ const parentNode2 = oldNode.parentNode;
4925
+ if (parentNode2) {
4926
+ parentNode2.replaceChild(newNode, oldNode);
4927
+ }
4928
+ let parent = parentComponent;
4929
+ while (parent) {
4930
+ if (parent.vnode.el === oldNode) {
4931
+ parent.vnode.el = parent.subTree.el = newNode;
4932
+ }
4933
+ parent = parent.parent;
4934
+ }
4935
+ };
4936
+ const isTemplateNode = (node) => {
4937
+ return node.nodeType === 1 /* ELEMENT */ && node.tagName.toLowerCase() === "template";
4938
+ };
4895
4939
  return [hydrate, hydrateNode];
4896
4940
  }
4897
4941
 
@@ -5242,7 +5286,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5242
5286
  if (dirs) {
5243
5287
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
5244
5288
  }
5245
- const needCallTransitionHooks = (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
5289
+ const needCallTransitionHooks = needTransition(parentSuspense, transition);
5246
5290
  if (needCallTransitionHooks) {
5247
5291
  transition.beforeEnter(el);
5248
5292
  }
@@ -6145,8 +6189,8 @@ function baseCreateRenderer(options, createHydrationFns) {
6145
6189
  moveStaticNode(vnode, container, anchor);
6146
6190
  return;
6147
6191
  }
6148
- const needTransition = moveType !== 2 && shapeFlag & 1 && transition;
6149
- if (needTransition) {
6192
+ const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
6193
+ if (needTransition2) {
6150
6194
  if (moveType === 0) {
6151
6195
  transition.beforeEnter(el);
6152
6196
  hostInsert(el, container, anchor);
@@ -6366,6 +6410,9 @@ function baseCreateRenderer(options, createHydrationFns) {
6366
6410
  function toggleRecurse({ effect, update }, allowed) {
6367
6411
  effect.allowRecurse = update.allowRecurse = allowed;
6368
6412
  }
6413
+ function needTransition(parentSuspense, transition) {
6414
+ return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
6415
+ }
6369
6416
  function traverseStaticChildren(n1, n2, shallow = false) {
6370
6417
  const ch1 = n1.children;
6371
6418
  const ch2 = n2.children;
@@ -7733,7 +7780,7 @@ function isMemoSame(cached, memo) {
7733
7780
  return true;
7734
7781
  }
7735
7782
 
7736
- const version = "3.3.6";
7783
+ const version = "3.3.8";
7737
7784
  const _ssrUtils = {
7738
7785
  createComponentInstance,
7739
7786
  setupComponent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/runtime-core",
3
- "version": "3.3.6",
3
+ "version": "3.3.8",
4
4
  "description": "@vue/runtime-core",
5
5
  "main": "index.js",
6
6
  "module": "dist/runtime-core.esm-bundler.js",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
34
34
  "dependencies": {
35
- "@vue/shared": "3.3.6",
36
- "@vue/reactivity": "3.3.6"
35
+ "@vue/shared": "3.3.8",
36
+ "@vue/reactivity": "3.3.8"
37
37
  }
38
38
  }