Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

feat(runtime): a mini-game reports its boot through the host's indicator

esenginecebbb3c95496
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d12516bfe..6b0a99c95 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -41,6 +41,15 @@ published separately; it ships inside the editor.
### Added
+- **A mini-game says how far along its boot is, not just that it is loading.** The web
+ export got a start screen with a real progress bar; a mini-game could not have one,
+ because the display canvas is already the GL surface and nothing can be drawn over it.
+ It now reports through the host's own loading indicator instead — *Starting the
+ engine 54%* — driven by the same eight weighted stages the web overlay uses, from one
+ list, so the two cannot disagree about how far along the same boot is. A host without
+ that API boots exactly as before: an indicator is something a boot shows, never
+ something it can fail on.
+
- **A project can be exported as a Douyin (抖音) mini-game.** Pick *Douyin* in Package
Project and the same content that makes a WeChat package makes a Douyin one, judged
against Douyin's own caps — 4MB for the main package and **20MB in total**, ten less
diff --git a/pipeline/src/export/splash.ts b/pipeline/src/export/splash.ts
index e83b524e8..f4d4958a9 100644
--- a/pipeline/src/export/splash.ts
+++ b/pipeline/src/export/splash.ts
@@ -9,26 +9,13 @@
* thing that knows which stage it reached. Those are two readers of one list, so
* the list lives here rather than being spelled once in each.
*
- * Weights, not stage count: the stages are nowhere near equal — the engine
- * binary and the first app are most of a cold start — and an even bar would sit
- * at 60% for as long as the whole rest of the boot takes.
+ * The stage list is the SDK's: a mini-game shows the same progress through a
+ * host API rather than an overlay, and two copies would disagree about how far
+ * along one boot is.
*/
+import { BOOT_STAGES, BOOT_TOTAL, type BootStage } from '../../../sdk/src/runtime/bootStages';
-/** A boot stage, in the order {@link boot} reaches them. */
-export const BOOT_STAGES = [
- { id: 'config', weight: 4, says: 'Reading the build' },
- { id: 'scripts', weight: 6, says: 'Loading scripts' },
- { id: 'manifest', weight: 4, says: 'Reading the asset list' },
- { id: 'scene', weight: 6, says: 'Loading the scene' },
- { id: 'engine', weight: 40, says: 'Starting the engine' },
- { id: 'app', weight: 22, says: 'Preparing the renderer' },
- { id: 'assets', weight: 13, says: 'Loading assets' },
- { id: 'ready', weight: 5, says: 'Ready' },
-] as const;
-
-export type BootStage = (typeof BOOT_STAGES)[number]['id'];
-
-const TOTAL = BOOT_STAGES.reduce((n, s) => n + s.weight, 0);
+export { BOOT_STAGES, type BootStage };
/** Ids the page and the runtime agree on; `es-` so a game's own markup cannot collide. */
const ROOT = 'es-splash';
@@ -98,7 +85,7 @@ export function attachSplash(doc: Document = document): Splash | null {
if (seen.has(stage)) return;
seen.add(stage);
done += BOOT_STAGES.find((s) => s.id === stage)?.weight ?? 0;
- if (bar) bar.style.width = `${Math.min(100, Math.round((done / TOTAL) * 100))}%`;
+ if (bar) bar.style.width = `${Math.min(100, Math.round((done / BOOT_TOTAL) * 100))}%`;
const at = BOOT_STAGES.findIndex((s) => s.id === stage);
const next = BOOT_STAGES[at + 1];
if (label && next) label.textContent = `${next.says}…`;
diff --git a/sdk/etc/index.api.md b/sdk/etc/index.api.md
index 5a883c2e5..009b53e0f 100644
--- a/sdk/etc/index.api.md
+++ b/sdk/etc/index.api.md
@@ -1,11 +1,11 @@
# API surface — esengine/index
<!-- Generated by tools/api-surface.mjs — do not edit. Run --update to accept changes. -->
-Symbols: 114 public · 96 beta · 1836 experimental · 3 deprecated
+Symbols: 114 public · 97 beta · 1836 experimental · 3 deprecated
## ABI_LAYOUT_HASH — const @experimental
```
-"10bb7593c5d041c3"
+"101981b3fea145cb"
```
## ANCHOR_AXES — const @experimental
@@ -8810,6 +8810,7 @@ speed: number
## SpriteData — interface @public
```
color: Color
+drawMode: SpriteDrawMode
enabled: boolean
flipX: boolean
flipY: boolean
@@ -8828,6 +8829,14 @@ uvOffset: Vec2
uvScale: Vec2
```
+## SpriteDrawMode — enum @beta
+```
+Auto = 0
+NineSlice = 3
+Simple = 1
+Tiled = 2
+```
+
## SpriteFilter — const @experimental
```
{ createOutline(options?: OutlineFilterOptions): MaterialHandle; createGlow(options?: OutlineFilterOptions): MaterialHandle; createDropShadow(options?: DropShadowFilterOptions): MaterialHandle; setOutlineColor(material: MaterialHandle, color: { r: number; g: number; b: number; a: number; }): void; setOutlineWidth(material: MaterialHandle, width: number): void; setShadowOffset(material: MaterialHandle, x: number, y: number): void; setShadowBlur(material: MaterialHandle, blur: number): void; }
diff --git a/sdk/etc/index.native.api.md b/sdk/etc/index.native.api.md
index 4f6186bb2..eda1cc42f 100644
--- a/sdk/etc/index.native.api.md
+++ b/sdk/etc/index.native.api.md
@@ -1,11 +1,11 @@
# API surface — esengine/index.native
<!-- Generated by tools/api-surface.mjs — do not edit. Run --update to accept changes. -->
-Symbols: 114 public · 101 beta · 1855 experimental · 3 deprecated
+Symbols: 114 public · 102 beta · 1855 experimental · 3 deprecated
## ABI_LAYOUT_HASH — const @experimental
```
-"10bb7593c5d041c3"
+"101981b3fea145cb"
```
## ANCHOR_AXES — const @experimental
@@ -9003,6 +9003,7 @@ speed: number
## SpriteData — interface @public
```
color: Color
+drawMode: SpriteDrawMode
enabled: boolean
flipX: boolean
flipY: boolean
@@ -9021,6 +9022,14 @@ uvOffset: Vec2
uvScale: Vec2
```
+## SpriteDrawMode — enum @beta
+```
+Auto = 0
+NineSlice = 3
+Simple = 1
+Tiled = 2
+```
+
## SpriteFilter — const @experimental
```
{ createOutline(options?: OutlineFilterOptions): MaterialHandle; createGlow(options?: OutlineFilterOptions): MaterialHandle; createDropShadow(options?: DropShadowFilterOptions): MaterialHandle; setOutlineColor(material: MaterialHandle, color: { r: number; g: number; b: number; a: number; }): void; setOutlineWidth(material: MaterialHandle, width: number): void; setShadowOffset(material: MaterialHandle, x: number, y: number): void; setShadowBlur(material: MaterialHandle, blur: number): void; }
diff --git a/sdk/etc/index.node.api.md b/sdk/etc/index.node.api.md
index 34c3bb651..e0f4d1a20 100644
--- a/sdk/etc/index.node.api.md
+++ b/sdk/etc/index.node.api.md
@@ -1,7 +1,7 @@
# API surface — esengine/index.node
<!-- Generated by tools/api-surface.mjs — do not edit. Run --update to accept changes. -->
-Symbols: 114 public · 98 beta · 1835 experimental · 3 deprecated
+Symbols: 114 public · 99 beta · 1835 experimental · 3 deprecated
## ANCHOR_AXES — const @experimental
```
@@ -8805,6 +8805,7 @@ speed: number
## SpriteData — interface @public
```
color: Color
+drawMode: SpriteDrawMode
enabled: boolean
flipX: boolean
flipY: boolean
@@ -8823,6 +8824,14 @@ uvOffset: Vec2
uvScale: Vec2
```
+## SpriteDrawMode — enum @beta
+```
+Auto = 0
+NineSlice = 3
+Simple = 1
+Tiled = 2
+```
+
## SpriteFilter — const @experimental
```
{ createOutline(options?: OutlineFilterOptions): MaterialHandle; createGlow(options?: OutlineFilterOptions): MaterialHandle; createDropShadow(options?: DropShadowFilterOptions): MaterialHandle; setOutlineColor(material: MaterialHandle, color: { r: number; g: number; b: number; a: number; }): void; setOutlineWidth(material: MaterialHandle, width: number): void; setShadowOffset(material: MaterialHandle, x: number, y: number): void; setShadowBlur(material: MaterialHandle, blur: number): void; }
diff --git a/sdk/etc/minigame.api.md b/sdk/etc/minigame.api.md
index 30e350b05..980fd283a 100644
--- a/sdk/etc/minigame.api.md
+++ b/sdk/etc/minigame.api.md
@@ -1,7 +1,7 @@
# API surface — esengine/minigame
<!-- Generated by tools/api-surface.mjs — do not edit. Run --update to accept changes. -->
-Symbols: 114 public · 96 beta · 1857 experimental · 3 deprecated
+Symbols: 114 public · 97 beta · 1857 experimental · 3 deprecated
## ANCHOR_AXES — const @experimental
```
@@ -5475,6 +5475,7 @@ getOpenDataContext: (() => MiniGameOpenDataContext) | undefined
getStorageInfoSync: () => MiniGameStorageInfo
getStorageSync: (key: string) => unknown
getSystemInfoSync: () => MiniGameSystemInfo
+hideLoading: (() => void) | undefined
loadSubpackage: ((opts: { name: string; success?: () => void; fail?: (err: unknown) => void; complete?: () => void; }) => void) | undefined
login: ((opts: { success?: (res: { code: string; }) => void; fail?: (err: unknown) => void; timeout?: number; }) => void) | undefined
offError: ((cb: (error: string | { message?: string; stack?: string; }) => void) => void) | undefined
@@ -5505,6 +5506,7 @@ requestMidasPayment: ((opts: { mode: string; offerId: string; buyQuantity: numbe
setStorageSync: (key: string, value: string) => void
setUserCloudStorage: ((opts: { KVDataList: MiniGameKVData[]; success?: () => void; fail?: (err: unknown) => void; complete?: () => void; }) => void) | undefined
shareAppMessage: ((opts: MiniGameShareOptions) => void) | undefined
+showLoading: ((opts: { title: string; mask?: boolean; }) => void) | undefined
```
## MiniGameImage — interface @experimental
@@ -5542,6 +5544,7 @@ code: string
## MiniGamePlatformAdapter — class @experimental
```
+@internal host: MiniGameGlobal
bindInputEvents: (callbacks: InputEventCallbacks, _target?: unknown) => void
canPay: () => boolean
canSignIn: () => boolean
@@ -9053,6 +9056,7 @@ speed: number
## SpriteData — interface @public
```
color: Color
+drawMode: SpriteDrawMode
enabled: boolean
flipX: boolean
flipY: boolean
@@ -9071,6 +9075,14 @@ uvOffset: Vec2
uvScale: Vec2
```
+## SpriteDrawMode — enum @beta
+```
+Auto = 0
+NineSlice = 3
+Simple = 1
+Tiled = 2
+```
+
## SpriteFilter — const @experimental
```
{ createOutline(options?: OutlineFilterOptions): MaterialHandle; createGlow(options?: OutlineFilterOptions): MaterialHandle; createDropShadow(options?: DropShadowFilterOptions): MaterialHandle; setOutlineColor(material: MaterialHandle, color: { r: number; g: number; b: number; a: number; }): void; setOutlineWidth(material: MaterialHandle, width: number): void; setShadowOffset(material: MaterialHandle, x: number, y: number): void; setShadowBlur(material: MaterialHandle, blur: number): void; }
diff --git a/sdk/etc/wechat.api.md b/sdk/etc/wechat.api.md
index 7e3a00db6..4e89c5165 100644
--- a/sdk/etc/wechat.api.md
+++ b/sdk/etc/wechat.api.md
@@ -1,7 +1,7 @@
# API surface — esengine/wechat
<!-- Generated by tools/api-surface.mjs — do not edit. Run --update to accept changes. -->
-Symbols: 114 public · 96 beta · 1847 experimental · 3 deprecated
+Symbols: 114 public · 97 beta · 1847 experimental · 3 deprecated
## ANCHOR_AXES — const @experimental
```
@@ -8812,6 +8812,7 @@ speed: number
## SpriteData — interface @public
```
color: Color
+drawMode: SpriteDrawMode
enabled: boolean
flipX: boolean
flipY: boolean
@@ -8830,6 +8831,14 @@ uvOffset: Vec2
uvScale: Vec2
```
+## SpriteDrawMode — enum @beta
+```
+Auto = 0
+NineSlice = 3
+Simple = 1
+Tiled = 2
+```
+
## SpriteFilter — const @experimental
```
{ createOutline(options?: OutlineFilterOptions): MaterialHandle; createGlow(options?: OutlineFilterOptions): MaterialHandle; createDropShadow(options?: DropShadowFilterOptions): MaterialHandle; setOutlineColor(material: MaterialHandle, color: { r: number; g: number; b: number; a: number; }): void; setOutlineWidth(material: MaterialHandle, width: number): void; setShadowOffset(material: MaterialHandle, x: number, y: number): void; setShadowBlur(material: MaterialHandle, blur: number): void; }
diff --git a/sdk/src/core-runtime.ts b/sdk/src/core-runtime.ts
index c1a87136c..cd383c5ce 100644
--- a/sdk/src/core-runtime.ts
+++ b/sdk/src/core-runtime.ts
@@ -94,6 +94,7 @@ export {
Light,
LightType,
SpriteMaskInteraction,
+ SpriteDrawMode,
ShadowCaster2D,
LightProbeVolume,
type LightProbeVolumeData,
diff --git a/sdk/src/ecs/component.ts b/sdk/src/ecs/component.ts
index ed9fbebc6..956170247 100644
--- a/sdk/src/ecs/component.ts
+++ b/sdk/src/ecs/component.ts
@@ -27,7 +27,7 @@ import type {
// C++ enum and the editor dropdowns derive from the same values. ScaleMode's
// canonical values come from CanvasScaleMode (only its Cocos-compat aliases
// ShowAll/NoBorder are TS-side).
-import { ProjectionType, ClearFlags, EmitterShape, SimulationSpace, SubEmitterTrigger, ForceFieldType, LightType, CanvasScaleMode, ShapeType, ParticleEasing, SpriteMaskInteraction } from '../wasm/wasm.generated';
+import { ProjectionType, ClearFlags, EmitterShape, SimulationSpace, SubEmitterTrigger, ForceFieldType, LightType, CanvasScaleMode, ShapeType, ParticleEasing, SpriteMaskInteraction, SpriteDrawMode } from '../wasm/wasm.generated';
import { BlendMode } from '../render/blend';
import { getDefaultContext } from './context';
import type {
@@ -781,7 +781,7 @@ export function ensureBuiltinComponentsRegistered(): void {
// EmitterShape, SimulationSpace, LightType and ShapeType are re-exported from the
// generated module; their values and the editor dropdowns built from them now have
// one source.
-export { ProjectionType, ClearFlags, EmitterShape, SimulationSpace, SubEmitterTrigger, ForceFieldType, LightType, ShapeType, SpriteMaskInteraction };
+export { ProjectionType, ClearFlags, EmitterShape, SimulationSpace, SubEmitterTrigger, ForceFieldType, LightType, ShapeType, SpriteMaskInteraction, SpriteDrawMode };
// Canonical values single-sourced from the C++ CanvasScaleMode enum (generated);
// ShowAll/NoBorder are Cocos-compat aliases with no C++ member.
diff --git a/sdk/src/platform/minigame/adapter.ts b/sdk/src/platform/minigame/adapter.ts
index 721febdb8..44d89cceb 100644
--- a/sdk/src/platform/minigame/adapter.ts
+++ b/sdk/src/platform/minigame/adapter.ts
@@ -62,6 +62,17 @@ export class MiniGamePlatformAdapter implements PlatformAdapter {
this.name = profile.id;
}
+ /**
+ * The host global, for the few capabilities only a mini-game has — the
+ * loading indicator a boot reports through, which exists because the display
+ * canvas is the GL surface and nothing 2D can be drawn over it.
+ *
+ * @internal Read-only: the adapter stays the one caller of what it abstracts.
+ */
+ get host(): MiniGameGlobal {
+ return this.g_;
+ }
+
private fs(): MiniGameFileSystemManager {
if (!this.fs_) this.fs_ = this.g_.getFileSystemManager();
return this.fs_;
diff --git a/sdk/src/platform/minigame/api.ts b/sdk/src/platform/minigame/api.ts
index 6c1fb2a7d..3079362a3 100644
--- a/sdk/src/platform/minigame/api.ts
+++ b/sdk/src/platform/minigame/api.ts
@@ -228,6 +228,12 @@ export interface MiniGameGlobal {
offKeyDown?(cb: (res: MiniGameKeyEvent) => void): void;
offKeyUp?(cb: (res: MiniGameKeyEvent) => void): void;
+ // Optional: the host's own loading indicator. WeChat and Douyin both have it,
+ // and it is the only progress surface a mini-game has — the display canvas is
+ // already the GL surface, so a 2D overlay cannot be drawn on it.
+ showLoading?(opts: { title: string; mask?: boolean }): void;
+ hideLoading?(): void;
+
loadSubpackage?(opts: {
name: string;
success?: () => void;
diff --git a/sdk/src/runtime/bootStages.ts b/sdk/src/runtime/bootStages.ts
new file mode 100644
index 000000000..52a304329
--- /dev/null
+++ b/sdk/src/runtime/bootStages.ts
@@ -0,0 +1,44 @@
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
+/**
+ * @file bootStages.ts — the stages a packaged game boots through, once.
+ *
+ * Two very different screens read this list: a web page's start overlay, drawn
+ * in HTML before any script runs, and a mini-game's host loading indicator,
+ * which is an API call because the display canvas is already the GL surface.
+ * They agree about the weights or they disagree about how far along the same
+ * boot is.
+ *
+ * Weights, not stage count: the engine binary and the first app are most of a
+ * cold start, and an even bar sits at 60% for as long as the rest takes.
+ */
+
+/** A boot stage, in the order a host reaches them. */
+export const BOOT_STAGES = [
+ { id: 'config', weight: 4, says: 'Reading the build' },
+ { id: 'scripts', weight: 6, says: 'Loading scripts' },
+ { id: 'manifest', weight: 4, says: 'Reading the asset list' },
+ { id: 'scene', weight: 6, says: 'Loading the scene' },
+ { id: 'engine', weight: 40, says: 'Starting the engine' },
+ { id: 'app', weight: 22, says: 'Preparing the renderer' },
+ { id: 'assets', weight: 13, says: 'Loading assets' },
+ { id: 'ready', weight: 5, says: 'Ready' },
+] as const;
+
+export type BootStage = (typeof BOOT_STAGES)[number]['id'];
+
+/** Total weight, so a caller turns "stages finished" into a percentage. */
+export const BOOT_TOTAL = BOOT_STAGES.reduce((n, s) => n + s.weight, 0);
+
+/** How far along a boot is, having finished `done`, as a whole percent. */
+export function bootPercent(done: readonly BootStage[]): number {
+ const seen = new Set(done);
+ const sum = BOOT_STAGES.filter((s) => seen.has(s.id)).reduce((n, s) => n + s.weight, 0);
+ return Math.min(100, Math.round((sum / BOOT_TOTAL) * 100));
+}
+
+/** What the host should say it is doing, having finished `done`. */
+export function bootSays(done: readonly BootStage[]): string {
+ const seen = new Set(done);
+ return (BOOT_STAGES.find((s) => !seen.has(s.id)) ?? BOOT_STAGES[BOOT_STAGES.length - 1]).says;
+}
diff --git a/sdk/src/runtime/miniGameRuntime.ts b/sdk/src/runtime/miniGameRuntime.ts
index bea23b21f..78a0c01d7 100644
--- a/sdk/src/runtime/miniGameRuntime.ts
+++ b/sdk/src/runtime/miniGameRuntime.ts
@@ -15,6 +15,7 @@
*/
import { createWebApp } from './webAppFactory';
+import { bootPercent, bootSays, type BootStage } from './bootStages';
import type { ESEngineModule } from '../wasm';
import type { AudioProjectConfig } from '../audio/AudioProjectConfig';
import { initRuntime } from './runtimeLoader';
@@ -127,6 +128,32 @@ export interface MiniGameRuntimeConfig {
aot?: { module: string; manifest: AotManifest };
}
+/**
+ * The host's loading indicator, driven by the same stage list the web start
+ * screen reads. It is the only progress surface a mini-game has: the display
+ * canvas is the GL surface, so nothing 2D can be drawn over it. Every call is
+ * optional — an indicator is something a boot SHOWS, never something it fails on.
+ */
+function hostProgress(global: { showLoading?: (o: { title: string; mask?: boolean }) => void; hideLoading?: () => void }) {
+ const done: BootStage[] = [];
+ const say = (): void => {
+ try {
+ global.showLoading?.({ title: `${bootSays(done)} ${bootPercent(done)}%`, mask: true });
+ } catch { /* an indicator must not take the boot down with it */ }
+ };
+ say();
+ return {
+ reach(stage: BootStage): void {
+ if (done.includes(stage)) return;
+ done.push(stage);
+ say();
+ },
+ finish(): void {
+ try { global.hideLoading?.(); } catch { /* as above */ }
+ },
+ };
+}
+
export async function initMiniGameRuntime(config: MiniGameRuntimeConfig): Promise<void> {
// Before the app exists, so a plugin that acquires during build finds them.
registerPackagedSideModules({ sideModules: config.sideModules });
@@ -139,16 +166,21 @@ export async function initMiniGameRuntime(config: MiniGameRuntimeConfig): Promis
);
}
const tag = adapter.name;
+ const progress = hostProgress(adapter.host);
+ progress.reach('config');
+ progress.reach('scripts');
// The packaged-realm asset assembly, shared with the native runtime: read the
// addressable manifest off the device, index it, build the catalog.
const index = await loadPackagedAssetIndex();
const { model: manifestModel, catalog } = index;
+ progress.reach('manifest');
// The FIRST canvas of the process is the display surface on every vendor.
const canvas = adapter.createScreenCanvas();
const module = await instantiateModule(config.engineFactory, config.engineWasmPath, tag, { canvas });
+ progress.reach('engine');
const gl = (canvas.getContext('webgl2') || canvas.getContext('webgl')) as WebGLRenderingContext | null;
if (!gl) {
@@ -206,6 +238,7 @@ export async function initMiniGameRuntime(config: MiniGameRuntimeConfig): Promis
// group loads directly), and it survives scene switches. Setting it on the
// pre-initRuntime Assets resource was a bug: the runtime instance replaced
// that resource, so loadGroup lost the manifest after the first scene load.
+ progress.reach('assets');
await initRuntime({
app,
module,
@@ -223,5 +256,8 @@ export async function initMiniGameRuntime(config: MiniGameRuntimeConfig): Promis
...(config.aot ? { aot: config.aot } : {}),
});
+ progress.reach('ready');
+ // Before run(), which may hand control to the engine's loop and not return.
+ progress.finish();
app.run();
}
diff --git a/sdk/tests/boot-stages.test.ts b/sdk/tests/boot-stages.test.ts
new file mode 100644
index 000000000..b409177e7
--- /dev/null
+++ b/sdk/tests/boot-stages.test.ts
@@ -0,0 +1,47 @@
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
+
+// Two screens read this list — a web page's overlay and a mini-game's host
+// indicator — and they are only comparable while both read the same one.
+import { describe, it, expect } from 'vitest';
+import { BOOT_STAGES, BOOT_TOTAL, bootPercent, bootSays, type BootStage } from '../src/runtime/bootStages';
+
+const ids = BOOT_STAGES.map((s) => s.id) as BootStage[];
+
+describe('the boot a package reports', () => {
+ it('starts at nothing and ends at everything', () => {
+ expect(bootPercent([])).toBe(0);
+ expect(bootPercent(ids)).toBe(100);
+ });
+
+ it('never goes backwards as stages finish', () => {
+ let last = -1;
+ for (let i = 0; i <= ids.length; i++) {
+ const pct = bootPercent(ids.slice(0, i));
+ expect(pct).toBeGreaterThanOrEqual(last);
+ last = pct;
+ }
+ });
+
+ it('is weighted, so the engine is not one stage out of eight', () => {
+ // The reason this list carries weights at all: an even bar sits still
+ // through the longest leg of a cold start.
+ const engine = BOOT_STAGES.find((s) => s.id === 'engine');
+ expect(engine!.weight / BOOT_TOTAL).toBeGreaterThan(1 / BOOT_STAGES.length);
+ });
+
+ it('says what it is about to do, not what it just did', () => {
+ expect(bootSays([])).toBe(BOOT_STAGES[0].says);
+ expect(bootSays(['config'])).toBe(BOOT_STAGES[1].says);
+ });
+
+ it('says the last stage once everything is done, rather than nothing', () => {
+ // A host that finished has an indicator up for one more moment; blank
+ // there reads as a boot that lost track of itself.
+ expect(bootSays(ids)).toBe(BOOT_STAGES[BOOT_STAGES.length - 1].says);
+ });
+
+ it('ignores a repeated stage, so a retried leg cannot overcount', () => {
+ expect(bootPercent(['config', 'config', 'config'])).toBe(bootPercent(['config']));
+ });
+});
diff --git a/tools/releaseNotes.mjs b/tools/releaseNotes.mjs
index 81ace0bfa..33f199532 100644
--- a/tools/releaseNotes.mjs
+++ b/tools/releaseNotes.mjs
@@ -28,6 +28,9 @@ export const NOTES_FLOOR = 'v0.65.0';
* the reader recognises anyway.
*/
export const NOTED = {
+ "feat(runtime): a mini-game reports its boot through the host's indicator":
+ { note: 'A mini-game says how far along its boot is, not just that it is loading.' },
+
'fix(gates): the notes ledger parses again':
{ internal: 'Repairs this very file after a quote broke it; no creator reads it.' },