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
perf(templates): minify the WeChat publishing profile
yhh43f4420af498
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 3dfa6234d..0af308074 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -16,6 +16,8 @@ published separately; it ships inside the editor.### Added+- **The WeChat starter's publishing profile minifies its game bundle.** The named WeChat profile uses Shipping settings while Web authoring uses Development settings. Both preserve gameplay and host-service behavior. Headless observations record scene-initialization timing separately from actual device cold startup; unchanged-scene bundle comparisons measure the byte savings.+- **The WeChat Mini Game starter combines gameplay and host-service examples.** A CC0 fleet game includes honest login-code/server-exchange status, sharing without false completion rewards, opt-in configured rewarded video and device-local credit restoration. Unreadable or changed saves are preserved. Named Web/WeChat profiles, compressed engine subpackaging, licenses and a creation-to-submission guide are included; real accounts, server authentication and device/platform approval remain separate.- **The Playable Ad starter includes a complete editable game.** New projects receive CC0 space art, three-ship selection, completion, replay and an explicit store button instead of a tap-anywhere redirect. Eight named network profiles, a configurable MRAID destination, licenses, a portrait/landscape headless scenario and a creation-to-submission guide ship together. Local mocks and size checks remain separate from official network approval and external publication exercises.diff --git a/templates/wechat-minigame/README.md b/templates/wechat-minigame/README.mdindex 4671b145f..80529434c 100644--- a/templates/wechat-minigame/README.md+++ b/templates/wechat-minigame/README.md@@ -35,7 +35,11 @@ node pipeline/bin/estella.mjs export /path/to/project --profile web --out output```The WeChat profile puts the engine in a startup subpackage and compresses WASM-to `.wasm.br`. Use WeChat base library 2.14.0 or newer for compressed WASM and+to `.wasm.br`. Its Shipping configuration also minifies the game bundle; the+Web preview profile stays in Development configuration for authoring. Shipping does not+remove the login/share/reward behavior. Use the exported size report to compare+your actual project, and measure cold startup on target devices.+Use WeChat base library 2.14.0 or newer for compressed WASM andset the minimum version in your console. The exported size report separatesinitial and subpackage bytes. Review its budget verdicts before publishing.Use your real AppID and valid ad unit in WeChat DevTools and campaign settings;diff --git a/templates/wechat-minigame/project.esproject b/templates/wechat-minigame/project.esprojectindex cee435626..30c9d0142 100644--- a/templates/wechat-minigame/project.esproject+++ b/templates/wechat-minigame/project.esproject@@ -12,6 +12,6 @@"spineVersion": "none","packaging": {"orientation": "portrait", "compressWasm": true, "engineSubpackage": true,- "profiles": { "wechat": { "platform": "wechat" }, "web": { "platform": "web" } }+ "profiles": { "wechat": { "platform": "wechat", "config": "shipping" }, "web": { "platform": "web", "config": "development" } }}}diff --git a/tools/releaseNotes.mjs b/tools/releaseNotes.mjsindex a1377cb4d..4bc31648d 100644--- a/tools/releaseNotes.mjs+++ b/tools/releaseNotes.mjs@@ -28,6 +28,8 @@ export const NOTES_FLOOR = 'v0.65.0';* the reader recognises anyway.*/export const NOTED = {+ 'perf(templates): minify the WeChat publishing profile':+ { note: "The WeChat starter's publishing profile minifies its game bundle." },'feat(templates): add WeChat gameplay and host-service starter':{ note: 'The WeChat Mini Game starter combines gameplay and host-service examples.' },'feat(templates): ship a complete playable ad starter':diff --git a/tools/tests/wechat-starter.e2e.mjs b/tools/tests/wechat-starter.e2e.mjsindex e3abe892f..bf902bc77 100644--- a/tools/tests/wechat-starter.e2e.mjs+++ b/tools/tests/wechat-starter.e2e.mjs@@ -28,6 +28,8 @@ try {page.on('pageerror',error=>report.errors.push(String(error)));page.on('console',message=>{if(message.type()==='error')report.errors.push(message.text());});await context.route('**/*',route=>{if(route.request().url().startsWith(origin+'/'))return route.continue();report.unexpectedRequests.push(route.request().url());return route.abort();});await page.goto(origin+'/');await page.waitForFunction(()=>globalThis.__wxStarterProbe&&globalThis.__estellaLoading===null,{},{timeout:30000});+ report.sceneInitializedMs=await page.evaluate(()=>performance.now());+ report.timingScope='Local contract-host scene initialization after the loading indicator clears. Not real-device cold startup or official time-to-interactive certification.';const state=()=>page.evaluate(()=>__wxStarterProbe());const tap=async(x,y)=>{await page.touchscreen.tap(360*x,640*y);};for(const x of [.2,.5,.8])await tap(x,.45);await page.waitForFunction(()=>__wxStarterProbe().selected===3);await tap(.5,.96);await page.waitForFunction(()=>__wxStarterProbe().selected===0);diff --git a/tools/tests/wechat-template-profile.test.ts b/tools/tests/wechat-template-profile.test.tsnew file mode 100644index 000000000..2af7dca50--- /dev/null+++ b/tools/tests/wechat-template-profile.test.ts@@ -0,0 +1,15 @@+// SPDX-License-Identifier: Apache-2.0+// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team+import { it, expect } from 'vitest';+import { readFileSync } from 'node:fs';+import path from 'node:path';+import { parseManifest } from '../../pipeline/src/project/format';+import { projectExportOptions } from '../../pipeline/src/export/projectExportOptions';+it('the actual WeChat starter ships minified and its Web authoring profile keeps development settings', async () => {+ const root = path.resolve(__dirname, '../../templates/wechat-minigame');+ const manifest = parseManifest(JSON.parse(readFileSync(path.join(root, 'project.esproject'), 'utf8')));+ expect(await projectExportOptions(root, manifest, 'wechat', 'wechat'))+ .toMatchObject({ minify: true, sourcemap: false, compressWasm: true, engineSubpackage: true });+ expect(await projectExportOptions(root, manifest, 'web', 'web'))+ .toMatchObject({ minify: false, sourcemap: true });+});