@vgai/engine 0.5.16 → 0.5.17
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.
- package/dist/adapter/adapter-module.d.ts +1 -16
- package/dist/adapter/adapter-module.d.ts.map +1 -1
- package/dist/adapter/adapter-module.js +1 -11
- package/dist/adapter/finders/scenes-from-entrypoint-selection.d.ts +0 -2
- package/dist/adapter/finders/scenes-from-entrypoint-selection.d.ts.map +1 -1
- package/dist/adapter/finders/scenes-from-entrypoint-selection.js +3 -6
- package/dist/adapter/root-adapter.d.ts +4 -0
- package/dist/adapter/root-adapter.d.ts.map +1 -1
- package/dist/adapter/root-seam-contract.d.ts +5 -0
- package/dist/adapter/root-seam-contract.d.ts.map +1 -1
- package/dist/adapter/root-seam-contract.js +1 -0
- package/dist/adapter/setup-three-root-adapter.js +9 -9
- package/dist/canvas-react/pixi-react-adapter.d.ts.map +1 -1
- package/dist/canvas-react/pixi-react-adapter.js +92 -41
- package/dist/data/curve.d.ts +1 -1
- package/dist/data/curve.js +2 -2
- package/dist/dev/instruments.d.ts +4 -4
- package/dist/dev/instruments.js +4 -4
- package/dist/dev/register-render-vitals.d.ts +2 -2
- package/dist/dev/register-render-vitals.js +2 -2
- package/dist/dev/static-batch-advisor.d.ts +1 -1
- package/dist/dev/static-batch-advisor.js +2 -2
- package/dist/input/input-manager.d.ts +15 -0
- package/dist/input/input-manager.d.ts.map +1 -1
- package/dist/input/input-manager.js +22 -0
- package/dist/manifest/load.d.ts +0 -3
- package/dist/manifest/load.d.ts.map +1 -1
- package/dist/manifest/load.js +0 -4
- package/dist/manifest/schema.d.ts +0 -2
- package/dist/manifest/schema.d.ts.map +1 -1
- package/dist/manifest/schema.js +2 -23
- package/dist/pixi/authoring.d.ts +33 -0
- package/dist/pixi/authoring.d.ts.map +1 -1
- package/dist/pixi/authoring.js +86 -6
- package/dist/react/world-state.d.ts +12 -0
- package/dist/react/world-state.d.ts.map +1 -1
- package/dist/react/world-state.js +14 -0
- package/dist/render/soft-particle-depth.d.ts +3 -3
- package/dist/render/soft-particle-depth.d.ts.map +1 -1
- package/dist/render/soft-particle-depth.js +8 -13
- package/dist/runtime/create-runtime.d.ts +2 -16
- package/dist/runtime/create-runtime.d.ts.map +1 -1
- package/dist/runtime/create-runtime.js +36 -38
- package/dist/runtime/dev-build.d.ts +37 -0
- package/dist/runtime/dev-build.d.ts.map +1 -0
- package/dist/runtime/dev-build.js +49 -0
- package/dist/runtime/game.d.ts +9 -1
- package/dist/runtime/game.d.ts.map +1 -1
- package/dist/runtime/game.js +25 -1
- package/dist/runtime/mount-manifest.d.ts +0 -13
- package/dist/runtime/mount-manifest.d.ts.map +1 -1
- package/dist/runtime/mount-manifest.js +1 -20
- package/dist/world3d-react/engine-bridge.d.ts.map +1 -1
- package/dist/world3d-react/engine-bridge.js +28 -3
- package/dist/world3d-react/index.d.ts +1 -1
- package/dist/world3d-react/index.js +1 -1
- package/dist/world3d-react/r3f-adapter.d.ts.map +1 -1
- package/dist/world3d-react/r3f-adapter.js +89 -14
- package/dist/world3d-react/r3f-root-factory.d.ts.map +1 -1
- package/dist/world3d-react/r3f-root-factory.js +12 -2
- package/dist/world3d-react/rapier-physics-bridge.d.ts +4 -4
- package/dist/world3d-react/rapier-physics-bridge.js +3 -3
- package/dist/world3d-react/world-context.d.ts +43 -0
- package/dist/world3d-react/world-context.d.ts.map +1 -1
- package/dist/world3d-react/world-context.js +89 -46
- package/dist-config/config.js.map +1 -1
- package/package.json +1 -1
- package/schemas/engine-capabilities.json +3 -3
- package/schemas/vgai-project.schema.json +1 -6
- package/src/adapter/adapter-module.ts +1 -25
- package/src/adapter/finders/scenes-from-entrypoint-selection.ts +3 -8
- package/src/adapter/root-adapter.ts +4 -0
- package/src/adapter/root-seam-contract.ts +1 -0
- package/src/adapter/setup-three-root-adapter.ts +9 -9
- package/src/canvas-react/pixi-react-adapter.tsx +98 -53
- package/src/data/curve.ts +2 -2
- package/src/dev/instruments.ts +4 -4
- package/src/dev/register-render-vitals.ts +2 -2
- package/src/dev/static-batch-advisor.ts +2 -2
- package/src/input/input-manager.ts +23 -0
- package/src/manifest/load.ts +0 -7
- package/src/manifest/schema.ts +2 -25
- package/src/pixi/authoring.ts +98 -6
- package/src/react/world-state.tsx +15 -0
- package/src/render/soft-particle-depth.ts +8 -13
- package/src/runtime/create-runtime.ts +38 -52
- package/src/runtime/dev-build.ts +49 -0
- package/src/runtime/game.ts +31 -2
- package/src/runtime/mount-manifest.ts +1 -32
- package/src/world3d-react/engine-bridge.ts +28 -3
- package/src/world3d-react/index.ts +1 -1
- package/src/world3d-react/r3f-adapter.tsx +87 -18
- package/src/world3d-react/r3f-root-factory.tsx +12 -2
- package/src/world3d-react/rapier-physics-bridge.tsx +4 -4
- package/src/world3d-react/world-context.ts +100 -51
- package/dist/runtime/dev-layers.d.ts +0 -34
- package/dist/runtime/dev-layers.d.ts.map +0 -1
- package/dist/runtime/dev-layers.js +0 -46
- package/src/runtime/dev-layers.ts +0 -46
|
@@ -88,18 +88,6 @@ export interface AdapterRegion {
|
|
|
88
88
|
readonly id: string;
|
|
89
89
|
/** What the host hands this root. */
|
|
90
90
|
readonly surface: AdapterSurface;
|
|
91
|
-
/**
|
|
92
|
-
* `true` = this region grades the game's own DEV LAYER (the manifest root's
|
|
93
|
-
* `dev: true`), not shipped game content.
|
|
94
|
-
*
|
|
95
|
-
* Carried here because a dev root occupies the same MEDIUM as the content
|
|
96
|
-
* root beside it — a dev GUI is a `dom` root next to the HUD's `dom` root —
|
|
97
|
-
* and anything that maps a subject to "the region on this surface" would
|
|
98
|
-
* otherwise be choosing between them by array order. A region consumer that
|
|
99
|
-
* means shipped content says so by skipping `dev` regions (the loader's
|
|
100
|
-
* `regionForSurface` does), rather than by guessing which one matched.
|
|
101
|
-
*/
|
|
102
|
-
readonly dev: boolean;
|
|
103
91
|
/** Projection library, by name. */
|
|
104
92
|
readonly projector: ProjectorName;
|
|
105
93
|
/**
|
|
@@ -264,9 +252,7 @@ export declare function regionsFromManifestRoots(roots: readonly ResolvedAdapter
|
|
|
264
252
|
export declare function unmatchedRegionIncludeIds(roots: readonly ResolvedAdapterRoot[], regionIncludes: Readonly<Record<string, AdapterRegionOverlay>>): string[];
|
|
265
253
|
/**
|
|
266
254
|
* The rule form of a finder's region targeting: every region the host mounts
|
|
267
|
-
* from an exported composition
|
|
268
|
-
* DEV layer. A dev root is the game's own dev GUI — the manifest already says
|
|
269
|
-
* so (`dev: true`), so skipping it reads a declaration rather than guessing.
|
|
255
|
+
* from an exported composition — a root with an `entry`.
|
|
270
256
|
*/
|
|
271
257
|
export declare const EXPORTED_COMPOSITION_REGIONS = "exported-composition-regions";
|
|
272
258
|
/**
|
|
@@ -511,7 +497,6 @@ export declare const AdapterDefinitionSchema: z.ZodObject<{
|
|
|
511
497
|
canvas: "canvas";
|
|
512
498
|
dom: "dom";
|
|
513
499
|
}>;
|
|
514
|
-
dev: z.ZodBoolean;
|
|
515
500
|
projector: z.ZodEnum<{
|
|
516
501
|
three: "three";
|
|
517
502
|
dom: "dom";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter-module.d.ts","sourceRoot":"","sources":["../../src/adapter/adapter-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAMvE;;;;;GAKG;AACH,eAAO,MAAM,eAAe,mCAAoC,CAAC;AACjE,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D;;;;;;;;;;GAUG;AACH,MAAM,WAAW,kBAAkB;I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AAM,SAAS,iBAAiB,KAAK,IAAI,SAA1D,OAAO,UAAU,MAAM,SAAS,iBAAiB,KAAK,IAAI;kCAExD,OAAO,KAAK,IAAI,SAAhB,OAAO,KAAK,IAAI;;kBA+EtC,CAAC;AAEJ;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,KAAK,GAAE,sBAA2B,GAAG,iBAAiB,CAgBnF;AAED,gFAAgF;AAChF,MAAM,WAAW,oBAAoB;IACnC,mFAAmF;IACnF,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IACxC;oDACgD;IAChD,QAAQ,CAAC,cAAc,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC,CAAC;CAC1E;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,OAAO,GAAE,oBAAyB,GAAG,iBAAiB,CAYnF;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,iBAAiB,CAQxE"}
|
|
@@ -84,10 +84,6 @@ const AdapterRegionSchema = z
|
|
|
84
84
|
.object({
|
|
85
85
|
id: z.string().min(1).describe('Manifest root id this region grades'),
|
|
86
86
|
surface: z.enum(['three', 'canvas', 'dom']).describe('Render surface the host hands this root'),
|
|
87
|
-
dev: z
|
|
88
|
-
.boolean()
|
|
89
|
-
.describe("true = this region grades the game's own dev layer, not shipped content (the " +
|
|
90
|
-
"manifest root's `dev: true`)"),
|
|
91
87
|
projector: z.enum(PROJECTOR_NAMES).describe('Projection library serving this surface, by name'),
|
|
92
88
|
dialect: z
|
|
93
89
|
.string()
|
|
@@ -229,7 +225,6 @@ export function unmatchedRegionIncludeIds(roots, regionIncludes) {
|
|
|
229
225
|
/** One root's region, before any declared parameters are merged onto it. */
|
|
230
226
|
function derivedRegion(root) {
|
|
231
227
|
const surface = root.surface;
|
|
232
|
-
const dev = root.dev;
|
|
233
228
|
const firstParty = root.adapter.type === 'builtin';
|
|
234
229
|
const projector = surface === 'canvas' ? 'pixi' : surface;
|
|
235
230
|
const basis = NATIVE_REGION_BASIS;
|
|
@@ -237,7 +232,6 @@ function derivedRegion(root) {
|
|
|
237
232
|
return {
|
|
238
233
|
id: root.id,
|
|
239
234
|
surface,
|
|
240
|
-
dev,
|
|
241
235
|
projector,
|
|
242
236
|
dialect: null,
|
|
243
237
|
anchors: ['live-only'],
|
|
@@ -248,7 +242,6 @@ function derivedRegion(root) {
|
|
|
248
242
|
return {
|
|
249
243
|
id: root.id,
|
|
250
244
|
surface,
|
|
251
|
-
dev,
|
|
252
245
|
projector,
|
|
253
246
|
dialect: 'jsx',
|
|
254
247
|
anchors: ['source-prop', 'source-structure'],
|
|
@@ -258,7 +251,6 @@ function derivedRegion(root) {
|
|
|
258
251
|
return {
|
|
259
252
|
id: root.id,
|
|
260
253
|
surface,
|
|
261
|
-
dev,
|
|
262
254
|
projector,
|
|
263
255
|
dialect: surface === 'three' ? 'r3f' : 'pixi-react',
|
|
264
256
|
anchors: ['source-prop', 'source-structure', 'construction-literal'],
|
|
@@ -270,9 +262,7 @@ function derivedRegion(root) {
|
|
|
270
262
|
// ---------------------------------------------------------------------------
|
|
271
263
|
/**
|
|
272
264
|
* The rule form of a finder's region targeting: every region the host mounts
|
|
273
|
-
* from an exported composition
|
|
274
|
-
* DEV layer. A dev root is the game's own dev GUI — the manifest already says
|
|
275
|
-
* so (`dev: true`), so skipping it reads a declaration rather than guessing.
|
|
265
|
+
* from an exported composition — a root with an `entry`.
|
|
276
266
|
*/
|
|
277
267
|
export const EXPORTED_COMPOSITION_REGIONS = 'exported-composition-regions';
|
|
278
268
|
/** The finder names, as a value — what the loader's dispatcher switches on. */
|
|
@@ -45,8 +45,6 @@ export interface EntrypointSource {
|
|
|
45
45
|
readonly path: string;
|
|
46
46
|
/** The module's bytes; `null` when they could not be read. */
|
|
47
47
|
readonly source: string | null;
|
|
48
|
-
/** The root's declared `dev` flag — a dev layer is the game's own dev GUI. */
|
|
49
|
-
readonly dev: boolean;
|
|
50
48
|
}
|
|
51
49
|
export interface ScenesFromEntrypointSelectionInput {
|
|
52
50
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scenes-from-entrypoint-selection.d.ts","sourceRoot":"","sources":["../../../src/adapter/finders/scenes-from-entrypoint-selection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAGH,OAAO,KAAK,EAGV,mCAAmC,EACpC,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,6EAA6E;AAC7E,MAAM,WAAW,gBAAgB;IAC/B,wCAAwC;IACxC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,8DAA8D;IAC9D,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"scenes-from-entrypoint-selection.d.ts","sourceRoot":"","sources":["../../../src/adapter/finders/scenes-from-entrypoint-selection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAGH,OAAO,KAAK,EAGV,mCAAmC,EACpC,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,6EAA6E;AAC7E,MAAM,WAAW,gBAAgB;IAC/B,wCAAwC;IACxC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,8DAA8D;IAC9D,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,kCAAkC;IACjD;;;OAGG;IACH,QAAQ,CAAC,WAAW,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAClD;;;;;;OAMG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CACjF;AA+TD;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,mCAAmC,EAC3C,KAAK,EAAE,kCAAkC,GACxC,YAAY,CA8Bd"}
|
|
@@ -227,15 +227,12 @@ function sourceFor(binding, fromPath, resolveModule) {
|
|
|
227
227
|
/**
|
|
228
228
|
* Which entrypoints this selection targets.
|
|
229
229
|
*
|
|
230
|
-
* The RULE form is every exported-composition region
|
|
231
|
-
*
|
|
232
|
-
* GUI is edit-time chrome, not authorable game content — never a name
|
|
233
|
-
* heuristic. A named region with no matching entrypoint becomes a note, not a
|
|
234
|
-
* silent omission.
|
|
230
|
+
* The RULE form is every exported-composition region. A named region with no
|
|
231
|
+
* matching entrypoint becomes a note, not a silent omission.
|
|
235
232
|
*/
|
|
236
233
|
function targetedEntrypoints(params, entrypoints, notes) {
|
|
237
234
|
if (params.regions === EXPORTED_COMPOSITION_REGIONS) {
|
|
238
|
-
return entrypoints
|
|
235
|
+
return [...entrypoints];
|
|
239
236
|
}
|
|
240
237
|
const found = [];
|
|
241
238
|
for (const regionId of params.regions) {
|
|
@@ -67,6 +67,10 @@ export interface MountedRootBase {
|
|
|
67
67
|
step?(): void;
|
|
68
68
|
resize?(width: number, height: number): void;
|
|
69
69
|
dispose(): void;
|
|
70
|
+
/** Resolves after an asynchronous native reconciler has run every component
|
|
71
|
+
* cleanup started by {@link dispose}. Omitted by synchronously-disposing
|
|
72
|
+
* roots. Hosts use this before auditing/reclaiming realm-owned resources. */
|
|
73
|
+
readonly disposeComplete?: Promise<void>;
|
|
70
74
|
/** Optional capability providers — absence = "not supported", host degrades. */
|
|
71
75
|
readonly authoring?: AuthoringAdapter;
|
|
72
76
|
readonly systems?: SystemAdapters;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root-adapter.d.ts","sourceRoot":"","sources":["../../src/adapter/root-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;;;OAMG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;IAC5C;;;;;;OAMG;IACH,QAAQ,IAAI,OAAO,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAEhC,MAAM,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,SAAS,CAAC,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IAClC,IAAI,CAAC,IAAI,IAAI,CAAC;IAEd,MAAM,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7C,OAAO,IAAI,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"root-adapter.d.ts","sourceRoot":"","sources":["../../src/adapter/root-adapter.ts"],"names":[],"mappings":"AA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AC,CAAC,CAAC,CAAC;CAC5D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,cAAc,IAAI;IACxD,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;CAClC,CAAC;AAEF;;;;oEAIoE;AACpE,MAAM,MAAM,cAAc,GACtB,iBAAiB,CAAC,OAAO,CAAC,GAC1B,iBAAiB,CAAC,QAAQ,CAAC,GAC3B,iBAAiB,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -47,6 +47,11 @@ export declare const MOUNTED_ROOT_BASE_SHAPE: {
|
|
|
47
47
|
readonly kind: "function";
|
|
48
48
|
readonly required: "effect";
|
|
49
49
|
};
|
|
50
|
+
readonly disposeComplete: {
|
|
51
|
+
readonly optional: true;
|
|
52
|
+
readonly kind: "value";
|
|
53
|
+
readonly required: "effect";
|
|
54
|
+
};
|
|
50
55
|
readonly authoring: {
|
|
51
56
|
readonly optional: true;
|
|
52
57
|
readonly kind: "value";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root-seam-contract.d.ts","sourceRoot":"","sources":["../../src/adapter/root-seam-contract.ts"],"names":[],"mappings":"AAAA,yEAAyE;AAazE,eAAO,MAAM,kBAAkB;;;;;;;;;;;CAG7B,CAAC;AAEH,eAAO,MAAM,uBAAuB
|
|
1
|
+
{"version":3,"file":"root-seam-contract.d.ts","sourceRoot":"","sources":["../../src/adapter/root-seam-contract.ts"],"names":[],"mappings":"AAAA,yEAAyE;AAazE,eAAO,MAAM,kBAAkB;;;;;;;;;;;CAG7B,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAYlC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;CAGpC,CAAC;AAMH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;CAKtC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;;;CAGvC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;CAGpC,CAAC"}
|
|
@@ -12,6 +12,7 @@ export const MOUNTED_ROOT_BASE_SHAPE = defineSeamShape()({
|
|
|
12
12
|
step: { optional: true, kind: 'function', required: 'effect' },
|
|
13
13
|
resize: { optional: true, kind: 'function', required: 'effect' },
|
|
14
14
|
dispose: { optional: false, kind: 'function', required: 'effect' },
|
|
15
|
+
disposeComplete: { optional: true, kind: 'value', required: 'effect' },
|
|
15
16
|
authoring: { optional: true, kind: 'value', required: 'operation' },
|
|
16
17
|
systems: { optional: true, kind: 'value', required: 'operation' },
|
|
17
18
|
observe: { optional: true, kind: 'value', required: 'effect' },
|
|
@@ -44,7 +44,7 @@ import { createSoftParticleDepthPass } from '../render/soft-particle-depth';
|
|
|
44
44
|
import { disposeSparkRendererWhenIdle, SPARK_DISCOVERY_INTERVAL_MS, sceneHasGaussianSplat, shouldDiscoverGaussianSplat, } from '../render/spark-renderer-lifecycle';
|
|
45
45
|
import { ViewportShadingRenderer } from '../render/viewport-shading';
|
|
46
46
|
import { createDebugRegistry, getDebugRegistry, } from '../runtime/debug-registry';
|
|
47
|
-
import {
|
|
47
|
+
import { devBuildEnabled } from '../runtime/dev-build';
|
|
48
48
|
import { disposeDebrisSubtree } from '../runtime/game';
|
|
49
49
|
import { setupAudio } from '../setup/setup-audio';
|
|
50
50
|
import { setupParticles } from '../setup/setup-particles';
|
|
@@ -485,8 +485,8 @@ export class SetupThreeRootAdapter {
|
|
|
485
485
|
// registry, with no capability to install and nothing for a game to write.
|
|
486
486
|
//
|
|
487
487
|
// THE GATE, in one place. Three conditions, and the reason for each:
|
|
488
|
-
// 1. `
|
|
489
|
-
// context" (`runtime/dev-
|
|
488
|
+
// 1. `devBuildEnabled()` — the ONE owner of "is this a dev/editor
|
|
489
|
+
// context" (`runtime/dev-build.ts`). A ship build registers nothing,
|
|
490
490
|
// subscribes to nothing, and never enables the profiler.
|
|
491
491
|
// 2. a `Game` shell exists — the readings are folded out of that game's
|
|
492
492
|
// profiler frames, and a bare mount has no profiler to fold.
|
|
@@ -514,12 +514,12 @@ export class SetupThreeRootAdapter {
|
|
|
514
514
|
// The packaged runtime bakes `import.meta.env.DEV = false` into its
|
|
515
515
|
// prebuilt bundle, which is a fact about how the EDITOR was built, not
|
|
516
516
|
// about whether this mount is a dev session — found live: a
|
|
517
|
-
// package-native project's vitals never seeded while its
|
|
518
|
-
//
|
|
519
|
-
//
|
|
520
|
-
//
|
|
521
|
-
//
|
|
522
|
-
if (!host.game || headless || !
|
|
517
|
+
// package-native project's vitals never seeded while its capabilities
|
|
518
|
+
// and every other project-graph module ran fine. The override argument
|
|
519
|
+
// is `devBuildEnabled`'s own documented seam for exactly this
|
|
520
|
+
// caller-knows-better case; a standalone/ship mount (no editorPreview)
|
|
521
|
+
// still resolves purely from the build env.
|
|
522
|
+
if (!host.game || headless || !devBuildEnabled(editorPreview ? true : undefined))
|
|
523
523
|
return;
|
|
524
524
|
renderVitals?.dispose();
|
|
525
525
|
host.game.profiler.enabled = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pixi-react-adapter.d.ts","sourceRoot":"","sources":["../../src/canvas-react/pixi-react-adapter.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAGH,OAAO,KAAK,EAAe,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE/D,OAAO,EAA2B,KAAK,SAAS,EAA8B,MAAM,OAAO,CAAC;AAC5F,OAAO,KAAK,EAAsC,WAAW,EAAE,MAAM,YAAY,CAAC;AA2BlF,sFAAsF;AACtF,MAAM,WAAW,6BAA6B;IAC5C,qEAAqE;IACrE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB;yDACqD;IACrD,QAAQ,CAAC,OAAO,EAA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AC,QAAQ,CAAC,CAwPvB"}
|
|
@@ -119,17 +119,32 @@ export function createPixiReactAdapter(options) {
|
|
|
119
119
|
useEffect(resolveEffectsReady, []);
|
|
120
120
|
return null;
|
|
121
121
|
}
|
|
122
|
-
const game = runtime?.ctx.game;
|
|
123
122
|
// The React seam every dom root already has — `useWorldState`,
|
|
124
123
|
// `useDebugProvider`/`useDebugCommand`/`useDebugEmit`
|
|
125
124
|
// (`../react/world-state`) — works identically inside a canvas root
|
|
126
125
|
// because a canvas root IS React. `host.game` is genuinely absent in
|
|
127
126
|
// bare/foreign hosts, so the provider is conditional and those hooks
|
|
128
127
|
// stay the inert no-ops they already document themselves to be.
|
|
128
|
+
//
|
|
129
|
+
// READ FROM `host.game`, NEVER FROM `runtime` — the same rule, and the
|
|
130
|
+
// same reasoning, as the three lane's (`../world3d-react/r3f-adapter.tsx`,
|
|
131
|
+
// beside its own `const game = host.game`). The two providers answer
|
|
132
|
+
// different questions: `EngineBridge` rides `bridge` (the vgai runtime
|
|
133
|
+
// CONTEXT, which must not enter an ecosystem-native tree), `WorldProvider`
|
|
134
|
+
// rides the Game handle the host already holds. Keyed off `runtime`, a
|
|
135
|
+
// world mounted with `engineRuntime: false` gets no `WorldProvider` at
|
|
136
|
+
// all and every `useDebugProvider` in it no-ops IN SILENCE — no error, and
|
|
137
|
+
// `vgai eval 'await game.providers()'` lists only the built-ins. That is
|
|
138
|
+
// exactly what happened on the three lane. It has never fired here only
|
|
139
|
+
// because `pixi-react-root-factory.tsx` still leaves the runtime on;
|
|
140
|
+
// that flag is the tracked component-root migration's to flip, and this
|
|
141
|
+
// seam must not be waiting for it.
|
|
142
|
+
const game = host.game;
|
|
129
143
|
const world = createElement(Fragment, null, content, createElement(Lifecycle));
|
|
144
|
+
const provided = game ? createElement(WorldProvider, { game }, world) : world;
|
|
130
145
|
const element = bridge
|
|
131
|
-
? createElement(EngineBridge.Provider, { value: bridge },
|
|
132
|
-
:
|
|
146
|
+
? createElement(EngineBridge.Provider, { value: bridge }, provided)
|
|
147
|
+
: provided;
|
|
133
148
|
const root = createRoot(canvas);
|
|
134
149
|
// The host owns size, dpr, transparency and capture cost; the loop
|
|
135
150
|
// contract owns `autoStart`/`sharedTicker`. Both are applied AFTER the
|
|
@@ -148,62 +163,92 @@ export function createPixiReactAdapter(options) {
|
|
|
148
163
|
autoStart: false,
|
|
149
164
|
sharedTicker: false,
|
|
150
165
|
};
|
|
151
|
-
//
|
|
152
|
-
//
|
|
153
|
-
//
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
const fail = (why) => {
|
|
162
|
-
cleanup();
|
|
163
|
-
try {
|
|
164
|
-
app.destroy(false, { children: true });
|
|
165
|
-
}
|
|
166
|
-
catch {
|
|
167
|
-
/* the world never fully came up; teardown failure must not mask why */
|
|
168
|
-
}
|
|
169
|
-
runtime?.dispose();
|
|
170
|
-
reject(new Error(`createPixiReactAdapter: root "${id}" — ${why}`));
|
|
171
|
-
};
|
|
172
|
-
const onError = (event) => fail(`the Pixi tree crashed before its first commit — ${event.message} ` +
|
|
166
|
+
// Install the reconcile-error listener BEFORE `root.render`: Pixi hands
|
|
167
|
+
// the Application back after `init()` but React can already have thrown
|
|
168
|
+
// during that same turn. Attaching after the await loses the real error
|
|
169
|
+
// and turns it into a misleading ten-second timeout.
|
|
170
|
+
let reportReconcileFailure;
|
|
171
|
+
const reconcileFailure = new Promise((resolve) => {
|
|
172
|
+
reportReconcileFailure = resolve;
|
|
173
|
+
});
|
|
174
|
+
const onError = (event) => {
|
|
175
|
+
reportReconcileFailure(`the Pixi tree crashed before its first commit — ${event.message} ` +
|
|
173
176
|
'(mount() fails loudly instead of hanging)');
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
177
|
+
};
|
|
178
|
+
globalThis.addEventListener?.('error', onError);
|
|
179
|
+
let app;
|
|
180
|
+
let timer;
|
|
181
|
+
try {
|
|
182
|
+
// `root.render` is async: it awaits `Application.init()` (which is what
|
|
183
|
+
// creates the renderer) and only then hands the tree to the reconciler.
|
|
184
|
+
// A crash inside init rejects here, which is the loud failure we want.
|
|
185
|
+
const renderedApp = await root.render(element, initOptions);
|
|
186
|
+
app = renderedApp;
|
|
187
|
+
runtime?.setApplication(renderedApp);
|
|
188
|
+
// A reconcile-time crash (e.g. an un-extended component) surfaces as
|
|
189
|
+
// an uncaught window error and the first commit never lands. Race that
|
|
190
|
+
// exact signal against the commit and the last-resort ceiling.
|
|
191
|
+
const timeout = new Promise((resolve) => {
|
|
192
|
+
timer = setTimeout(() => resolve(`no first commit within ${FIRST_COMMIT_TIMEOUT_MS / 1000}s ` +
|
|
193
|
+
'(mount() fails loudly instead of hanging)'), FIRST_COMMIT_TIMEOUT_MS);
|
|
184
194
|
});
|
|
185
|
-
|
|
195
|
+
const failure = await Promise.race([
|
|
196
|
+
Promise.all([committed, effectsReady]).then(() => null),
|
|
197
|
+
reconcileFailure,
|
|
198
|
+
timeout,
|
|
199
|
+
]);
|
|
200
|
+
if (failure !== null) {
|
|
201
|
+
throw new Error(`createPixiReactAdapter: root "${id}" — ${failure}`);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
catch (error) {
|
|
205
|
+
try {
|
|
206
|
+
app?.destroy(false, { children: true });
|
|
207
|
+
}
|
|
208
|
+
catch {
|
|
209
|
+
/* the world never fully came up; teardown failure must not mask why */
|
|
210
|
+
}
|
|
211
|
+
runtime?.dispose();
|
|
212
|
+
throw error;
|
|
213
|
+
}
|
|
214
|
+
finally {
|
|
215
|
+
if (timer !== undefined)
|
|
216
|
+
clearTimeout(timer);
|
|
217
|
+
globalThis.removeEventListener?.('error', onError);
|
|
218
|
+
}
|
|
219
|
+
// `app` is assigned before the first-commit race. Reaching here proves
|
|
220
|
+
// both initialization and commit succeeded, so narrow once for the live
|
|
221
|
+
// mounted-root methods below.
|
|
222
|
+
if (app === undefined) {
|
|
223
|
+
runtime?.dispose();
|
|
224
|
+
throw new Error(`createPixiReactAdapter: root "${id}" initialized without an Application`);
|
|
225
|
+
}
|
|
226
|
+
const mountedApp = app;
|
|
186
227
|
// Pin the ticker's clock to GAME time. `Ticker.lastTime` starts at -1, so
|
|
187
228
|
// without this the first `update()` would report a 1ms phantom delta on
|
|
188
229
|
// top of the real one. From here every `deltaMS` a `useTick` callback
|
|
189
230
|
// sees is exactly the `dt` the host handed us — no wall clock anywhere,
|
|
190
231
|
// which is what makes a paused world's resume frame ordinary rather than
|
|
191
232
|
// one giant catch-up step.
|
|
192
|
-
|
|
233
|
+
mountedApp.ticker.lastTime = 0;
|
|
193
234
|
let elapsedMs = 0;
|
|
194
235
|
let disposed = false;
|
|
195
236
|
const registry = host.game ? getDebugRegistry(host.game) : null;
|
|
196
237
|
const systemAdapters = runtime?.systemAdapters ?? (registry ? { debug: registry.adapter } : {});
|
|
238
|
+
const disposeComplete = unmounted.then(() => {
|
|
239
|
+
mountedApp.destroy(false, { children: true });
|
|
240
|
+
});
|
|
197
241
|
return {
|
|
198
242
|
kind: 'canvas',
|
|
199
243
|
// The reconciler's real root container — the same `PIXI.Container`
|
|
200
244
|
// `RootInstance.pixiStage()` hands the editor.
|
|
201
|
-
stage:
|
|
245
|
+
stage: mountedApp.stage,
|
|
202
246
|
drivesOwnLoop: false,
|
|
203
247
|
// Adapter surface: the host's shared debug registry. A native component
|
|
204
248
|
// tree registers nothing; its entry-module `debug` export is projected
|
|
205
249
|
// after mount by the shared native adapter.
|
|
206
250
|
systems: systemAdapters,
|
|
251
|
+
disposeComplete,
|
|
207
252
|
update(dt) {
|
|
208
253
|
if (disposed)
|
|
209
254
|
return;
|
|
@@ -212,7 +257,7 @@ export function createPixiReactAdapter(options) {
|
|
|
212
257
|
// the native path has none. The real Pixi ticker remains the one
|
|
213
258
|
// scheduler `useTick` observes, and the host only gates/advances it.
|
|
214
259
|
runtime?.systems.run(dt);
|
|
215
|
-
|
|
260
|
+
mountedApp.ticker.update(elapsedMs);
|
|
216
261
|
},
|
|
217
262
|
resize(width, height) {
|
|
218
263
|
if (disposed)
|
|
@@ -220,12 +265,19 @@ export function createPixiReactAdapter(options) {
|
|
|
220
265
|
// `autoDensity: true` makes Pixi re-stamp `canvas.style.width`/
|
|
221
266
|
// `.height` from this call, so the on-screen box follows the logical
|
|
222
267
|
// size with no explicit CSS write from the host.
|
|
223
|
-
|
|
268
|
+
mountedApp.renderer.resize(width, height);
|
|
224
269
|
},
|
|
225
270
|
dispose() {
|
|
226
271
|
if (disposed)
|
|
227
272
|
return;
|
|
228
273
|
disposed = true;
|
|
274
|
+
// Pixi's EventSystem owns document.pointermove + window.pointerup
|
|
275
|
+
// (and its event ticker's global listener). React's deletion commit
|
|
276
|
+
// is asynchronous, so waiting to destroy the Application leaves
|
|
277
|
+
// those listeners live when the host audits this game realm. Detach
|
|
278
|
+
// the input target synchronously; the later Application.destroy()
|
|
279
|
+
// repeats this idempotently after every useTick cleanup has landed.
|
|
280
|
+
mountedApp.renderer.events.setTargetElement(null);
|
|
229
281
|
// Rendering `null` children is the only unmount path `@pixi/react`
|
|
230
282
|
// exposes publicly (its `unmountRoot` helper is internal), and React
|
|
231
283
|
// commits that deletion on its own schedule — NOT synchronously. So
|
|
@@ -234,7 +286,6 @@ export function createPixiReactAdapter(options) {
|
|
|
234
286
|
// a ticker destroyed before it lands throws inside React's commit.
|
|
235
287
|
// `removeView` stays false — the canvas belongs to the HOST.
|
|
236
288
|
void root.render(null, initOptions);
|
|
237
|
-
void unmounted.then(() => app.destroy(false, { children: true }));
|
|
238
289
|
runtime?.dispose();
|
|
239
290
|
},
|
|
240
291
|
};
|
package/dist/data/curve.d.ts
CHANGED
|
@@ -93,7 +93,7 @@ export declare function curve(axes: CurveAxes): z.ZodType<CurveValue>;
|
|
|
93
93
|
* Read a curve field's declared axes back off a LIVE Zod schema (as opposed to
|
|
94
94
|
* the emitted JSON Schema, which the editor's Data panel reads instead).
|
|
95
95
|
*
|
|
96
|
-
* This is the dev-
|
|
96
|
+
* This is the dev-tools capability's detection door: it derives its rows by
|
|
97
97
|
* walking the game's own `TuningSchema` object, so it needs the axes from the
|
|
98
98
|
* schema in hand. Wrappers (`.optional()`, `.default(…)`, `.describe(…)` chains
|
|
99
99
|
* that re-wrap) hide the metadata behind an inner type, so a bounded unwrap
|
package/dist/data/curve.js
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
* update, the same way it reads any other tuning value.
|
|
35
35
|
*/
|
|
36
36
|
import { z } from 'zod';
|
|
37
|
-
/** How the marker rides out to the emitted JSON Schema — the editor's
|
|
37
|
+
/** How the marker rides out to the emitted JSON Schema — the editor's detection key, the exact shape `dataRef` uses with `x-vgai-ref`. */
|
|
38
38
|
const CURVE_META_KEY = 'x-vgai-curve';
|
|
39
39
|
function axisLabel(axes, axis) {
|
|
40
40
|
return axes[axis].label ?? axis;
|
|
@@ -122,7 +122,7 @@ export function curve(axes) {
|
|
|
122
122
|
* Read a curve field's declared axes back off a LIVE Zod schema (as opposed to
|
|
123
123
|
* the emitted JSON Schema, which the editor's Data panel reads instead).
|
|
124
124
|
*
|
|
125
|
-
* This is the dev-
|
|
125
|
+
* This is the dev-tools capability's detection door: it derives its rows by
|
|
126
126
|
* walking the game's own `TuningSchema` object, so it needs the axes from the
|
|
127
127
|
* schema in hand. Wrappers (`.optional()`, `.default(…)`, `.describe(…)` chains
|
|
128
128
|
* that re-wrap) hide the metadata behind an inner type, so a bounded unwrap
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
* game registry.
|
|
26
26
|
*
|
|
27
27
|
* ── THE DOOR ────────────────────────────────────────────────────────────────
|
|
28
|
-
* This module is IMPLEMENTATION ONLY. It publishes nothing itself: the dev-
|
|
29
|
-
* capability's own registry adopts this list (`
|
|
28
|
+
* This module is IMPLEMENTATION ONLY. It publishes nothing itself: the dev-tools
|
|
29
|
+
* capability's own registry adopts this list (`installDevToolsInstruments`) and
|
|
30
30
|
* publishes each instrument through the SAME door every declaration in that
|
|
31
31
|
* capability uses — one provider per reading (`instrument.timescale`), one
|
|
32
|
-
* command per action (`instrument.timescale.set`), plus the `dev-
|
|
32
|
+
* command per action (`instrument.timescale.set`), plus the `dev-tools` index
|
|
33
33
|
* provider. That is deliberate and load-bearing: the registry IS the product,
|
|
34
34
|
* so every reader of an instrument reaches the SAME registration.
|
|
35
35
|
*
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
* ── RESOURCE OWNERSHIP, STATED ONCE ─────────────────────────────────────────
|
|
44
44
|
* {@link createDevInstruments} owns everything it allocates: the frame-time
|
|
45
45
|
* ring buffer and its ONE `game.onRenderStep` subscription. SHARER: the
|
|
46
|
-
* dev-
|
|
46
|
+
* dev-tools capability's `DevToolsBridge`, which creates one set per mounted
|
|
47
47
|
* game. TEARDOWN: the returned {@link DevInstrumentSet.dispose} — the ONE path
|
|
48
48
|
* that ends it. Nothing else here holds a resource; the time-scale, pause and
|
|
49
49
|
* collider instruments only drive state that `Game` already owns.
|
package/dist/dev/instruments.js
CHANGED
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
* game registry.
|
|
26
26
|
*
|
|
27
27
|
* ── THE DOOR ────────────────────────────────────────────────────────────────
|
|
28
|
-
* This module is IMPLEMENTATION ONLY. It publishes nothing itself: the dev-
|
|
29
|
-
* capability's own registry adopts this list (`
|
|
28
|
+
* This module is IMPLEMENTATION ONLY. It publishes nothing itself: the dev-tools
|
|
29
|
+
* capability's own registry adopts this list (`installDevToolsInstruments`) and
|
|
30
30
|
* publishes each instrument through the SAME door every declaration in that
|
|
31
31
|
* capability uses — one provider per reading (`instrument.timescale`), one
|
|
32
|
-
* command per action (`instrument.timescale.set`), plus the `dev-
|
|
32
|
+
* command per action (`instrument.timescale.set`), plus the `dev-tools` index
|
|
33
33
|
* provider. That is deliberate and load-bearing: the registry IS the product,
|
|
34
34
|
* so every reader of an instrument reaches the SAME registration.
|
|
35
35
|
*
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
* ── RESOURCE OWNERSHIP, STATED ONCE ─────────────────────────────────────────
|
|
44
44
|
* {@link createDevInstruments} owns everything it allocates: the frame-time
|
|
45
45
|
* ring buffer and its ONE `game.onRenderStep` subscription. SHARER: the
|
|
46
|
-
* dev-
|
|
46
|
+
* dev-tools capability's `DevToolsBridge`, which creates one set per mounted
|
|
47
47
|
* game. TEARDOWN: the returned {@link DevInstrumentSet.dispose} — the ONE path
|
|
48
48
|
* that ends it. Nothing else here holds a resource; the time-scale, pause and
|
|
49
49
|
* collider instruments only drive state that `Game` already owns.
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
* the drawing buffer halves was never fill-bound.
|
|
37
37
|
*
|
|
38
38
|
* ── GATING ──────────────────────────────────────────────────────────────────
|
|
39
|
-
* The caller gates. Both seeders call this only under `
|
|
40
|
-
* (`runtime/dev-
|
|
39
|
+
* The caller gates. Both seeders call this only under `devBuildEnabled()`
|
|
40
|
+
* (`runtime/dev-build.ts` — the ONE owner of "is this a dev context"), so a
|
|
41
41
|
* ship build registers nothing and pays nothing. Each also requires a `Game`
|
|
42
42
|
* shell (there is no profiler to fold without one) and a non-headless mount
|
|
43
43
|
* (nothing brackets a submission, so the readings could only ever be empty).
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
* the drawing buffer halves was never fill-bound.
|
|
37
37
|
*
|
|
38
38
|
* ── GATING ──────────────────────────────────────────────────────────────────
|
|
39
|
-
* The caller gates. Both seeders call this only under `
|
|
40
|
-
* (`runtime/dev-
|
|
39
|
+
* The caller gates. Both seeders call this only under `devBuildEnabled()`
|
|
40
|
+
* (`runtime/dev-build.ts` — the ONE owner of "is this a dev context"), so a
|
|
41
41
|
* ship build registers nothing and pays nothing. Each also requires a `Game`
|
|
42
42
|
* shell (there is no profiler to fold without one) and a non-headless mount
|
|
43
43
|
* (nothing brackets a submission, so the readings could only ever be empty).
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* require someone to ASK, and both require that someone to already know that
|
|
7
7
|
* static batching exists, is possible here, and is spelled `<Frozen>`. An
|
|
8
8
|
* agent building a game does not know any of that, so the measurement has to
|
|
9
|
-
* do the routing itself — the same idiom as
|
|
9
|
+
* do the routing itself — the same idiom as dev-tools' unconfigured-section
|
|
10
10
|
* warning: the reading names the exact edit.
|
|
11
11
|
*
|
|
12
12
|
* ── THE DECISION IS PURE, THE SCHEDULE IS NOT ───────────────────────────────
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* require someone to ASK, and both require that someone to already know that
|
|
7
7
|
* static batching exists, is possible here, and is spelled `<Frozen>`. An
|
|
8
8
|
* agent building a game does not know any of that, so the measurement has to
|
|
9
|
-
* do the routing itself — the same idiom as
|
|
9
|
+
* do the routing itself — the same idiom as dev-tools' unconfigured-section
|
|
10
10
|
* warning: the reading names the exact edit.
|
|
11
11
|
*
|
|
12
12
|
* ── THE DECISION IS PURE, THE SCHEDULE IS NOT ───────────────────────────────
|
|
@@ -106,7 +106,7 @@ export function decideStaticBatchAdvisory(input) {
|
|
|
106
106
|
* Once per PAGE, not once per module evaluation — a hot reload re-runs this
|
|
107
107
|
* module, and an advisory that reappears on every save is one that gets muted
|
|
108
108
|
* along with everything else on the console. Same mechanism, and the same
|
|
109
|
-
* reason, as
|
|
109
|
+
* reason, as dev-tools' unconfigured-section warning.
|
|
110
110
|
*/
|
|
111
111
|
const WARNED_KEY = '__vgaiStaticBatchAdvised';
|
|
112
112
|
function alreadyWarned() {
|