@vue/runtime-core 3.6.0-beta.13 → 3.6.0-beta.14

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-beta.13
2
+ * @vue/runtime-core v3.6.0-beta.14
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -383,6 +383,7 @@ function flushJobs(seen) {
383
383
  }
384
384
  flushIndex = 0;
385
385
  jobsLength = 0;
386
+ jobs.length = 0;
386
387
  flushPostFlushCbs(seen);
387
388
  currentFlushPromise = null;
388
389
  if (jobsLength || postJobs.length) flushJobs(seen);
@@ -440,6 +441,14 @@ function createRecord(id, initialDef) {
440
441
  function normalizeClassComponent(component) {
441
442
  return isClassComponent(component) ? component.__vccOpts : component;
442
443
  }
444
+ function hasDirtyAncestor(instance, dirtyInstances) {
445
+ let parent = instance.parent;
446
+ while (parent) {
447
+ if (dirtyInstances.has(parent)) return true;
448
+ parent = parent.parent;
449
+ }
450
+ return false;
451
+ }
443
452
  function rerender(id, newRender) {
444
453
  const record = map.get(id);
445
454
  if (!record) return;
@@ -471,42 +480,69 @@ function reload(id, newComp) {
471
480
  const isVapor = record.initialDef.__vapor;
472
481
  updateComponentDef(record.initialDef, newComp);
473
482
  const instances = [...record.instances];
474
- if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
483
+ if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
475
484
  for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
476
- for (const instance of instances) instance.hmrReload(newComp);
477
- } else for (const instance of instances) {
478
- const oldComp = normalizeClassComponent(instance.type);
479
- let dirtyInstances = hmrDirtyComponents.get(oldComp);
480
- if (!dirtyInstances) {
481
- if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
482
- hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
483
- }
484
- dirtyInstances.add(instance);
485
- hmrDirtyComponentsMode.set(oldComp, !!isVapor);
486
- instance.appContext.propsCache.delete(instance.type);
487
- instance.appContext.emitsCache.delete(instance.type);
488
- instance.appContext.optionsCache.delete(instance.type);
489
- if (instance.ceReload) {
490
- dirtyInstances.add(instance);
491
- instance.ceReload(newComp.styles);
492
- dirtyInstances.delete(instance);
493
- } else if (instance.parent) queueJob(() => {
494
- isHmrUpdating = true;
485
+ const dirtyInstances = new Set(instances);
486
+ const rerenderedParents = /* @__PURE__ */ new Set();
487
+ for (const instance of instances) {
495
488
  const parent = instance.parent;
496
- if (parent.vapor) parent.hmrRerender();
497
- else if (!(parent.effect.flags & 1024)) {
498
- parent.renderCache = [];
499
- parent.effect.run();
489
+ if (parent) {
490
+ if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
491
+ rerenderedParents.add(parent);
492
+ parent.hmrRerender();
493
+ }
494
+ } else instance.hmrReload(newComp);
495
+ }
496
+ } else {
497
+ const parentUpdates = /* @__PURE__ */ new Map();
498
+ const dirtyInstanceSet = new Set(instances);
499
+ for (const instance of instances) {
500
+ const oldComp = normalizeClassComponent(instance.type);
501
+ let dirtyInstances = hmrDirtyComponents.get(oldComp);
502
+ if (!dirtyInstances) {
503
+ if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
504
+ hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
500
505
  }
501
- nextTick(() => {
502
- isHmrUpdating = false;
506
+ dirtyInstances.add(instance);
507
+ hmrDirtyComponentsMode.set(oldComp, !!isVapor);
508
+ instance.appContext.propsCache.delete(instance.type);
509
+ instance.appContext.emitsCache.delete(instance.type);
510
+ instance.appContext.optionsCache.delete(instance.type);
511
+ if (instance.ceReload) {
512
+ dirtyInstances.add(instance);
513
+ instance.ceReload(newComp.styles);
514
+ dirtyInstances.delete(instance);
515
+ } else if (instance.parent) {
516
+ const parent = instance.parent;
517
+ if (!hasDirtyAncestor(instance, dirtyInstanceSet)) {
518
+ let updates = parentUpdates.get(parent);
519
+ if (!updates) parentUpdates.set(parent, updates = []);
520
+ updates.push([instance, dirtyInstances]);
521
+ }
522
+ } else if (instance.appContext.reload) instance.appContext.reload();
523
+ else if (typeof window !== "undefined") window.location.reload();
524
+ else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
525
+ if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
526
+ }
527
+ parentUpdates.forEach((updates, parent) => {
528
+ queueJob(() => {
529
+ isHmrUpdating = true;
530
+ if (parent.vapor) parent.hmrRerender();
531
+ else {
532
+ const i = parent;
533
+ if (!(i.effect.flags & 1024)) {
534
+ i.renderCache = [];
535
+ i.effect.run();
536
+ }
537
+ }
538
+ nextTick(() => {
539
+ isHmrUpdating = false;
540
+ });
541
+ updates.forEach(([instance, dirtyInstances]) => {
542
+ dirtyInstances.delete(instance);
543
+ });
503
544
  });
504
- dirtyInstances.delete(instance);
505
545
  });
506
- else if (instance.appContext.reload) instance.appContext.reload();
507
- else if (typeof window !== "undefined") window.location.reload();
508
- else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
509
- if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
510
546
  }
511
547
  queuePostFlushCb(() => {
512
548
  hmrDirtyComponents.clear();
@@ -2480,6 +2516,7 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
2480
2516
  slot: vaporSlot,
2481
2517
  fallback
2482
2518
  };
2519
+ if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
2483
2520
  return ret;
2484
2521
  }
2485
2522
  if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
@@ -6195,7 +6232,7 @@ function isMemoSame(cached, memo) {
6195
6232
  }
6196
6233
  //#endregion
6197
6234
  //#region packages/runtime-core/src/index.ts
6198
- const version = "3.6.0-beta.13";
6235
+ const version = "3.6.0-beta.14";
6199
6236
  const warn = warn$1;
6200
6237
  /**
6201
6238
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-core v3.6.0-beta.13
2
+ * @vue/runtime-core v3.6.0-beta.14
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -273,6 +273,7 @@ function flushJobs(seen) {
273
273
  }
274
274
  flushIndex = 0;
275
275
  jobsLength = 0;
276
+ jobs.length = 0;
276
277
  flushPostFlushCbs(seen);
277
278
  currentFlushPromise = null;
278
279
  if (jobsLength || postJobs.length) flushJobs(seen);
@@ -1967,6 +1968,7 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
1967
1968
  slot: vaporSlot,
1968
1969
  fallback
1969
1970
  };
1971
+ if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
1970
1972
  return ret;
1971
1973
  }
1972
1974
  if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
@@ -4891,7 +4893,7 @@ function isMemoSame(cached, memo) {
4891
4893
  }
4892
4894
  //#endregion
4893
4895
  //#region packages/runtime-core/src/index.ts
4894
- const version = "3.6.0-beta.13";
4896
+ const version = "3.6.0-beta.14";
4895
4897
  const warn = _vue_shared.NOOP;
4896
4898
  /**
4897
4899
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-core v3.6.0-beta.13
2
+ * @vue/runtime-core v3.6.0-beta.14
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -389,6 +389,7 @@ function flushJobs(seen) {
389
389
  }
390
390
  flushIndex = 0;
391
391
  jobsLength = 0;
392
+ jobs.length = 0;
392
393
  flushPostFlushCbs(seen);
393
394
  currentFlushPromise = null;
394
395
  if (jobsLength || postJobs.length) flushJobs(seen);
@@ -446,6 +447,14 @@ function createRecord(id, initialDef) {
446
447
  function normalizeClassComponent(component) {
447
448
  return isClassComponent(component) ? component.__vccOpts : component;
448
449
  }
450
+ function hasDirtyAncestor(instance, dirtyInstances) {
451
+ let parent = instance.parent;
452
+ while (parent) {
453
+ if (dirtyInstances.has(parent)) return true;
454
+ parent = parent.parent;
455
+ }
456
+ return false;
457
+ }
449
458
  function rerender(id, newRender) {
450
459
  const record = map.get(id);
451
460
  if (!record) return;
@@ -477,42 +486,69 @@ function reload(id, newComp) {
477
486
  const isVapor = record.initialDef.__vapor;
478
487
  updateComponentDef(record.initialDef, newComp);
479
488
  const instances = [...record.instances];
480
- if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
489
+ if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
481
490
  for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
482
- for (const instance of instances) instance.hmrReload(newComp);
483
- } else for (const instance of instances) {
484
- const oldComp = normalizeClassComponent(instance.type);
485
- let dirtyInstances = hmrDirtyComponents.get(oldComp);
486
- if (!dirtyInstances) {
487
- if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
488
- hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
489
- }
490
- dirtyInstances.add(instance);
491
- hmrDirtyComponentsMode.set(oldComp, !!isVapor);
492
- instance.appContext.propsCache.delete(instance.type);
493
- instance.appContext.emitsCache.delete(instance.type);
494
- instance.appContext.optionsCache.delete(instance.type);
495
- if (instance.ceReload) {
496
- dirtyInstances.add(instance);
497
- instance.ceReload(newComp.styles);
498
- dirtyInstances.delete(instance);
499
- } else if (instance.parent) queueJob(() => {
500
- isHmrUpdating = true;
491
+ const dirtyInstances = new Set(instances);
492
+ const rerenderedParents = /* @__PURE__ */ new Set();
493
+ for (const instance of instances) {
501
494
  const parent = instance.parent;
502
- if (parent.vapor) parent.hmrRerender();
503
- else if (!(parent.effect.flags & 1024)) {
504
- parent.renderCache = [];
505
- parent.effect.run();
495
+ if (parent) {
496
+ if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
497
+ rerenderedParents.add(parent);
498
+ parent.hmrRerender();
499
+ }
500
+ } else instance.hmrReload(newComp);
501
+ }
502
+ } else {
503
+ const parentUpdates = /* @__PURE__ */ new Map();
504
+ const dirtyInstanceSet = new Set(instances);
505
+ for (const instance of instances) {
506
+ const oldComp = normalizeClassComponent(instance.type);
507
+ let dirtyInstances = hmrDirtyComponents.get(oldComp);
508
+ if (!dirtyInstances) {
509
+ if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
510
+ hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
506
511
  }
507
- nextTick(() => {
508
- isHmrUpdating = false;
512
+ dirtyInstances.add(instance);
513
+ hmrDirtyComponentsMode.set(oldComp, !!isVapor);
514
+ instance.appContext.propsCache.delete(instance.type);
515
+ instance.appContext.emitsCache.delete(instance.type);
516
+ instance.appContext.optionsCache.delete(instance.type);
517
+ if (instance.ceReload) {
518
+ dirtyInstances.add(instance);
519
+ instance.ceReload(newComp.styles);
520
+ dirtyInstances.delete(instance);
521
+ } else if (instance.parent) {
522
+ const parent = instance.parent;
523
+ if (!hasDirtyAncestor(instance, dirtyInstanceSet)) {
524
+ let updates = parentUpdates.get(parent);
525
+ if (!updates) parentUpdates.set(parent, updates = []);
526
+ updates.push([instance, dirtyInstances]);
527
+ }
528
+ } else if (instance.appContext.reload) instance.appContext.reload();
529
+ else if (typeof window !== "undefined") window.location.reload();
530
+ else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
531
+ if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
532
+ }
533
+ parentUpdates.forEach((updates, parent) => {
534
+ queueJob(() => {
535
+ isHmrUpdating = true;
536
+ if (parent.vapor) parent.hmrRerender();
537
+ else {
538
+ const i = parent;
539
+ if (!(i.effect.flags & 1024)) {
540
+ i.renderCache = [];
541
+ i.effect.run();
542
+ }
543
+ }
544
+ nextTick(() => {
545
+ isHmrUpdating = false;
546
+ });
547
+ updates.forEach(([instance, dirtyInstances]) => {
548
+ dirtyInstances.delete(instance);
549
+ });
509
550
  });
510
- dirtyInstances.delete(instance);
511
551
  });
512
- else if (instance.appContext.reload) instance.appContext.reload();
513
- else if (typeof window !== "undefined") window.location.reload();
514
- else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
515
- if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
516
552
  }
517
553
  queuePostFlushCb(() => {
518
554
  hmrDirtyComponents.clear();
@@ -2517,6 +2553,7 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
2517
2553
  slot: vaporSlot,
2518
2554
  fallback
2519
2555
  };
2556
+ if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
2520
2557
  return ret;
2521
2558
  }
2522
2559
  if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
@@ -6303,7 +6340,7 @@ function isMemoSame(cached, memo) {
6303
6340
  }
6304
6341
  //#endregion
6305
6342
  //#region packages/runtime-core/src/index.ts
6306
- const version = "3.6.0-beta.13";
6343
+ const version = "3.6.0-beta.14";
6307
6344
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
6308
6345
  /**
6309
6346
  * Runtime error messages. Only exposed in dev or esm builds.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/runtime-core",
3
- "version": "3.6.0-beta.13",
3
+ "version": "3.6.0-beta.14",
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-beta.13",
50
- "@vue/reactivity": "3.6.0-beta.13"
49
+ "@vue/shared": "3.6.0-beta.14",
50
+ "@vue/reactivity": "3.6.0-beta.14"
51
51
  }
52
52
  }