@vue/compat 3.6.0-rc.3 → 3.6.0-rc.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1035,21 +1035,25 @@ interface AppConfig extends GenericAppConfig {
1035
1035
  /**
1036
1036
  * The vapor in vdom implementation is in runtime-vapor/src/vdomInterop.ts
1037
1037
  */
1038
- interface VaporInteropInterface {
1038
+ interface VaporInVdomInterface {
1039
1039
  mount(vnode: VNode, container: any, anchor: any, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, onBeforeMount?: () => void, onVnodeBeforeMount?: () => void): GenericComponentInstance;
1040
1040
  update(n1: VNode, n2: VNode, shouldUpdate: boolean, onBeforeUpdate?: () => void, onVnodeBeforeUpdate?: () => void): void;
1041
1041
  unmount(vnode: VNode, doRemove: boolean | undefined, parentSuspense: SuspenseBoundary | null): void;
1042
1042
  move(vnode: VNode, container: any, anchor: any, moveType: MoveType, parentSuspense: SuspenseBoundary | null): void;
1043
- slot(n1: VNode | null, n2: VNode, container: any, anchor: any, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null): void;
1043
+ slot(n1: VNode | null, n2: VNode, container: any, anchor: any, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null): void;
1044
1044
  hydrate(vnode: VNode, node: any, container: any, anchor: any, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, onBeforeMount?: () => void, onVnodeBeforeMount?: () => void): Node;
1045
- hydrateSlot(vnode: VNode, node: any, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null): Node;
1045
+ hydrateSlot(vnode: VNode, node: any, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null): Node;
1046
1046
  activate(vnode: VNode, container: any, anchor: any, parentComponent: ComponentInternalInstance, parentSuspense: SuspenseBoundary | null): void;
1047
1047
  deactivate(vnode: VNode, container: any, parentSuspense: SuspenseBoundary | null): void;
1048
1048
  setTransitionHooks(component: ComponentInternalInstance, transition: TransitionHooks): void;
1049
- vdomMount: (component: ConcreteComponent, parentComponent: any, props?: any, slots?: any, once?: boolean) => any;
1050
- vdomUnmount: UnmountComponentFn;
1051
- vdomSlot: (slots: any, name: string | (() => string), props: Record<string, any>, parentComponent: any, fallback?: any, once?: boolean, slotRoot?: boolean, sharedFallback?: boolean, inheritFallback?: boolean, adoptAnchor?: Node) => any;
1052
- vdomMountVNode: (vnode: VNode, parentComponent: any) => any;
1049
+ }
1050
+ /**
1051
+ * The vdom in vapor implementation is in runtime-vapor/src/vdomInterop.ts
1052
+ */
1053
+ interface VdomInVaporInterface {
1054
+ mount: (component: ConcreteComponent, parentComponent: any, props?: any, slots?: any, once?: boolean) => any;
1055
+ slot: (slots: any, name: string | (() => string), props: Record<string, any>, parentComponent: any, fallback?: any, once?: boolean, slotRoot?: boolean, sharedFallback?: boolean, inheritFallback?: boolean, adoptAnchor?: Node) => any;
1056
+ mountVNode: (vnode: VNode, parentComponent: any, getFallthroughAttrs?: () => Record<string, any>) => any;
1053
1057
  }
1054
1058
  /**
1055
1059
  * Minimal app context shared between vdom and vapor
@@ -1068,7 +1072,11 @@ interface GenericAppContext {
1068
1072
  /**
1069
1073
  * @internal vapor interop only
1070
1074
  */
1071
- vapor?: VaporInteropInterface;
1075
+ vapor?: VaporInVdomInterface;
1076
+ /**
1077
+ * @internal vdom interop only
1078
+ */
1079
+ vdom?: VdomInVaporInterface;
1072
1080
  }
1073
1081
  interface AppContext extends GenericAppContext {
1074
1082
  config: AppConfig;
@@ -1233,6 +1241,13 @@ interface VNode<HostNode = RendererNode, HostElement = RendererElement, ExtraPro
1233
1241
  * @internal
1234
1242
  */
1235
1243
  slotScopeIds: string[] | null;
1244
+ /**
1245
+ * Root-only scope ids published by the vapor interop onto vnodes serving
1246
+ * as a vapor component's effective root; consumed by getInheritedScopeIds
1247
+ * where the effective-root chain tops out (before insertion).
1248
+ * @internal
1249
+ */
1250
+ vaporScopeIds?: string[];
1236
1251
  children: VNodeNormalizedChildren;
1237
1252
  component: ComponentInternalInstance | null;
1238
1253
  dirs: DirectiveBinding[] | null;
package/dist/vue.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.6.0-rc.3
2
+ * @vue/compat v3.6.0-rc.5
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -4267,7 +4267,18 @@ const logMismatchError = () => {
4267
4267
  hasLoggedMismatchError = true;
4268
4268
  };
4269
4269
  const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
4270
- const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
4270
+ const isMathMLContainer = (container) => {
4271
+ if (!container.namespaceURI.includes("MathML")) return false;
4272
+ if (container.tagName !== "annotation-xml") return true;
4273
+ const encoding = container.getAttribute("encoding");
4274
+ return !encoding || !encoding.includes("html");
4275
+ };
4276
+ /**
4277
+ * Resolve the element namespace a container's children should be created in.
4278
+ * The live DOM is the source of truth, so this also covers containers that are
4279
+ * only known at runtime (interop boundaries, teleport targets).
4280
+ * @internal
4281
+ */
4271
4282
  const getContainerType = (container) => {
4272
4283
  if (container.nodeType !== 1) return void 0;
4273
4284
  if (isSVGContainer(container)) return "svg";
@@ -4346,7 +4357,7 @@ function createHydrationFunctions(rendererInternals) {
4346
4357
  else nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
4347
4358
  break;
4348
4359
  case VaporSlot:
4349
- nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense);
4360
+ nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense, slotScopeIds);
4350
4361
  break;
4351
4362
  default: if (shapeFlag & 1) if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode$1(node)) nextNode = onMismatch();
4352
4363
  else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
@@ -4513,7 +4524,7 @@ function createHydrationFunctions(rendererInternals) {
4513
4524
  const container = parentNode(node);
4514
4525
  remove(node);
4515
4526
  patch(null, vnode, container, next, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
4516
- if (parentComponent) {
4527
+ if (parentComponent && parentComponent.vnode) {
4517
4528
  parentComponent.vnode.el = vnode.el;
4518
4529
  updateHOCHostEl(parentComponent, vnode.el);
4519
4530
  }
@@ -4536,7 +4547,7 @@ function createHydrationFunctions(rendererInternals) {
4536
4547
  if (parentNode) parentNode.replaceChild(newNode, oldNode);
4537
4548
  let parent = parentComponent;
4538
4549
  while (parent) {
4539
- if (parent.vnode.el === oldNode) parent.vnode.el = parent.subTree.el = newNode;
4550
+ if (parent.vnode && parent.vnode.el === oldNode) parent.vnode.el = parent.subTree.el = newNode;
4540
4551
  parent = parent.parent;
4541
4552
  }
4542
4553
  };
@@ -6471,7 +6482,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6471
6482
  if (options.el) return vm.$mount(options.el);
6472
6483
  else return vm;
6473
6484
  }
6474
- Vue.version = `2.6.14-compat:3.6.0-rc.3`;
6485
+ Vue.version = `2.6.14-compat:3.6.0-rc.5`;
6475
6486
  Vue.config = singletonApp.config;
6476
6487
  Vue.use = (plugin, ...options) => {
6477
6488
  if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
@@ -7816,7 +7827,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7816
7827
  processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
7817
7828
  break;
7818
7829
  case VaporSlot:
7819
- getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense);
7830
+ getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense, slotScopeIds);
7820
7831
  break;
7821
7832
  default: if (shapeFlag & 1) processElement(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
7822
7833
  else if (shapeFlag & 6) processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
@@ -8677,7 +8688,7 @@ function isVaporComponent(type) {
8677
8688
  /**
8678
8689
  * shared between vdom and vapor
8679
8690
  */
8680
- function getInheritedScopeIds(vnode, parentComponent) {
8691
+ function getInheritedScopeIds(vnode, parentComponent, includeVaporRootIds = true) {
8681
8692
  const inheritedScopeIds = [];
8682
8693
  let currentParent = parentComponent;
8683
8694
  let currentVNode = vnode;
@@ -8693,6 +8704,8 @@ function getInheritedScopeIds(vnode, parentComponent) {
8693
8704
  currentParent = currentParent.parent;
8694
8705
  } else break;
8695
8706
  }
8707
+ const vaporScopeIds = includeVaporRootIds && currentVNode.vaporScopeIds;
8708
+ if (vaporScopeIds) inheritedScopeIds.push(...vaporScopeIds);
8696
8709
  return inheritedScopeIds;
8697
8710
  }
8698
8711
  function resolveAsyncComponentPlaceholder(anchorVnode) {
@@ -9985,7 +9998,7 @@ function isMemoSame(cached, memo) {
9985
9998
  }
9986
9999
  //#endregion
9987
10000
  //#region packages/runtime-core/src/index.ts
9988
- const version = "3.6.0-rc.3";
10001
+ const version = "3.6.0-rc.5";
9989
10002
  const warn = warn$1;
9990
10003
  /**
9991
10004
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.6.0-rc.3
2
+ * @vue/compat v3.6.0-rc.5
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -3470,7 +3470,18 @@ const logMismatchError = () => {
3470
3470
  hasLoggedMismatchError = true;
3471
3471
  };
3472
3472
  const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
3473
- const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
3473
+ const isMathMLContainer = (container) => {
3474
+ if (!container.namespaceURI.includes("MathML")) return false;
3475
+ if (container.tagName !== "annotation-xml") return true;
3476
+ const encoding = container.getAttribute("encoding");
3477
+ return !encoding || !encoding.includes("html");
3478
+ };
3479
+ /**
3480
+ * Resolve the element namespace a container's children should be created in.
3481
+ * The live DOM is the source of truth, so this also covers containers that are
3482
+ * only known at runtime (interop boundaries, teleport targets).
3483
+ * @internal
3484
+ */
3474
3485
  const getContainerType = (container) => {
3475
3486
  if (container.nodeType !== 1) return void 0;
3476
3487
  if (isSVGContainer(container)) return "svg";
@@ -3545,7 +3556,7 @@ function createHydrationFunctions(rendererInternals) {
3545
3556
  else nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
3546
3557
  break;
3547
3558
  case VaporSlot:
3548
- nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense);
3559
+ nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense, slotScopeIds);
3549
3560
  break;
3550
3561
  default: if (shapeFlag & 1) if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode$1(node)) nextNode = onMismatch();
3551
3562
  else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
@@ -3700,7 +3711,7 @@ function createHydrationFunctions(rendererInternals) {
3700
3711
  const container = parentNode(node);
3701
3712
  remove(node);
3702
3713
  patch(null, vnode, container, next, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
3703
- if (parentComponent) {
3714
+ if (parentComponent && parentComponent.vnode) {
3704
3715
  parentComponent.vnode.el = vnode.el;
3705
3716
  updateHOCHostEl(parentComponent, vnode.el);
3706
3717
  }
@@ -3723,7 +3734,7 @@ function createHydrationFunctions(rendererInternals) {
3723
3734
  if (parentNode) parentNode.replaceChild(newNode, oldNode);
3724
3735
  let parent = parentComponent;
3725
3736
  while (parent) {
3726
- if (parent.vnode.el === oldNode) parent.vnode.el = parent.subTree.el = newNode;
3737
+ if (parent.vnode && parent.vnode.el === oldNode) parent.vnode.el = parent.subTree.el = newNode;
3727
3738
  parent = parent.parent;
3728
3739
  }
3729
3740
  };
@@ -5362,7 +5373,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5362
5373
  if (options.el) return vm.$mount(options.el);
5363
5374
  else return vm;
5364
5375
  }
5365
- Vue.version = `2.6.14-compat:3.6.0-rc.3`;
5376
+ Vue.version = `2.6.14-compat:3.6.0-rc.5`;
5366
5377
  Vue.config = singletonApp.config;
5367
5378
  Vue.use = (plugin, ...options) => {
5368
5379
  if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
@@ -6383,7 +6394,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6383
6394
  processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
6384
6395
  break;
6385
6396
  case VaporSlot:
6386
- getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense);
6397
+ getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense, slotScopeIds);
6387
6398
  break;
6388
6399
  default: if (shapeFlag & 1) processElement(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
6389
6400
  else if (shapeFlag & 6) processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
@@ -7163,7 +7174,7 @@ function isVaporComponent(type) {
7163
7174
  /**
7164
7175
  * shared between vdom and vapor
7165
7176
  */
7166
- function getInheritedScopeIds(vnode, parentComponent) {
7177
+ function getInheritedScopeIds(vnode, parentComponent, includeVaporRootIds = true) {
7167
7178
  const inheritedScopeIds = [];
7168
7179
  let currentParent = parentComponent;
7169
7180
  let currentVNode = vnode;
@@ -7178,6 +7189,8 @@ function getInheritedScopeIds(vnode, parentComponent) {
7178
7189
  currentParent = currentParent.parent;
7179
7190
  } else break;
7180
7191
  }
7192
+ const vaporScopeIds = includeVaporRootIds && currentVNode.vaporScopeIds;
7193
+ if (vaporScopeIds) inheritedScopeIds.push(...vaporScopeIds);
7181
7194
  return inheritedScopeIds;
7182
7195
  }
7183
7196
  function resolveAsyncComponentPlaceholder(anchorVnode) {
@@ -8165,7 +8178,7 @@ function isMemoSame(cached, memo) {
8165
8178
  }
8166
8179
  //#endregion
8167
8180
  //#region packages/runtime-core/src/index.ts
8168
- const version = "3.6.0-rc.3";
8181
+ const version = "3.6.0-rc.5";
8169
8182
  const warn = NOOP;
8170
8183
  /**
8171
8184
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.6.0-rc.3
2
+ * @vue/compat v3.6.0-rc.5
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -4204,7 +4204,18 @@ const logMismatchError = () => {
4204
4204
  hasLoggedMismatchError = true;
4205
4205
  };
4206
4206
  const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
4207
- const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
4207
+ const isMathMLContainer = (container) => {
4208
+ if (!container.namespaceURI.includes("MathML")) return false;
4209
+ if (container.tagName !== "annotation-xml") return true;
4210
+ const encoding = container.getAttribute("encoding");
4211
+ return !encoding || !encoding.includes("html");
4212
+ };
4213
+ /**
4214
+ * Resolve the element namespace a container's children should be created in.
4215
+ * The live DOM is the source of truth, so this also covers containers that are
4216
+ * only known at runtime (interop boundaries, teleport targets).
4217
+ * @internal
4218
+ */
4208
4219
  const getContainerType = (container) => {
4209
4220
  if (container.nodeType !== 1) return void 0;
4210
4221
  if (isSVGContainer(container)) return "svg";
@@ -4283,7 +4294,7 @@ function createHydrationFunctions(rendererInternals) {
4283
4294
  else nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
4284
4295
  break;
4285
4296
  case VaporSlot:
4286
- nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense);
4297
+ nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense, slotScopeIds);
4287
4298
  break;
4288
4299
  default: if (shapeFlag & 1) if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode$1(node)) nextNode = onMismatch();
4289
4300
  else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
@@ -4450,7 +4461,7 @@ function createHydrationFunctions(rendererInternals) {
4450
4461
  const container = parentNode(node);
4451
4462
  remove(node);
4452
4463
  patch(null, vnode, container, next, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
4453
- if (parentComponent) {
4464
+ if (parentComponent && parentComponent.vnode) {
4454
4465
  parentComponent.vnode.el = vnode.el;
4455
4466
  updateHOCHostEl(parentComponent, vnode.el);
4456
4467
  }
@@ -4473,7 +4484,7 @@ function createHydrationFunctions(rendererInternals) {
4473
4484
  if (parentNode) parentNode.replaceChild(newNode, oldNode);
4474
4485
  let parent = parentComponent;
4475
4486
  while (parent) {
4476
- if (parent.vnode.el === oldNode) parent.vnode.el = parent.subTree.el = newNode;
4487
+ if (parent.vnode && parent.vnode.el === oldNode) parent.vnode.el = parent.subTree.el = newNode;
4477
4488
  parent = parent.parent;
4478
4489
  }
4479
4490
  };
@@ -6403,7 +6414,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6403
6414
  if (options.el) return vm.$mount(options.el);
6404
6415
  else return vm;
6405
6416
  }
6406
- Vue.version = `2.6.14-compat:3.6.0-rc.3`;
6417
+ Vue.version = `2.6.14-compat:3.6.0-rc.5`;
6407
6418
  Vue.config = singletonApp.config;
6408
6419
  Vue.use = (plugin, ...options) => {
6409
6420
  if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
@@ -7748,7 +7759,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7748
7759
  processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
7749
7760
  break;
7750
7761
  case VaporSlot:
7751
- getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense);
7762
+ getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense, slotScopeIds);
7752
7763
  break;
7753
7764
  default: if (shapeFlag & 1) processElement(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
7754
7765
  else if (shapeFlag & 6) processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
@@ -8609,7 +8620,7 @@ function isVaporComponent(type) {
8609
8620
  /**
8610
8621
  * shared between vdom and vapor
8611
8622
  */
8612
- function getInheritedScopeIds(vnode, parentComponent) {
8623
+ function getInheritedScopeIds(vnode, parentComponent, includeVaporRootIds = true) {
8613
8624
  const inheritedScopeIds = [];
8614
8625
  let currentParent = parentComponent;
8615
8626
  let currentVNode = vnode;
@@ -8625,6 +8636,8 @@ function getInheritedScopeIds(vnode, parentComponent) {
8625
8636
  currentParent = currentParent.parent;
8626
8637
  } else break;
8627
8638
  }
8639
+ const vaporScopeIds = includeVaporRootIds && currentVNode.vaporScopeIds;
8640
+ if (vaporScopeIds) inheritedScopeIds.push(...vaporScopeIds);
8628
8641
  return inheritedScopeIds;
8629
8642
  }
8630
8643
  function resolveAsyncComponentPlaceholder(anchorVnode) {
@@ -9907,7 +9920,7 @@ function isMemoSame(cached, memo) {
9907
9920
  }
9908
9921
  //#endregion
9909
9922
  //#region packages/runtime-core/src/index.ts
9910
- const version = "3.6.0-rc.3";
9923
+ const version = "3.6.0-rc.5";
9911
9924
  const warn = warn$1;
9912
9925
  /**
9913
9926
  * Runtime error messages. Only exposed in dev or esm builds.