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.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
fix(settings): the module page reads the same asset table the build installs from
esengine8f272d8d6ccb
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 5b8abc74c..f16fc84bd 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -20,6 +20,8 @@ published separately; it ships inside the editor.### Fixed+- **The Engine Modules page no longer calls a module unused that the build then carries.** It read only the components a scene names, while the build also reads the extensions of the assets that ship and the imports your scripts write — so a behaviour tree an agent is handed at runtime, which leaves no component behind, showed as "not used by this project" in a package that had it. The page now reads the same asset table the build installs from, and says what it can see rather than what will ship.+- **A Douyin package could not start.** It shipped the browser engine artifact, which is an ES module, and a mini-game host loads its JavaScript with `require` — so `game.js` threw `SyntaxError: Unexpected token 'export'` on its first line and the package never reached a frame. Every mini-game host takes the same engine build, and now every mini-game target asks for it: the two built-in vendors, and a platform a project defines itself, which had the same browser default. The export also refuses an ES module engine by reading the file rather than trusting its name, since the name was the thing that was wrong.### Changeddiff --git a/desktop b/desktopindex 2c1d52ebe..34ec0018e 160000--- a/desktop+++ b/desktop@@ -1 +1 @@-Subproject commit 2c1d52ebeaa24f8925bc92d35b4e26e8ea5c4533+Subproject commit 34ec0018e88718ff193e92cfedd8a722b23d5a07diff --git a/pipeline/src/bundle/engineInstalls.ts b/pipeline/src/bundle/engineInstalls.tsindex 4f5ca5fe1..f5d8faea0 100644--- a/pipeline/src/bundle/engineInstalls.ts+++ b/pipeline/src/bundle/engineInstalls.ts@@ -112,6 +112,17 @@ function extensionOf(p: string): string {return dot > slash ? p.slice(dot).toLowerCase() : '';}+/**+ * The module this asset's extension installs, or null.+ *+ * Exported for the settings page, which attributes the same evidence to the same+ * files: a page that kept its own copy of this table would go on calling a+ * module unused after the build started carrying it.+ */+export function moduleForAsset(path: string): string | null {+ return ASSET_SUBPATH[extensionOf(path)] ?? null;+}+/*** The engine modules this package installs. `lean` is false when something in* use has no subpath to install it (video today): that project takes the wholediff --git a/pipeline/tests/engine-installs.test.ts b/pipeline/tests/engine-installs.test.tsindex e37b21f83..db78aa522 100644--- a/pipeline/tests/engine-installs.test.ts+++ b/pipeline/tests/engine-installs.test.ts@@ -9,7 +9,7 @@* fine — it was never installed.*/import { describe, it, expect } from 'vitest';-import { engineInstalls, forcedSideModules, moduleChoices } from '../src/bundle/engineInstalls';+import { engineInstalls, forcedSideModules, moduleChoices, moduleForAsset } from '../src/bundle/engineInstalls';import { ENGINE_MODULES, ESENGINE_SUBPATHS } from '../src/bundle/engineSubpaths';import { SUBSYSTEM_COMPONENTS, SUBSYSTEM_INSTALL, type Subsystem } from '../src/project/targetSupport';@@ -143,6 +143,21 @@ describe('a project that overrides what the build detected', () => {});});+/**+ * The settings page answers "does this ship?" before a build exists, so it reads+ * the same tables the build does. It once read only the component one, and said+ * "not used" about a module the package carried.+ */+describe('the asset evidence the settings page attributes', () => {+ it('installs exactly what the build installs, for anything it is asked about', () => {+ for (const path of ['a/Door.esgraph', 'b.esfsm', 'c.esbt', 'hero.png', 'README', 'x.ESGRAPH']) {+ const table = moduleForAsset(path);+ expect(engineInstalls({ assetPaths: [path] }).subpaths)+ .toEqual(table ? [table] : []);+ }+ });+});+describe('what a project said, read off its manifest', () => {it('is empty when it said nothing', () => {expect(moduleChoices(undefined)).toEqual({});diff --git a/tools/releaseNotes.mjs b/tools/releaseNotes.mjsindex cd78e657b..c22ef5d5a 100644--- a/tools/releaseNotes.mjs+++ b/tools/releaseNotes.mjs@@ -698,6 +698,8 @@ export const NOTED = {{ internal: "a manual page's import line, following the move it documents" },'refactor(play): the play realm asks for the whole import map by name':{ internal: "the editor's preview page names the same subpaths it always did" },+ 'fix(settings): the module page reads the same asset table the build installs from':+ { note: 'The Engine Modules page no longer calls a module unused that the build then carries.' },'feat(build): a target states its size caps before you package':{ note: "The build dialog states a platform's size caps before you package." },'fix(export): a mini-game takes the engine build a mini-game host can load':