@vue/runtime-core 3.4.0-alpha.4 → 3.4.0-beta.2

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.
@@ -171,10 +171,13 @@ function queuePostFlushCb(cb) {
171
171
  }
172
172
  queueFlush();
173
173
  }
174
- function flushPreFlushCbs(seen, i = isFlushing ? flushIndex + 1 : 0) {
174
+ function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
175
175
  for (; i < queue.length; i++) {
176
176
  const cb = queue[i];
177
177
  if (cb && cb.pre) {
178
+ if (instance && cb.id !== instance.uid) {
179
+ continue;
180
+ }
178
181
  queue.splice(i, 1);
179
182
  i--;
180
183
  cb();
@@ -604,9 +607,17 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
604
607
  return false;
605
608
  }
606
609
  function updateHOCHostEl({ vnode, parent }, el) {
607
- while (parent && parent.subTree === vnode) {
608
- (vnode = parent.vnode).el = el;
609
- parent = parent.parent;
610
+ while (parent) {
611
+ const root = parent.subTree;
612
+ if (root.suspense && root.suspense.activeBranch === vnode) {
613
+ root.el = vnode.el;
614
+ }
615
+ if (root === vnode) {
616
+ (vnode = parent.vnode).el = el;
617
+ parent = parent.parent;
618
+ } else {
619
+ break;
620
+ }
610
621
  }
611
622
  }
612
623
 
@@ -657,6 +668,7 @@ function resolve(registry, name) {
657
668
  }
658
669
 
659
670
  const isSuspense = (type) => type.__isSuspense;
671
+ let suspenseId = 0;
660
672
  const SuspenseImpl = {
661
673
  name: "Suspense",
662
674
  // In order to make Suspense tree-shakable, we need to avoid importing it
@@ -664,7 +676,7 @@ const SuspenseImpl = {
664
676
  // on a vnode's type and calls the `process` method, passing in renderer
665
677
  // internals.
666
678
  __isSuspense: true,
667
- process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals) {
679
+ process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
668
680
  if (n1 == null) {
669
681
  mountSuspense(
670
682
  n2,
@@ -672,7 +684,7 @@ const SuspenseImpl = {
672
684
  anchor,
673
685
  parentComponent,
674
686
  parentSuspense,
675
- isSVG,
687
+ namespace,
676
688
  slotScopeIds,
677
689
  optimized,
678
690
  rendererInternals
@@ -684,7 +696,7 @@ const SuspenseImpl = {
684
696
  container,
685
697
  anchor,
686
698
  parentComponent,
687
- isSVG,
699
+ namespace,
688
700
  slotScopeIds,
689
701
  optimized,
690
702
  rendererInternals
@@ -702,7 +714,7 @@ function triggerEvent(vnode, name) {
702
714
  eventListener();
703
715
  }
704
716
  }
705
- function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals) {
717
+ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
706
718
  const {
707
719
  p: patch,
708
720
  o: { createElement }
@@ -715,7 +727,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
715
727
  container,
716
728
  hiddenContainer,
717
729
  anchor,
718
- isSVG,
730
+ namespace,
719
731
  slotScopeIds,
720
732
  optimized,
721
733
  rendererInternals
@@ -727,7 +739,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
727
739
  null,
728
740
  parentComponent,
729
741
  suspense,
730
- isSVG,
742
+ namespace,
731
743
  slotScopeIds
732
744
  );
733
745
  if (suspense.deps > 0) {
@@ -741,7 +753,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
741
753
  parentComponent,
742
754
  null,
743
755
  // fallback tree will not have suspense context
744
- isSVG,
756
+ namespace,
745
757
  slotScopeIds
746
758
  );
747
759
  setActiveBranch(suspense, vnode.ssFallback);
@@ -749,7 +761,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
749
761
  suspense.resolve(false, true);
750
762
  }
751
763
  }
752
- function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
764
+ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
753
765
  const suspense = n2.suspense = n1.suspense;
754
766
  suspense.vnode = n2;
755
767
  n2.el = n1.el;
@@ -766,29 +778,31 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
766
778
  null,
767
779
  parentComponent,
768
780
  suspense,
769
- isSVG,
781
+ namespace,
770
782
  slotScopeIds,
771
783
  optimized
772
784
  );
773
785
  if (suspense.deps <= 0) {
774
786
  suspense.resolve();
775
787
  } else if (isInFallback) {
776
- patch(
777
- activeBranch,
778
- newFallback,
779
- container,
780
- anchor,
781
- parentComponent,
782
- null,
783
- // fallback tree will not have suspense context
784
- isSVG,
785
- slotScopeIds,
786
- optimized
787
- );
788
- setActiveBranch(suspense, newFallback);
788
+ if (!isHydrating) {
789
+ patch(
790
+ activeBranch,
791
+ newFallback,
792
+ container,
793
+ anchor,
794
+ parentComponent,
795
+ null,
796
+ // fallback tree will not have suspense context
797
+ namespace,
798
+ slotScopeIds,
799
+ optimized
800
+ );
801
+ setActiveBranch(suspense, newFallback);
802
+ }
789
803
  }
790
804
  } else {
791
- suspense.pendingId++;
805
+ suspense.pendingId = suspenseId++;
792
806
  if (isHydrating) {
793
807
  suspense.isHydrating = false;
794
808
  suspense.activeBranch = pendingBranch;
@@ -806,7 +820,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
806
820
  null,
807
821
  parentComponent,
808
822
  suspense,
809
- isSVG,
823
+ namespace,
810
824
  slotScopeIds,
811
825
  optimized
812
826
  );
@@ -821,7 +835,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
821
835
  parentComponent,
822
836
  null,
823
837
  // fallback tree will not have suspense context
824
- isSVG,
838
+ namespace,
825
839
  slotScopeIds,
826
840
  optimized
827
841
  );
@@ -835,7 +849,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
835
849
  anchor,
836
850
  parentComponent,
837
851
  suspense,
838
- isSVG,
852
+ namespace,
839
853
  slotScopeIds,
840
854
  optimized
841
855
  );
@@ -848,7 +862,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
848
862
  null,
849
863
  parentComponent,
850
864
  suspense,
851
- isSVG,
865
+ namespace,
852
866
  slotScopeIds,
853
867
  optimized
854
868
  );
@@ -866,7 +880,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
866
880
  anchor,
867
881
  parentComponent,
868
882
  suspense,
869
- isSVG,
883
+ namespace,
870
884
  slotScopeIds,
871
885
  optimized
872
886
  );
@@ -874,7 +888,11 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
874
888
  } else {
875
889
  triggerEvent(n2, "onPending");
876
890
  suspense.pendingBranch = newBranch;
877
- suspense.pendingId++;
891
+ if (newBranch.shapeFlag & 512) {
892
+ suspense.pendingId = newBranch.component.suspenseId;
893
+ } else {
894
+ suspense.pendingId = suspenseId++;
895
+ }
878
896
  patch(
879
897
  null,
880
898
  newBranch,
@@ -882,7 +900,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
882
900
  null,
883
901
  parentComponent,
884
902
  suspense,
885
- isSVG,
903
+ namespace,
886
904
  slotScopeIds,
887
905
  optimized
888
906
  );
@@ -903,7 +921,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
903
921
  }
904
922
  }
905
923
  }
906
- function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
924
+ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
907
925
  const {
908
926
  p: patch,
909
927
  m: move,
@@ -924,7 +942,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
924
942
  vnode,
925
943
  parent: parentSuspense,
926
944
  parentComponent,
927
- isSVG,
945
+ namespace,
928
946
  container,
929
947
  hiddenContainer,
930
948
  anchor,
@@ -933,7 +951,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
933
951
  timeout: typeof timeout === "number" ? timeout : -1,
934
952
  activeBranch: null,
935
953
  pendingBranch: null,
936
- isInFallback: true,
954
+ isInFallback: !isHydrating,
937
955
  isHydrating,
938
956
  isUnmounted: false,
939
957
  effects: [],
@@ -1005,8 +1023,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
1005
1023
  if (!suspense.pendingBranch) {
1006
1024
  return;
1007
1025
  }
1008
- const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, isSVG: isSVG2 } = suspense;
1026
+ const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
1009
1027
  triggerEvent(vnode2, "onFallback");
1028
+ const anchor2 = next(activeBranch);
1010
1029
  const mountFallback = () => {
1011
1030
  if (!suspense.isInFallback) {
1012
1031
  return;
@@ -1015,11 +1034,11 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
1015
1034
  null,
1016
1035
  fallbackVNode,
1017
1036
  container2,
1018
- next(activeBranch),
1037
+ anchor2,
1019
1038
  parentComponent2,
1020
1039
  null,
1021
1040
  // fallback tree will not have suspense context
1022
- isSVG2,
1041
+ namespace2,
1023
1042
  slotScopeIds,
1024
1043
  optimized
1025
1044
  );
@@ -1079,7 +1098,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
1079
1098
  // consider the comment placeholder case.
1080
1099
  hydratedEl ? null : next(instance.subTree),
1081
1100
  suspense,
1082
- isSVG,
1101
+ namespace,
1083
1102
  optimized
1084
1103
  );
1085
1104
  if (placeholder) {
@@ -1113,7 +1132,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
1113
1132
  };
1114
1133
  return suspense;
1115
1134
  }
1116
- function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals, hydrateNode) {
1135
+ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) {
1117
1136
  const suspense = vnode.suspense = createSuspenseBoundary(
1118
1137
  vnode,
1119
1138
  parentSuspense,
@@ -1121,7 +1140,7 @@ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, sl
1121
1140
  node.parentNode,
1122
1141
  document.createElement("div"),
1123
1142
  null,
1124
- isSVG,
1143
+ namespace,
1125
1144
  slotScopeIds,
1126
1145
  optimized,
1127
1146
  rendererInternals,
@@ -1970,7 +1989,7 @@ const KeepAliveImpl = {
1970
1989
  }
1971
1990
  } = sharedContext;
1972
1991
  const storageContainer = createElement("div");
1973
- sharedContext.activate = (vnode, container, anchor, isSVG, optimized) => {
1992
+ sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
1974
1993
  const instance2 = vnode.component;
1975
1994
  move(vnode, container, anchor, 0, parentSuspense);
1976
1995
  patch(
@@ -1980,7 +1999,7 @@ const KeepAliveImpl = {
1980
1999
  anchor,
1981
2000
  instance2,
1982
2001
  parentSuspense,
1983
- isSVG,
2002
+ namespace,
1984
2003
  vnode.slotScopeIds,
1985
2004
  optimized
1986
2005
  );
@@ -2490,31 +2509,26 @@ function useSlots() {
2490
2509
  function useAttrs() {
2491
2510
  return getContext().attrs;
2492
2511
  }
2493
- function useModel(props, name, options) {
2512
+ function useModel(props, name) {
2494
2513
  const i = getCurrentInstance();
2495
- if (options && options.local) {
2496
- const proxy = reactivity.ref(props[name]);
2497
- watch(
2498
- () => props[name],
2499
- (v) => proxy.value = v
2500
- );
2501
- watch(proxy, (value) => {
2502
- if (value !== props[name]) {
2503
- i.emit(`update:${name}`, value);
2504
- }
2505
- });
2506
- return proxy;
2507
- } else {
2508
- return {
2509
- __v_isRef: true,
2510
- get value() {
2511
- return props[name];
2512
- },
2513
- set value(value) {
2514
- i.emit(`update:${name}`, value);
2514
+ let localValue;
2515
+ watchSyncEffect(() => {
2516
+ localValue = props[name];
2517
+ });
2518
+ return reactivity.customRef((track, trigger) => ({
2519
+ get() {
2520
+ track();
2521
+ return localValue;
2522
+ },
2523
+ set(value) {
2524
+ const rawProps = i.vnode.props;
2525
+ if (!(rawProps && name in rawProps) && shared.hasChanged(value, localValue)) {
2526
+ localValue = value;
2527
+ trigger();
2515
2528
  }
2516
- };
2517
- }
2529
+ i.emit(`update:${name}`, value);
2530
+ }
2531
+ }));
2518
2532
  }
2519
2533
  function getContext() {
2520
2534
  const i = getCurrentInstance();
@@ -2992,14 +3006,19 @@ function createAppAPI(render, hydrate) {
2992
3006
  context.directives[name] = directive;
2993
3007
  return app;
2994
3008
  },
2995
- mount(rootContainer, isHydrate, isSVG) {
3009
+ mount(rootContainer, isHydrate, namespace) {
2996
3010
  if (!isMounted) {
2997
3011
  const vnode = createVNode(rootComponent, rootProps);
2998
3012
  vnode.appContext = context;
3013
+ if (namespace === true) {
3014
+ namespace = "svg";
3015
+ } else if (namespace === false) {
3016
+ namespace = void 0;
3017
+ }
2999
3018
  if (isHydrate && hydrate) {
3000
3019
  hydrate(vnode, rootContainer);
3001
3020
  } else {
3002
- render(vnode, rootContainer, isSVG);
3021
+ render(vnode, rootContainer, namespace);
3003
3022
  }
3004
3023
  isMounted = true;
3005
3024
  app._container = rootContainer;
@@ -3494,7 +3513,15 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3494
3513
  }
3495
3514
 
3496
3515
  let hasMismatch = false;
3497
- const isSVGContainer = (container) => /svg/.test(container.namespaceURI) && container.tagName !== "foreignObject";
3516
+ const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
3517
+ const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
3518
+ const getContainerType = (container) => {
3519
+ if (isSVGContainer(container))
3520
+ return "svg";
3521
+ if (isMathMLContainer(container))
3522
+ return "mathml";
3523
+ return void 0;
3524
+ };
3498
3525
  const isComment = (node) => node.nodeType === 8 /* COMMENT */;
3499
3526
  function createHydrationFunctions(rendererInternals) {
3500
3527
  const {
@@ -3639,7 +3666,7 @@ function createHydrationFunctions(rendererInternals) {
3639
3666
  null,
3640
3667
  parentComponent,
3641
3668
  parentSuspense,
3642
- isSVGContainer(container),
3669
+ getContainerType(container),
3643
3670
  optimized
3644
3671
  );
3645
3672
  if (isAsyncWrapper(vnode)) {
@@ -3674,7 +3701,7 @@ function createHydrationFunctions(rendererInternals) {
3674
3701
  vnode,
3675
3702
  parentComponent,
3676
3703
  parentSuspense,
3677
- isSVGContainer(parentNode(node)),
3704
+ getContainerType(parentNode(node)),
3678
3705
  slotScopeIds,
3679
3706
  optimized,
3680
3707
  rendererInternals,
@@ -3695,6 +3722,39 @@ function createHydrationFunctions(rendererInternals) {
3695
3722
  if (dirs) {
3696
3723
  invokeDirectiveHook(vnode, null, parentComponent, "created");
3697
3724
  }
3725
+ let needCallTransitionHooks = false;
3726
+ if (isTemplateNode(el)) {
3727
+ needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
3728
+ const content = el.content.firstChild;
3729
+ if (needCallTransitionHooks) {
3730
+ transition.beforeEnter(content);
3731
+ }
3732
+ replaceNode(content, el, parentComponent);
3733
+ vnode.el = el = content;
3734
+ }
3735
+ if (shapeFlag & 16 && // skip if element has innerHTML / textContent
3736
+ !(props && (props.innerHTML || props.textContent))) {
3737
+ let next = hydrateChildren(
3738
+ el.firstChild,
3739
+ vnode,
3740
+ el,
3741
+ parentComponent,
3742
+ parentSuspense,
3743
+ slotScopeIds,
3744
+ optimized
3745
+ );
3746
+ while (next) {
3747
+ hasMismatch = true;
3748
+ const cur = next;
3749
+ next = next.nextSibling;
3750
+ remove(cur);
3751
+ }
3752
+ } else if (shapeFlag & 8) {
3753
+ if (el.textContent !== vnode.children) {
3754
+ hasMismatch = true;
3755
+ el.textContent = vnode.children;
3756
+ }
3757
+ }
3698
3758
  if (props) {
3699
3759
  if (forcePatch || !optimized || patchFlag & (16 | 32)) {
3700
3760
  for (const key in props) {
@@ -3705,7 +3765,7 @@ function createHydrationFunctions(rendererInternals) {
3705
3765
  key,
3706
3766
  null,
3707
3767
  props[key],
3708
- false,
3768
+ void 0,
3709
3769
  void 0,
3710
3770
  parentComponent
3711
3771
  );
@@ -3717,7 +3777,7 @@ function createHydrationFunctions(rendererInternals) {
3717
3777
  "onClick",
3718
3778
  null,
3719
3779
  props.onClick,
3720
- false,
3780
+ void 0,
3721
3781
  void 0,
3722
3782
  parentComponent
3723
3783
  );
@@ -3727,16 +3787,6 @@ function createHydrationFunctions(rendererInternals) {
3727
3787
  if (vnodeHooks = props && props.onVnodeBeforeMount) {
3728
3788
  invokeVNodeHook(vnodeHooks, parentComponent, vnode);
3729
3789
  }
3730
- let needCallTransitionHooks = false;
3731
- if (isTemplateNode(el)) {
3732
- needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
3733
- const content = el.content.firstChild;
3734
- if (needCallTransitionHooks) {
3735
- transition.beforeEnter(content);
3736
- }
3737
- replaceNode(content, el, parentComponent);
3738
- vnode.el = el = content;
3739
- }
3740
3790
  if (dirs) {
3741
3791
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
3742
3792
  }
@@ -3747,29 +3797,6 @@ function createHydrationFunctions(rendererInternals) {
3747
3797
  dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
3748
3798
  }, parentSuspense);
3749
3799
  }
3750
- if (shapeFlag & 16 && // skip if element has innerHTML / textContent
3751
- !(props && (props.innerHTML || props.textContent))) {
3752
- let next = hydrateChildren(
3753
- el.firstChild,
3754
- vnode,
3755
- el,
3756
- parentComponent,
3757
- parentSuspense,
3758
- slotScopeIds,
3759
- optimized
3760
- );
3761
- while (next) {
3762
- hasMismatch = true;
3763
- const cur = next;
3764
- next = next.nextSibling;
3765
- remove(cur);
3766
- }
3767
- } else if (shapeFlag & 8) {
3768
- if (el.textContent !== vnode.children) {
3769
- hasMismatch = true;
3770
- el.textContent = vnode.children;
3771
- }
3772
- }
3773
3800
  }
3774
3801
  return el.nextSibling;
3775
3802
  };
@@ -3799,7 +3826,7 @@ function createHydrationFunctions(rendererInternals) {
3799
3826
  null,
3800
3827
  parentComponent,
3801
3828
  parentSuspense,
3802
- isSVGContainer(container),
3829
+ getContainerType(container),
3803
3830
  slotScopeIds
3804
3831
  );
3805
3832
  }
@@ -3853,7 +3880,7 @@ function createHydrationFunctions(rendererInternals) {
3853
3880
  next,
3854
3881
  parentComponent,
3855
3882
  parentSuspense,
3856
- isSVGContainer(container),
3883
+ getContainerType(container),
3857
3884
  slotScopeIds
3858
3885
  );
3859
3886
  return next;
@@ -3919,7 +3946,7 @@ function baseCreateRenderer(options, createHydrationFns) {
3919
3946
  setScopeId: hostSetScopeId = shared.NOOP,
3920
3947
  insertStaticContent: hostInsertStaticContent
3921
3948
  } = options;
3922
- const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, isSVG = false, slotScopeIds = null, optimized = !!n2.dynamicChildren) => {
3949
+ const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = !!n2.dynamicChildren) => {
3923
3950
  if (n1 === n2) {
3924
3951
  return;
3925
3952
  }
@@ -3942,7 +3969,7 @@ function baseCreateRenderer(options, createHydrationFns) {
3942
3969
  break;
3943
3970
  case Static:
3944
3971
  if (n1 == null) {
3945
- mountStaticNode(n2, container, anchor, isSVG);
3972
+ mountStaticNode(n2, container, anchor, namespace);
3946
3973
  }
3947
3974
  break;
3948
3975
  case Fragment:
@@ -3953,7 +3980,7 @@ function baseCreateRenderer(options, createHydrationFns) {
3953
3980
  anchor,
3954
3981
  parentComponent,
3955
3982
  parentSuspense,
3956
- isSVG,
3983
+ namespace,
3957
3984
  slotScopeIds,
3958
3985
  optimized
3959
3986
  );
@@ -3967,7 +3994,7 @@ function baseCreateRenderer(options, createHydrationFns) {
3967
3994
  anchor,
3968
3995
  parentComponent,
3969
3996
  parentSuspense,
3970
- isSVG,
3997
+ namespace,
3971
3998
  slotScopeIds,
3972
3999
  optimized
3973
4000
  );
@@ -3979,7 +4006,7 @@ function baseCreateRenderer(options, createHydrationFns) {
3979
4006
  anchor,
3980
4007
  parentComponent,
3981
4008
  parentSuspense,
3982
- isSVG,
4009
+ namespace,
3983
4010
  slotScopeIds,
3984
4011
  optimized
3985
4012
  );
@@ -3991,7 +4018,7 @@ function baseCreateRenderer(options, createHydrationFns) {
3991
4018
  anchor,
3992
4019
  parentComponent,
3993
4020
  parentSuspense,
3994
- isSVG,
4021
+ namespace,
3995
4022
  slotScopeIds,
3996
4023
  optimized,
3997
4024
  internals
@@ -4004,7 +4031,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4004
4031
  anchor,
4005
4032
  parentComponent,
4006
4033
  parentSuspense,
4007
- isSVG,
4034
+ namespace,
4008
4035
  slotScopeIds,
4009
4036
  optimized,
4010
4037
  internals
@@ -4040,12 +4067,12 @@ function baseCreateRenderer(options, createHydrationFns) {
4040
4067
  n2.el = n1.el;
4041
4068
  }
4042
4069
  };
4043
- const mountStaticNode = (n2, container, anchor, isSVG) => {
4070
+ const mountStaticNode = (n2, container, anchor, namespace) => {
4044
4071
  [n2.el, n2.anchor] = hostInsertStaticContent(
4045
4072
  n2.children,
4046
4073
  container,
4047
4074
  anchor,
4048
- isSVG,
4075
+ namespace,
4049
4076
  n2.el,
4050
4077
  n2.anchor
4051
4078
  );
@@ -4068,8 +4095,12 @@ function baseCreateRenderer(options, createHydrationFns) {
4068
4095
  }
4069
4096
  hostRemove(anchor);
4070
4097
  };
4071
- const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
4072
- isSVG = isSVG || n2.type === "svg";
4098
+ const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
4099
+ if (n2.type === "svg") {
4100
+ namespace = "svg";
4101
+ } else if (n2.type === "math") {
4102
+ namespace = "mathml";
4103
+ }
4073
4104
  if (n1 == null) {
4074
4105
  mountElement(
4075
4106
  n2,
@@ -4077,7 +4108,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4077
4108
  anchor,
4078
4109
  parentComponent,
4079
4110
  parentSuspense,
4080
- isSVG,
4111
+ namespace,
4081
4112
  slotScopeIds,
4082
4113
  optimized
4083
4114
  );
@@ -4087,19 +4118,19 @@ function baseCreateRenderer(options, createHydrationFns) {
4087
4118
  n2,
4088
4119
  parentComponent,
4089
4120
  parentSuspense,
4090
- isSVG,
4121
+ namespace,
4091
4122
  slotScopeIds,
4092
4123
  optimized
4093
4124
  );
4094
4125
  }
4095
4126
  };
4096
- const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
4127
+ const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
4097
4128
  let el;
4098
4129
  let vnodeHook;
4099
- const { type, props, shapeFlag, transition, dirs } = vnode;
4130
+ const { props, shapeFlag, transition, dirs } = vnode;
4100
4131
  el = vnode.el = hostCreateElement(
4101
4132
  vnode.type,
4102
- isSVG,
4133
+ namespace,
4103
4134
  props && props.is,
4104
4135
  props
4105
4136
  );
@@ -4112,7 +4143,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4112
4143
  null,
4113
4144
  parentComponent,
4114
4145
  parentSuspense,
4115
- isSVG && type !== "foreignObject",
4146
+ resolveChildrenNamespace(vnode, namespace),
4116
4147
  slotScopeIds,
4117
4148
  optimized
4118
4149
  );
@@ -4129,7 +4160,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4129
4160
  key,
4130
4161
  null,
4131
4162
  props[key],
4132
- isSVG,
4163
+ namespace,
4133
4164
  vnode.children,
4134
4165
  parentComponent,
4135
4166
  parentSuspense,
@@ -4138,7 +4169,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4138
4169
  }
4139
4170
  }
4140
4171
  if ("value" in props) {
4141
- hostPatchProp(el, "value", null, props.value);
4172
+ hostPatchProp(el, "value", null, props.value, namespace);
4142
4173
  }
4143
4174
  if (vnodeHook = props.onVnodeBeforeMount) {
4144
4175
  invokeVNodeHook(vnodeHook, parentComponent, vnode);
@@ -4183,7 +4214,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4183
4214
  }
4184
4215
  }
4185
4216
  };
4186
- const mountChildren = (children, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, start = 0) => {
4217
+ const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
4187
4218
  for (let i = start; i < children.length; i++) {
4188
4219
  const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
4189
4220
  patch(
@@ -4193,13 +4224,13 @@ function baseCreateRenderer(options, createHydrationFns) {
4193
4224
  anchor,
4194
4225
  parentComponent,
4195
4226
  parentSuspense,
4196
- isSVG,
4227
+ namespace,
4197
4228
  slotScopeIds,
4198
4229
  optimized
4199
4230
  );
4200
4231
  }
4201
4232
  };
4202
- const patchElement = (n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
4233
+ const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
4203
4234
  const el = n2.el = n1.el;
4204
4235
  let { patchFlag, dynamicChildren, dirs } = n2;
4205
4236
  patchFlag |= n1.patchFlag & 16;
@@ -4214,7 +4245,6 @@ function baseCreateRenderer(options, createHydrationFns) {
4214
4245
  invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
4215
4246
  }
4216
4247
  parentComponent && toggleRecurse(parentComponent, true);
4217
- const areChildrenSVG = isSVG && n2.type !== "foreignObject";
4218
4248
  if (dynamicChildren) {
4219
4249
  patchBlockChildren(
4220
4250
  n1.dynamicChildren,
@@ -4222,7 +4252,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4222
4252
  el,
4223
4253
  parentComponent,
4224
4254
  parentSuspense,
4225
- areChildrenSVG,
4255
+ resolveChildrenNamespace(n2, namespace),
4226
4256
  slotScopeIds
4227
4257
  );
4228
4258
  } else if (!optimized) {
@@ -4233,7 +4263,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4233
4263
  null,
4234
4264
  parentComponent,
4235
4265
  parentSuspense,
4236
- areChildrenSVG,
4266
+ resolveChildrenNamespace(n2, namespace),
4237
4267
  slotScopeIds,
4238
4268
  false
4239
4269
  );
@@ -4247,16 +4277,16 @@ function baseCreateRenderer(options, createHydrationFns) {
4247
4277
  newProps,
4248
4278
  parentComponent,
4249
4279
  parentSuspense,
4250
- isSVG
4280
+ namespace
4251
4281
  );
4252
4282
  } else {
4253
4283
  if (patchFlag & 2) {
4254
4284
  if (oldProps.class !== newProps.class) {
4255
- hostPatchProp(el, "class", null, newProps.class, isSVG);
4285
+ hostPatchProp(el, "class", null, newProps.class, namespace);
4256
4286
  }
4257
4287
  }
4258
4288
  if (patchFlag & 4) {
4259
- hostPatchProp(el, "style", oldProps.style, newProps.style, isSVG);
4289
+ hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
4260
4290
  }
4261
4291
  if (patchFlag & 8) {
4262
4292
  const propsToUpdate = n2.dynamicProps;
@@ -4270,7 +4300,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4270
4300
  key,
4271
4301
  prev,
4272
4302
  next,
4273
- isSVG,
4303
+ namespace,
4274
4304
  n1.children,
4275
4305
  parentComponent,
4276
4306
  parentSuspense,
@@ -4293,7 +4323,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4293
4323
  newProps,
4294
4324
  parentComponent,
4295
4325
  parentSuspense,
4296
- isSVG
4326
+ namespace
4297
4327
  );
4298
4328
  }
4299
4329
  if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
@@ -4303,7 +4333,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4303
4333
  }, parentSuspense);
4304
4334
  }
4305
4335
  };
4306
- const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, isSVG, slotScopeIds) => {
4336
+ const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
4307
4337
  for (let i = 0; i < newChildren.length; i++) {
4308
4338
  const oldVNode = oldChildren[i];
4309
4339
  const newVNode = newChildren[i];
@@ -4328,13 +4358,13 @@ function baseCreateRenderer(options, createHydrationFns) {
4328
4358
  null,
4329
4359
  parentComponent,
4330
4360
  parentSuspense,
4331
- isSVG,
4361
+ namespace,
4332
4362
  slotScopeIds,
4333
4363
  true
4334
4364
  );
4335
4365
  }
4336
4366
  };
4337
- const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, isSVG) => {
4367
+ const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, namespace) => {
4338
4368
  if (oldProps !== newProps) {
4339
4369
  if (oldProps !== shared.EMPTY_OBJ) {
4340
4370
  for (const key in oldProps) {
@@ -4344,7 +4374,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4344
4374
  key,
4345
4375
  oldProps[key],
4346
4376
  null,
4347
- isSVG,
4377
+ namespace,
4348
4378
  vnode.children,
4349
4379
  parentComponent,
4350
4380
  parentSuspense,
@@ -4364,7 +4394,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4364
4394
  key,
4365
4395
  prev,
4366
4396
  next,
4367
- isSVG,
4397
+ namespace,
4368
4398
  vnode.children,
4369
4399
  parentComponent,
4370
4400
  parentSuspense,
@@ -4373,11 +4403,11 @@ function baseCreateRenderer(options, createHydrationFns) {
4373
4403
  }
4374
4404
  }
4375
4405
  if ("value" in newProps) {
4376
- hostPatchProp(el, "value", oldProps.value, newProps.value);
4406
+ hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
4377
4407
  }
4378
4408
  }
4379
4409
  };
4380
- const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
4410
+ const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
4381
4411
  const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
4382
4412
  const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
4383
4413
  let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
@@ -4393,7 +4423,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4393
4423
  fragmentEndAnchor,
4394
4424
  parentComponent,
4395
4425
  parentSuspense,
4396
- isSVG,
4426
+ namespace,
4397
4427
  slotScopeIds,
4398
4428
  optimized
4399
4429
  );
@@ -4407,7 +4437,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4407
4437
  container,
4408
4438
  parentComponent,
4409
4439
  parentSuspense,
4410
- isSVG,
4440
+ namespace,
4411
4441
  slotScopeIds
4412
4442
  );
4413
4443
  if (
@@ -4432,14 +4462,14 @@ function baseCreateRenderer(options, createHydrationFns) {
4432
4462
  fragmentEndAnchor,
4433
4463
  parentComponent,
4434
4464
  parentSuspense,
4435
- isSVG,
4465
+ namespace,
4436
4466
  slotScopeIds,
4437
4467
  optimized
4438
4468
  );
4439
4469
  }
4440
4470
  }
4441
4471
  };
4442
- const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
4472
+ const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
4443
4473
  n2.slotScopeIds = slotScopeIds;
4444
4474
  if (n1 == null) {
4445
4475
  if (n2.shapeFlag & 512) {
@@ -4447,7 +4477,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4447
4477
  n2,
4448
4478
  container,
4449
4479
  anchor,
4450
- isSVG,
4480
+ namespace,
4451
4481
  optimized
4452
4482
  );
4453
4483
  } else {
@@ -4457,7 +4487,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4457
4487
  anchor,
4458
4488
  parentComponent,
4459
4489
  parentSuspense,
4460
- isSVG,
4490
+ namespace,
4461
4491
  optimized
4462
4492
  );
4463
4493
  }
@@ -4465,7 +4495,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4465
4495
  updateComponent(n1, n2, optimized);
4466
4496
  }
4467
4497
  };
4468
- const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, isSVG, optimized) => {
4498
+ const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
4469
4499
  const instance = (initialVNode.component = createComponentInstance(
4470
4500
  initialVNode,
4471
4501
  parentComponent,
@@ -4483,17 +4513,17 @@ function baseCreateRenderer(options, createHydrationFns) {
4483
4513
  const placeholder = instance.subTree = createVNode(Comment);
4484
4514
  processCommentNode(null, placeholder, container, anchor);
4485
4515
  }
4486
- return;
4516
+ } else {
4517
+ setupRenderEffect(
4518
+ instance,
4519
+ initialVNode,
4520
+ container,
4521
+ anchor,
4522
+ parentSuspense,
4523
+ namespace,
4524
+ optimized
4525
+ );
4487
4526
  }
4488
- setupRenderEffect(
4489
- instance,
4490
- initialVNode,
4491
- container,
4492
- anchor,
4493
- parentSuspense,
4494
- isSVG,
4495
- optimized
4496
- );
4497
4527
  };
4498
4528
  const updateComponent = (n1, n2, optimized) => {
4499
4529
  const instance = n2.component = n1.component;
@@ -4512,7 +4542,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4512
4542
  instance.vnode = n2;
4513
4543
  }
4514
4544
  };
4515
- const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized) => {
4545
+ const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
4516
4546
  const componentUpdateFn = () => {
4517
4547
  if (!instance.isMounted) {
4518
4548
  let vnodeHook;
@@ -4558,7 +4588,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4558
4588
  anchor,
4559
4589
  instance,
4560
4590
  parentSuspense,
4561
- isSVG
4591
+ namespace
4562
4592
  );
4563
4593
  initialVNode.el = subTree.el;
4564
4594
  }
@@ -4579,6 +4609,21 @@ function baseCreateRenderer(options, createHydrationFns) {
4579
4609
  initialVNode = container = anchor = null;
4580
4610
  } else {
4581
4611
  let { next, bu, u, parent, vnode } = instance;
4612
+ {
4613
+ const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
4614
+ if (nonHydratedAsyncRoot) {
4615
+ if (next) {
4616
+ next.el = vnode.el;
4617
+ updateComponentPreRender(instance, next, optimized);
4618
+ }
4619
+ nonHydratedAsyncRoot.asyncDep.then(() => {
4620
+ if (!instance.isUnmounted) {
4621
+ componentUpdateFn();
4622
+ }
4623
+ });
4624
+ return;
4625
+ }
4626
+ }
4582
4627
  let originNext = next;
4583
4628
  let vnodeHook;
4584
4629
  toggleRecurse(instance, false);
@@ -4607,7 +4652,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4607
4652
  getNextHostNode(prevTree),
4608
4653
  instance,
4609
4654
  parentSuspense,
4610
- isSVG
4655
+ namespace
4611
4656
  );
4612
4657
  next.el = nextTree.el;
4613
4658
  if (originNext === null) {
@@ -4648,10 +4693,10 @@ function baseCreateRenderer(options, createHydrationFns) {
4648
4693
  updateProps(instance, nextVNode.props, prevProps, optimized);
4649
4694
  updateSlots(instance, nextVNode.children, optimized);
4650
4695
  reactivity.pauseTracking();
4651
- flushPreFlushCbs();
4696
+ flushPreFlushCbs(instance);
4652
4697
  reactivity.resetTracking();
4653
4698
  };
4654
- const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized = false) => {
4699
+ const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
4655
4700
  const c1 = n1 && n1.children;
4656
4701
  const prevShapeFlag = n1 ? n1.shapeFlag : 0;
4657
4702
  const c2 = n2.children;
@@ -4665,7 +4710,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4665
4710
  anchor,
4666
4711
  parentComponent,
4667
4712
  parentSuspense,
4668
- isSVG,
4713
+ namespace,
4669
4714
  slotScopeIds,
4670
4715
  optimized
4671
4716
  );
@@ -4678,7 +4723,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4678
4723
  anchor,
4679
4724
  parentComponent,
4680
4725
  parentSuspense,
4681
- isSVG,
4726
+ namespace,
4682
4727
  slotScopeIds,
4683
4728
  optimized
4684
4729
  );
@@ -4702,7 +4747,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4702
4747
  anchor,
4703
4748
  parentComponent,
4704
4749
  parentSuspense,
4705
- isSVG,
4750
+ namespace,
4706
4751
  slotScopeIds,
4707
4752
  optimized
4708
4753
  );
@@ -4720,7 +4765,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4720
4765
  anchor,
4721
4766
  parentComponent,
4722
4767
  parentSuspense,
4723
- isSVG,
4768
+ namespace,
4724
4769
  slotScopeIds,
4725
4770
  optimized
4726
4771
  );
@@ -4728,7 +4773,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4728
4773
  }
4729
4774
  }
4730
4775
  };
4731
- const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
4776
+ const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
4732
4777
  c1 = c1 || shared.EMPTY_ARR;
4733
4778
  c2 = c2 || shared.EMPTY_ARR;
4734
4779
  const oldLength = c1.length;
@@ -4744,7 +4789,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4744
4789
  null,
4745
4790
  parentComponent,
4746
4791
  parentSuspense,
4747
- isSVG,
4792
+ namespace,
4748
4793
  slotScopeIds,
4749
4794
  optimized
4750
4795
  );
@@ -4765,14 +4810,14 @@ function baseCreateRenderer(options, createHydrationFns) {
4765
4810
  anchor,
4766
4811
  parentComponent,
4767
4812
  parentSuspense,
4768
- isSVG,
4813
+ namespace,
4769
4814
  slotScopeIds,
4770
4815
  optimized,
4771
4816
  commonLength
4772
4817
  );
4773
4818
  }
4774
4819
  };
4775
- const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
4820
+ const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
4776
4821
  let i = 0;
4777
4822
  const l2 = c2.length;
4778
4823
  let e1 = c1.length - 1;
@@ -4788,7 +4833,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4788
4833
  null,
4789
4834
  parentComponent,
4790
4835
  parentSuspense,
4791
- isSVG,
4836
+ namespace,
4792
4837
  slotScopeIds,
4793
4838
  optimized
4794
4839
  );
@@ -4808,7 +4853,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4808
4853
  null,
4809
4854
  parentComponent,
4810
4855
  parentSuspense,
4811
- isSVG,
4856
+ namespace,
4812
4857
  slotScopeIds,
4813
4858
  optimized
4814
4859
  );
@@ -4830,7 +4875,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4830
4875
  anchor,
4831
4876
  parentComponent,
4832
4877
  parentSuspense,
4833
- isSVG,
4878
+ namespace,
4834
4879
  slotScopeIds,
4835
4880
  optimized
4836
4881
  );
@@ -4893,7 +4938,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4893
4938
  null,
4894
4939
  parentComponent,
4895
4940
  parentSuspense,
4896
- isSVG,
4941
+ namespace,
4897
4942
  slotScopeIds,
4898
4943
  optimized
4899
4944
  );
@@ -4914,7 +4959,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4914
4959
  anchor,
4915
4960
  parentComponent,
4916
4961
  parentSuspense,
4917
- isSVG,
4962
+ namespace,
4918
4963
  slotScopeIds,
4919
4964
  optimized
4920
4965
  );
@@ -5121,13 +5166,21 @@ function baseCreateRenderer(options, createHydrationFns) {
5121
5166
  }
5122
5167
  return hostNextSibling(vnode.anchor || vnode.el);
5123
5168
  };
5124
- const render = (vnode, container, isSVG) => {
5169
+ const render = (vnode, container, namespace) => {
5125
5170
  if (vnode == null) {
5126
5171
  if (container._vnode) {
5127
5172
  unmount(container._vnode, null, null, true);
5128
5173
  }
5129
5174
  } else {
5130
- patch(container._vnode || null, vnode, container, null, null, null, isSVG);
5175
+ patch(
5176
+ container._vnode || null,
5177
+ vnode,
5178
+ container,
5179
+ null,
5180
+ null,
5181
+ null,
5182
+ namespace
5183
+ );
5131
5184
  }
5132
5185
  flushPreFlushCbs();
5133
5186
  flushPostFlushCbs();
@@ -5158,6 +5211,9 @@ function baseCreateRenderer(options, createHydrationFns) {
5158
5211
  createApp: createAppAPI(render, hydrate)
5159
5212
  };
5160
5213
  }
5214
+ function resolveChildrenNamespace({ type, props }, currentNamespace) {
5215
+ return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
5216
+ }
5161
5217
  function toggleRecurse({ effect, update }, allowed) {
5162
5218
  effect.allowRecurse = update.allowRecurse = allowed;
5163
5219
  }
@@ -5225,10 +5281,21 @@ function getSequence(arr) {
5225
5281
  }
5226
5282
  return result;
5227
5283
  }
5284
+ function locateNonHydratedAsyncRoot(instance) {
5285
+ const subComponent = instance.subTree.component;
5286
+ if (subComponent) {
5287
+ if (subComponent.asyncDep && !subComponent.asyncResolved) {
5288
+ return subComponent;
5289
+ } else {
5290
+ return locateNonHydratedAsyncRoot(subComponent);
5291
+ }
5292
+ }
5293
+ }
5228
5294
 
5229
5295
  const isTeleport = (type) => type.__isTeleport;
5230
5296
  const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
5231
5297
  const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
5298
+ const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
5232
5299
  const resolveTarget = (props, select) => {
5233
5300
  const targetSelector = props && props.to;
5234
5301
  if (shared.isString(targetSelector)) {
@@ -5245,7 +5312,7 @@ const resolveTarget = (props, select) => {
5245
5312
  const TeleportImpl = {
5246
5313
  name: "Teleport",
5247
5314
  __isTeleport: true,
5248
- process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals) {
5315
+ process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
5249
5316
  const {
5250
5317
  mc: mountChildren,
5251
5318
  pc: patchChildren,
@@ -5263,7 +5330,11 @@ const TeleportImpl = {
5263
5330
  const targetAnchor = n2.targetAnchor = createText("");
5264
5331
  if (target) {
5265
5332
  insert(targetAnchor, target);
5266
- isSVG = isSVG || isTargetSVG(target);
5333
+ if (namespace === "svg" || isTargetSVG(target)) {
5334
+ namespace = "svg";
5335
+ } else if (namespace === "mathml" || isTargetMathML(target)) {
5336
+ namespace = "mathml";
5337
+ }
5267
5338
  }
5268
5339
  const mount = (container2, anchor2) => {
5269
5340
  if (shapeFlag & 16) {
@@ -5273,7 +5344,7 @@ const TeleportImpl = {
5273
5344
  anchor2,
5274
5345
  parentComponent,
5275
5346
  parentSuspense,
5276
- isSVG,
5347
+ namespace,
5277
5348
  slotScopeIds,
5278
5349
  optimized
5279
5350
  );
@@ -5292,7 +5363,11 @@ const TeleportImpl = {
5292
5363
  const wasDisabled = isTeleportDisabled(n1.props);
5293
5364
  const currentContainer = wasDisabled ? container : target;
5294
5365
  const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
5295
- isSVG = isSVG || isTargetSVG(target);
5366
+ if (namespace === "svg" || isTargetSVG(target)) {
5367
+ namespace = "svg";
5368
+ } else if (namespace === "mathml" || isTargetMathML(target)) {
5369
+ namespace = "mathml";
5370
+ }
5296
5371
  if (dynamicChildren) {
5297
5372
  patchBlockChildren(
5298
5373
  n1.dynamicChildren,
@@ -5300,7 +5375,7 @@ const TeleportImpl = {
5300
5375
  currentContainer,
5301
5376
  parentComponent,
5302
5377
  parentSuspense,
5303
- isSVG,
5378
+ namespace,
5304
5379
  slotScopeIds
5305
5380
  );
5306
5381
  traverseStaticChildren(n1, n2, true);
@@ -5312,7 +5387,7 @@ const TeleportImpl = {
5312
5387
  currentAnchor,
5313
5388
  parentComponent,
5314
5389
  parentSuspense,
5315
- isSVG,
5390
+ namespace,
5316
5391
  slotScopeIds,
5317
5392
  false
5318
5393
  );
@@ -5895,20 +5970,29 @@ function createComponentInstance(vnode, parent, suspense) {
5895
5970
  let currentInstance = null;
5896
5971
  const getCurrentInstance = () => currentInstance || currentRenderingInstance;
5897
5972
  let internalSetCurrentInstance;
5898
- let globalCurrentInstanceSetters;
5899
- let settersKey = "__VUE_INSTANCE_SETTERS__";
5973
+ let setInSSRSetupState;
5900
5974
  {
5901
- if (!(globalCurrentInstanceSetters = shared.getGlobalThis()[settersKey])) {
5902
- globalCurrentInstanceSetters = shared.getGlobalThis()[settersKey] = [];
5903
- }
5904
- globalCurrentInstanceSetters.push((i) => currentInstance = i);
5905
- internalSetCurrentInstance = (instance) => {
5906
- if (globalCurrentInstanceSetters.length > 1) {
5907
- globalCurrentInstanceSetters.forEach((s) => s(instance));
5908
- } else {
5909
- globalCurrentInstanceSetters[0](instance);
5910
- }
5975
+ const g = shared.getGlobalThis();
5976
+ const registerGlobalSetter = (key, setter) => {
5977
+ let setters;
5978
+ if (!(setters = g[key]))
5979
+ setters = g[key] = [];
5980
+ setters.push(setter);
5981
+ return (v) => {
5982
+ if (setters.length > 1)
5983
+ setters.forEach((set) => set(v));
5984
+ else
5985
+ setters[0](v);
5986
+ };
5911
5987
  };
5988
+ internalSetCurrentInstance = registerGlobalSetter(
5989
+ `__VUE_INSTANCE_SETTERS__`,
5990
+ (v) => currentInstance = v
5991
+ );
5992
+ setInSSRSetupState = registerGlobalSetter(
5993
+ `__VUE_SSR_SETTERS__`,
5994
+ (v) => isInSSRComponentSetup = v
5995
+ );
5912
5996
  }
5913
5997
  const setCurrentInstance = (instance) => {
5914
5998
  internalSetCurrentInstance(instance);
@@ -5923,13 +6007,13 @@ function isStatefulComponent(instance) {
5923
6007
  }
5924
6008
  let isInSSRComponentSetup = false;
5925
6009
  function setupComponent(instance, isSSR = false) {
5926
- isInSSRComponentSetup = isSSR;
6010
+ isSSR && setInSSRSetupState(isSSR);
5927
6011
  const { props, children } = instance.vnode;
5928
6012
  const isStateful = isStatefulComponent(instance);
5929
6013
  initProps(instance, props, isStateful, isSSR);
5930
6014
  initSlots(instance, children);
5931
6015
  const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
5932
- isInSSRComponentSetup = false;
6016
+ isSSR && setInSSRSetupState(false);
5933
6017
  return setupResult;
5934
6018
  }
5935
6019
  function setupStatefulComponent(instance, isSSR) {
@@ -6140,7 +6224,7 @@ function isMemoSame(cached, memo) {
6140
6224
  return true;
6141
6225
  }
6142
6226
 
6143
- const version = "3.4.0-alpha.4";
6227
+ const version = "3.4.0-beta.2";
6144
6228
  const ErrorTypeStrings = null;
6145
6229
  const _ssrUtils = {
6146
6230
  createComponentInstance,