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
Merge pull request #55 from esengine/fix/native-durable-data-dir
yhh46662eb0a384
diff --cc .github/workflows/android-compat.ymlindex 866751e8c,4910b8914..31d070c50--- a/.github/workflows/android-compat.yml+++ b/.github/workflows/android-compat.yml@@@ -68,11 -68,18 +68,17 @@@ concurrencycancel-in-progress: trueenv:- # Android 10. The manifest claims 26, which is a wider promise than anything- # here checks — raising this floor is a decision about what we support, so it is- # stated once, in one place, rather than implied by a matrix.- ANDROID_API_FLOOR: ${{ inputs.api-floor || '29' }}+ # Android 7.0, matching the manifest's minSdkVersion — the promise and the thing+ # that checks it must be the same number, or one of them is decoration. Changing+ # this floor is a decision about what we support, so it is stated once, in one+ # place, rather than implied by a matrix.+ #+ # An emulator below API 28 may have no Vulkan at all, and the host has no GLES+ # path, so those rows can red for the runner's reasons rather than ours. That is+ # a result worth having rather than a reason to hide them: this matrix exists to+ # say which versions work, and "we cannot tell from CI" is one of the answers.+ ANDROID_API_FLOOR: ${{ inputs.api-floor || '24' }}ANDROID_PROFILE: pixel_6- CANARY_EXAMPLES: ${{ inputs.examples || 'space-shooter' }}jobs:# ---------------------------------------------------------------------------diff --cc CHANGELOG.mdindex 3c6d5f21a,deed33f20..e6dae965f--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -14,95 -14,33 +14,120 @@@ published separately; it ships inside t## [Unreleased]+### Added++- **A game's own data is an asset.** A `.json` that is not a Spine skeleton or a+ DragonBones pair — a level table, a tuning file, dialogue — was not an asset at all:+ no `.meta`, no uuid, nothing in the registry, so the only way to read one was to fetch+ its path by hand. That works in the editor, which serves the whole project, and 404s in+ the build, which ships only assets. The failure appears after release and nowhere else.++ It is a type now, `json`, with `assets.loadJson<T>(ref)`. Being a type is the point: a+ data file gets ref resolution (`@uuid:` and manifest paths, so moving it breaks+ nothing), one parse shared by every caller, group and subpackage delivery, and hot+ update — none of which a hand-rolled fetch can have. It is also always included in a+ build, like locale tables and for the same reason: the code that loads it is the only+ thing that names it, so reachability would cull every one.++ Two edges, deliberately: the content sniff still asks Spine and DragonBones first, so+ nothing that was already a skeleton becomes data; and the project's own configuration+ (`package.json`, `tsconfig.json` and their kind) never becomes an asset.++### Fixed++- **An export's output is no longer mistaken for the project's content.** `dist/` and+ `build/` were excluded; `dist-web/`, `dist-android/`, `dist-wechat/` and the rest were+ not — so the registry adopted a finished build's assets as if they had been authored,+ and they show up in the Content Browser. Harmless while nothing forced them into a+ build; with data assets always included, the next build would have shipped the previous+ one's manifest inside itself. Any `dist-*` folder is build output now.++- **Checking for updates showed nothing, and could show nothing forever.** The toast was+ posted only once the network had answered, so Help ▸ Check for Updates was a click with+ no visible effect for as long as the request took — and the requests had no timeout at+ all. `catch` catches a connection that fails, not one that is accepted and then never+ speaks, which is exactly what a filtered network does: the promise never settled, the+ command waited on it forever, and nothing was ever shown. Each source now gets six+ seconds, including the one electron-updater asks (which exposes no timeout of its own,+ so it is raced against a deadline).++ With that fixed, the answer can be honest. "No update" and "nobody answered" used to be+ the same `null`, reported the same way — a machine that had reached neither the mirror+ nor GitHub was told, in green, that it was up to date. The check now reports three+ outcomes, and the unreachable one offers the download page instead of a reassurance it+ has not earned.++- **A download that reported nothing looked like a download that had stopped.** Progress+ was a percentage inside a line of text, which sat at "0%" through connect, redirect and+ the whole of a differential download's first phase. Toasts can carry a progress bar now:+ indeterminate while there is nothing to be a percentage of, then the real figure with the+ download's size next to it. The line is also pinned while the download runs and re-posts+ itself if it was closed — the download outlives its toast, and "Restart" was the only way+ to install what it had just fetched.++- **One release, announced once.** The startup check and the menu item both raise the same+ notification, so clicking Check for Updates in the first seconds after launch answered+ with two identical lines. Announcing once does not mean announcing only once ever: a+ download that failed can be offered again, which running the real thing turned out to be+ the case that mattered.++- **A toast action no longer throws away the line it just wrote.** Pressing a toast's button+ always dismissed the toast, which is right for an action that leaves (open a page, restart)+ and wrong for one that keeps reporting on that same line: pressing Download blanked the+ screen for the second before the first byte report, right where the "did my click do+ anything" doubt lives.++### Added++- **A UI node can say that it arrived on screen, or left it.** Everything a panel does when it+ appears — play the entrance, start the timer, refresh the count — had no event to hang on,+ because a node does not go away by itself: an ANCESTOR's `display` changed, and every node+ under it stopped being drawn without being told. The only way to notice was to walk the parent+ chain of every animated node, every frame, re-deriving what the layout pass had already+ computed. `shown` and `hidden` are those two moments on the same channel as `click`, so the+ answer is an EventBinding row rather than a system, and the whole subtree is told rather than+ just the node whose field changed.++ Visibility is read as the engine's own resolved bit, the same one rendering and hit-testing+ use, so it cannot drift from what you can see. That bit is reachable one entity at a time,+ which makes the scan the entire cost of the feature — so it is gated twice, and on a steady+ frame it is nothing: no listener, no scan (`EntityEventQueue.hasListenersFor` makes that O(1)),+ and no scan on a frame where no UINode was written and nothing moved in the hierarchy — the+ same pair of signals the layout solve and the physics reconcile already gate on. Measured in+ a real UI of 112 nodes: 0 reads per idle frame, one full pass on the frame a panel is toggled.++ ### Changed++ - **Android's minimum is API 24 (Android 7.0), lowered from 29.** The floor was 29+ because the font path called `AFontMatcher_create` and nothing below it could+ answer; on 24 through 28 the engine now picks the font out of `/system/fonts`+ itself, asking each candidate whether it has a glyph for the character rather+ than trusting a family name. Read the Vulkan requirement alongside this: it is+ unchanged and still `required="true"`, and it filters far more devices than the+ API level does, so what 24 adds is Android 7/8-era hardware that has a Vulkan+ driver — not every phone on those releases. The compatibility matrix now starts+ at 24; emulators below API 28 may have no Vulkan, so those rows can report "no+ data" rather than a verdict.+### Fixed+- **The mock-wasm test harness left every engine-calling plugin inert.** `bootMockApp` connected+ the world but not the App, and `engineApi(app)` answers with the App's module — so plugins that+ reach the engine optional-chained it away and their engine branches never ran under test. They+ passed, silently testing less than they read as testing.++ - **Saves no longer live in a directory the platform may delete.** Key/value+ storage went to the host's cache directory, whose stated purpose was the+ regenerable bytecode cache. On iOS that is `NSCachesDirectory`, which the system+ empties when it wants the space back and no backup includes — so a player's+ saves and settings could vanish between launches. Android put the same file in+ `files/`, which nothing reclaims: one API, two opposite promises. There is now a+ durable directory distinct from the reclaimable one (Application Support on iOS,+ `internalDataPath` on Android) and storage writes there. Android's cache+ directory is also a real cache directory now, so the hot-update store can be+ reclaimed instead of growing forever. Writes go through a temp file and a+ rename, so a kill mid-write cannot truncate a save.+## [0.40.0] - 2026-08-02The agent went from working to being pleasant to work with. It answers from the keyboard