@vue/runtime-core 3.6.0-alpha.6 → 3.6.0-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-core v3.6.0-alpha.6
2
+ * @vue/runtime-core v3.6.0-alpha.7
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -482,6 +482,7 @@ function checkRecursiveUpdates(seen, fn) {
482
482
 
483
483
  let isHmrUpdating = false;
484
484
  const hmrDirtyComponents = /* @__PURE__ */ new Map();
485
+ const hmrDirtyComponentsMode = /* @__PURE__ */ new Map();
485
486
  {
486
487
  shared.getGlobalThis().__VUE_HMR_RUNTIME__ = {
487
488
  createRecord: tryWrap(createRecord),
@@ -545,9 +546,10 @@ function reload(id, newComp) {
545
546
  const record = map.get(id);
546
547
  if (!record) return;
547
548
  newComp = normalizeClassComponent(newComp);
549
+ const isVapor = record.initialDef.__vapor;
548
550
  updateComponentDef(record.initialDef, newComp);
549
551
  const instances = [...record.instances];
550
- if (newComp.__vapor && !instances.some((i) => i.ceReload)) {
552
+ if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
551
553
  for (const instance of instances) {
552
554
  if (instance.root && instance.root.ce && instance !== instance.root) {
553
555
  instance.root.ce._removeChildStyle(instance.type);
@@ -567,6 +569,7 @@ function reload(id, newComp) {
567
569
  hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
568
570
  }
569
571
  dirtyInstances.add(instance);
572
+ hmrDirtyComponentsMode.set(oldComp, !!isVapor);
570
573
  instance.appContext.propsCache.delete(instance.type);
571
574
  instance.appContext.emitsCache.delete(instance.type);
572
575
  instance.appContext.optionsCache.delete(instance.type);
@@ -607,6 +610,7 @@ function reload(id, newComp) {
607
610
  }
608
611
  queuePostFlushCb(() => {
609
612
  hmrDirtyComponents.clear();
613
+ hmrDirtyComponentsMode.clear();
610
614
  });
611
615
  }
612
616
  function updateComponentDef(oldComp, newComp) {
@@ -1237,7 +1241,7 @@ const BaseTransitionPropsValidators = {
1237
1241
  onAppearCancelled: TransitionHookValidator
1238
1242
  };
1239
1243
  const recursiveGetSubtree = (instance) => {
1240
- const subTree = instance.type.__vapor ? instance.block : instance.subTree;
1244
+ const subTree = isVaporComponent(instance.type) ? instance.block : instance.subTree;
1241
1245
  return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
1242
1246
  };
1243
1247
  const BaseTransitionImpl = {
@@ -1544,7 +1548,7 @@ function getInnerChild$1(vnode) {
1544
1548
  }
1545
1549
  function setTransitionHooks(vnode, hooks) {
1546
1550
  if (vnode.shapeFlag & 6 && vnode.component) {
1547
- if (vnode.type.__vapor) {
1551
+ if (isVaporComponent(vnode.type)) {
1548
1552
  getVaporInterface(vnode.component, vnode).setTransitionHooks(
1549
1553
  vnode.component,
1550
1554
  hooks
@@ -5630,7 +5634,13 @@ function baseCreateRenderer(options, createHydrationFns) {
5630
5634
  );
5631
5635
  break;
5632
5636
  case VaporSlot:
5633
- getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor);
5637
+ getVaporInterface(parentComponent, n2).slot(
5638
+ n1,
5639
+ n2,
5640
+ container,
5641
+ anchor,
5642
+ parentComponent
5643
+ );
5634
5644
  break;
5635
5645
  default:
5636
5646
  if (shapeFlag & 1) {
@@ -6811,7 +6821,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6811
6821
  const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
6812
6822
  const { el, type, transition, children, shapeFlag } = vnode;
6813
6823
  if (shapeFlag & 6) {
6814
- if (type.__vapor) {
6824
+ if (isVaporComponent(type)) {
6815
6825
  getVaporInterface(parentComponent, vnode).move(vnode, container, anchor);
6816
6826
  } else {
6817
6827
  move(
@@ -6921,7 +6931,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6921
6931
  parentComponent.renderCache[cacheIndex] = void 0;
6922
6932
  }
6923
6933
  if (shapeFlag & 256) {
6924
- if (vnode.type.__vapor) {
6934
+ if (isVaporComponent(vnode.type)) {
6925
6935
  getVaporInterface(parentComponent, vnode).deactivate(
6926
6936
  vnode,
6927
6937
  parentComponent.ctx.getStorageContainer()
@@ -6938,7 +6948,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6938
6948
  invokeVNodeHook(vnodeHook, parentComponent, vnode);
6939
6949
  }
6940
6950
  if (shapeFlag & 6) {
6941
- if (type.__vapor) {
6951
+ if (isVaporComponent(type)) {
6942
6952
  getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
6943
6953
  return;
6944
6954
  } else {
@@ -7070,7 +7080,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7070
7080
  };
7071
7081
  const getNextHostNode = (vnode) => {
7072
7082
  if (vnode.shapeFlag & 6) {
7073
- if (vnode.type.__vapor) {
7083
+ if (isVaporComponent(vnode.type)) {
7074
7084
  return hostNextSibling(vnode.anchor);
7075
7085
  }
7076
7086
  return getNextHostNode(vnode.component.subTree);
@@ -7260,6 +7270,12 @@ app.use(vaporInteropPlugin)
7260
7270
  }
7261
7271
  return res;
7262
7272
  }
7273
+ function isVaporComponent(type) {
7274
+ if (isHmrUpdating && hmrDirtyComponentsMode.has(type)) {
7275
+ return hmrDirtyComponentsMode.get(type);
7276
+ }
7277
+ return type.__vapor;
7278
+ }
7263
7279
  function getInheritedScopeIds(vnode, parentComponent) {
7264
7280
  const inheritedScopeIds = [];
7265
7281
  let currentParent = parentComponent;
@@ -8928,7 +8944,7 @@ function isMemoSame(cached, memo) {
8928
8944
  return true;
8929
8945
  }
8930
8946
 
8931
- const version = "3.6.0-alpha.6";
8947
+ const version = "3.6.0-alpha.7";
8932
8948
  const warn = warn$1 ;
8933
8949
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
8934
8950
  const devtools = devtools$1 ;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-core v3.6.0-alpha.6
2
+ * @vue/runtime-core v3.6.0-alpha.7
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -905,7 +905,7 @@ const BaseTransitionPropsValidators = {
905
905
  onAppearCancelled: TransitionHookValidator
906
906
  };
907
907
  const recursiveGetSubtree = (instance) => {
908
- const subTree = instance.type.__vapor ? instance.block : instance.subTree;
908
+ const subTree = isVaporComponent(instance.type) ? instance.block : instance.subTree;
909
909
  return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
910
910
  };
911
911
  const BaseTransitionImpl = {
@@ -1204,7 +1204,7 @@ function getInnerChild$1(vnode) {
1204
1204
  }
1205
1205
  function setTransitionHooks(vnode, hooks) {
1206
1206
  if (vnode.shapeFlag & 6 && vnode.component) {
1207
- if (vnode.type.__vapor) {
1207
+ if (isVaporComponent(vnode.type)) {
1208
1208
  getVaporInterface(vnode.component, vnode).setTransitionHooks(
1209
1209
  vnode.component,
1210
1210
  hooks
@@ -4362,7 +4362,13 @@ function baseCreateRenderer(options, createHydrationFns) {
4362
4362
  );
4363
4363
  break;
4364
4364
  case VaporSlot:
4365
- getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor);
4365
+ getVaporInterface(parentComponent, n2).slot(
4366
+ n1,
4367
+ n2,
4368
+ container,
4369
+ anchor,
4370
+ parentComponent
4371
+ );
4366
4372
  break;
4367
4373
  default:
4368
4374
  if (shapeFlag & 1) {
@@ -5425,7 +5431,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5425
5431
  const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
5426
5432
  const { el, type, transition, children, shapeFlag } = vnode;
5427
5433
  if (shapeFlag & 6) {
5428
- if (type.__vapor) {
5434
+ if (isVaporComponent(type)) {
5429
5435
  getVaporInterface(parentComponent, vnode).move(vnode, container, anchor);
5430
5436
  } else {
5431
5437
  move(
@@ -5535,7 +5541,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5535
5541
  parentComponent.renderCache[cacheIndex] = void 0;
5536
5542
  }
5537
5543
  if (shapeFlag & 256) {
5538
- if (vnode.type.__vapor) {
5544
+ if (isVaporComponent(vnode.type)) {
5539
5545
  getVaporInterface(parentComponent, vnode).deactivate(
5540
5546
  vnode,
5541
5547
  parentComponent.ctx.getStorageContainer()
@@ -5552,7 +5558,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5552
5558
  invokeVNodeHook(vnodeHook, parentComponent, vnode);
5553
5559
  }
5554
5560
  if (shapeFlag & 6) {
5555
- if (type.__vapor) {
5561
+ if (isVaporComponent(type)) {
5556
5562
  getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
5557
5563
  return;
5558
5564
  } else {
@@ -5670,7 +5676,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5670
5676
  };
5671
5677
  const getNextHostNode = (vnode) => {
5672
5678
  if (vnode.shapeFlag & 6) {
5673
- if (vnode.type.__vapor) {
5679
+ if (isVaporComponent(vnode.type)) {
5674
5680
  return hostNextSibling(vnode.anchor);
5675
5681
  }
5676
5682
  return getNextHostNode(vnode.component.subTree);
@@ -5841,6 +5847,9 @@ function getVaporInterface(instance, vnode) {
5841
5847
  const res = ctx && ctx.vapor;
5842
5848
  return res;
5843
5849
  }
5850
+ function isVaporComponent(type) {
5851
+ return type.__vapor;
5852
+ }
5844
5853
  function getInheritedScopeIds(vnode, parentComponent) {
5845
5854
  const inheritedScopeIds = [];
5846
5855
  let currentParent = parentComponent;
@@ -7149,7 +7158,7 @@ function isMemoSame(cached, memo) {
7149
7158
  return true;
7150
7159
  }
7151
7160
 
7152
- const version = "3.6.0-alpha.6";
7161
+ const version = "3.6.0-alpha.7";
7153
7162
  const warn$1 = shared.NOOP;
7154
7163
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
7155
7164
  const devtools = void 0;
@@ -383,7 +383,7 @@ export type EmitsToProps<T extends EmitsOptions | ComponentTypeEmits> = T extend
383
383
  } : T extends ObjectEmitsOptions ? {
384
384
  [K in string & keyof T as `on${Capitalize<K>}`]?: (...args: T[K] extends (...args: infer P) => any ? P : T[K] extends null ? any[] : never) => any;
385
385
  } : {};
386
- type TypeEmitsToOptions<T extends ComponentTypeEmits> = {
386
+ export type TypeEmitsToOptions<T extends ComponentTypeEmits> = {
387
387
  [K in keyof T & string]: T[K] extends [...args: infer Args] ? (...args: Args) => any : () => any;
388
388
  } & (T extends (...args: any[]) => any ? ParametersToFns<OverloadParameters<T>> : {});
389
389
  type ParametersToFns<T extends any[]> = {
@@ -479,7 +479,7 @@ type ComponentPublicInstanceConstructor<T extends ComponentPublicInstance<Props,
479
479
  __isFragment?: never;
480
480
  __isTeleport?: never;
481
481
  __isSuspense?: never;
482
- new (...args: any[]): T;
482
+ new (props?: T['$props']): T;
483
483
  };
484
484
  /**
485
485
  * @deprecated This is no longer used internally, but exported and relied on by
@@ -558,7 +558,7 @@ declare const SuspenseImpl: {
558
558
  };
559
559
  export declare const Suspense: {
560
560
  __isSuspense: true;
561
- new (): {
561
+ new (props?: VNodeProps & SuspenseProps): {
562
562
  $props: VNodeProps & SuspenseProps;
563
563
  $slots: {
564
564
  default(): VNode[];
@@ -758,7 +758,7 @@ export interface KeepAliveContext extends ComponentRenderContext {
758
758
  }
759
759
  export declare const KeepAlive: {
760
760
  __isKeepAlive: true;
761
- new (): {
761
+ new (props?: VNodeProps & KeepAliveProps): {
762
762
  $props: VNodeProps & KeepAliveProps;
763
763
  $slots: {
764
764
  default(): VNode[];
@@ -1187,7 +1187,7 @@ declare function moveTeleport(vnode: VNode, container: RendererElement, parentAn
1187
1187
  declare function hydrateTeleport(node: Node, vnode: TeleportVNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean, { o: { nextSibling, parentNode, querySelector, insert, createText }, }: RendererInternals<Node, Element>, hydrateChildren: (node: Node | null, vnode: VNode, container: Element, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean) => Node | null): Node | null;
1188
1188
  export declare const Teleport: {
1189
1189
  __isTeleport: true;
1190
- new (): {
1190
+ new (props?: VNodeProps & TeleportProps): {
1191
1191
  $props: VNodeProps & TeleportProps;
1192
1192
  $slots: {
1193
1193
  default(): VNode[];
@@ -1376,7 +1376,7 @@ type Data = Record<string, unknown>;
1376
1376
  * ```
1377
1377
  */
1378
1378
  export type ComponentInstance<T> = T extends {
1379
- new (): ComponentPublicInstance;
1379
+ new (...args: any[]): ComponentPublicInstance;
1380
1380
  } ? InstanceType<T> : T extends FunctionalComponent<infer Props, infer Emits> ? ComponentPublicInstance<Props, {}, {}, {}, {}, ShortEmitsToObject<Emits>> : T extends Component<infer PropsOrInstance, infer RawBindings, infer D, infer C, infer M> ? PropsOrInstance extends {
1381
1381
  $props: unknown;
1382
1382
  } ? PropsOrInstance : ComponentPublicInstance<unknown extends PropsOrInstance ? {} : PropsOrInstance, unknown extends RawBindings ? {} : RawBindings, unknown extends D ? {} : D, C, M> : never;
@@ -1644,7 +1644,7 @@ interface Constructor<P = any> {
1644
1644
  __isFragment?: never;
1645
1645
  __isTeleport?: never;
1646
1646
  __isSuspense?: never;
1647
- new (...args: any[]): {
1647
+ new (props?: P): {
1648
1648
  $props: P;
1649
1649
  };
1650
1650
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-core v3.6.0-alpha.6
2
+ * @vue/runtime-core v3.6.0-alpha.7
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -485,6 +485,7 @@ function checkRecursiveUpdates(seen, fn) {
485
485
 
486
486
  let isHmrUpdating = false;
487
487
  const hmrDirtyComponents = /* @__PURE__ */ new Map();
488
+ const hmrDirtyComponentsMode = /* @__PURE__ */ new Map();
488
489
  if (!!(process.env.NODE_ENV !== "production")) {
489
490
  getGlobalThis().__VUE_HMR_RUNTIME__ = {
490
491
  createRecord: tryWrap(createRecord),
@@ -548,9 +549,10 @@ function reload(id, newComp) {
548
549
  const record = map.get(id);
549
550
  if (!record) return;
550
551
  newComp = normalizeClassComponent(newComp);
552
+ const isVapor = record.initialDef.__vapor;
551
553
  updateComponentDef(record.initialDef, newComp);
552
554
  const instances = [...record.instances];
553
- if (newComp.__vapor && !instances.some((i) => i.ceReload)) {
555
+ if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
554
556
  for (const instance of instances) {
555
557
  if (instance.root && instance.root.ce && instance !== instance.root) {
556
558
  instance.root.ce._removeChildStyle(instance.type);
@@ -570,6 +572,7 @@ function reload(id, newComp) {
570
572
  hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
571
573
  }
572
574
  dirtyInstances.add(instance);
575
+ hmrDirtyComponentsMode.set(oldComp, !!isVapor);
573
576
  instance.appContext.propsCache.delete(instance.type);
574
577
  instance.appContext.emitsCache.delete(instance.type);
575
578
  instance.appContext.optionsCache.delete(instance.type);
@@ -610,6 +613,7 @@ function reload(id, newComp) {
610
613
  }
611
614
  queuePostFlushCb(() => {
612
615
  hmrDirtyComponents.clear();
616
+ hmrDirtyComponentsMode.clear();
613
617
  });
614
618
  }
615
619
  function updateComponentDef(oldComp, newComp) {
@@ -1240,7 +1244,7 @@ const BaseTransitionPropsValidators = {
1240
1244
  onAppearCancelled: TransitionHookValidator
1241
1245
  };
1242
1246
  const recursiveGetSubtree = (instance) => {
1243
- const subTree = instance.type.__vapor ? instance.block : instance.subTree;
1247
+ const subTree = isVaporComponent(instance.type) ? instance.block : instance.subTree;
1244
1248
  return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
1245
1249
  };
1246
1250
  const BaseTransitionImpl = {
@@ -1548,7 +1552,7 @@ function getInnerChild$1(vnode) {
1548
1552
  }
1549
1553
  function setTransitionHooks(vnode, hooks) {
1550
1554
  if (vnode.shapeFlag & 6 && vnode.component) {
1551
- if (vnode.type.__vapor) {
1555
+ if (isVaporComponent(vnode.type)) {
1552
1556
  getVaporInterface(vnode.component, vnode).setTransitionHooks(
1553
1557
  vnode.component,
1554
1558
  hooks
@@ -5702,7 +5706,13 @@ function baseCreateRenderer(options, createHydrationFns) {
5702
5706
  );
5703
5707
  break;
5704
5708
  case VaporSlot:
5705
- getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor);
5709
+ getVaporInterface(parentComponent, n2).slot(
5710
+ n1,
5711
+ n2,
5712
+ container,
5713
+ anchor,
5714
+ parentComponent
5715
+ );
5706
5716
  break;
5707
5717
  default:
5708
5718
  if (shapeFlag & 1) {
@@ -6894,7 +6904,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6894
6904
  const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
6895
6905
  const { el, type, transition, children, shapeFlag } = vnode;
6896
6906
  if (shapeFlag & 6) {
6897
- if (type.__vapor) {
6907
+ if (isVaporComponent(type)) {
6898
6908
  getVaporInterface(parentComponent, vnode).move(vnode, container, anchor);
6899
6909
  } else {
6900
6910
  move(
@@ -7004,7 +7014,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7004
7014
  parentComponent.renderCache[cacheIndex] = void 0;
7005
7015
  }
7006
7016
  if (shapeFlag & 256) {
7007
- if (vnode.type.__vapor) {
7017
+ if (isVaporComponent(vnode.type)) {
7008
7018
  getVaporInterface(parentComponent, vnode).deactivate(
7009
7019
  vnode,
7010
7020
  parentComponent.ctx.getStorageContainer()
@@ -7021,7 +7031,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7021
7031
  invokeVNodeHook(vnodeHook, parentComponent, vnode);
7022
7032
  }
7023
7033
  if (shapeFlag & 6) {
7024
- if (type.__vapor) {
7034
+ if (isVaporComponent(type)) {
7025
7035
  getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
7026
7036
  return;
7027
7037
  } else {
@@ -7153,7 +7163,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7153
7163
  };
7154
7164
  const getNextHostNode = (vnode) => {
7155
7165
  if (vnode.shapeFlag & 6) {
7156
- if (vnode.type.__vapor) {
7166
+ if (isVaporComponent(vnode.type)) {
7157
7167
  return hostNextSibling(vnode.anchor);
7158
7168
  }
7159
7169
  return getNextHostNode(vnode.component.subTree);
@@ -7343,6 +7353,12 @@ app.use(vaporInteropPlugin)
7343
7353
  }
7344
7354
  return res;
7345
7355
  }
7356
+ function isVaporComponent(type) {
7357
+ if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating && hmrDirtyComponentsMode.has(type)) {
7358
+ return hmrDirtyComponentsMode.get(type);
7359
+ }
7360
+ return type.__vapor;
7361
+ }
7346
7362
  function getInheritedScopeIds(vnode, parentComponent) {
7347
7363
  const inheritedScopeIds = [];
7348
7364
  let currentParent = parentComponent;
@@ -9028,7 +9044,7 @@ function isMemoSame(cached, memo) {
9028
9044
  return true;
9029
9045
  }
9030
9046
 
9031
- const version = "3.6.0-alpha.6";
9047
+ const version = "3.6.0-alpha.7";
9032
9048
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
9033
9049
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9034
9050
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/runtime-core",
3
- "version": "3.6.0-alpha.6",
3
+ "version": "3.6.0-alpha.7",
4
4
  "description": "@vue/runtime-core",
5
5
  "main": "index.js",
6
6
  "module": "dist/runtime-core.esm-bundler.js",
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
48
48
  "dependencies": {
49
- "@vue/shared": "3.6.0-alpha.6",
50
- "@vue/reactivity": "3.6.0-alpha.6"
49
+ "@vue/reactivity": "3.6.0-alpha.7",
50
+ "@vue/shared": "3.6.0-alpha.7"
51
51
  }
52
52
  }