Repository navigation
Introduce typed asset storage and embed example resources - #80
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Path-only resource loading makes embedded game assets depend on filename lookup adapters. This PR separates resource construction, storage, and identity: construct an
Image,Audio, orFontfrom encoded bytes, then register it withAssets[T]to obtain aHandle[T].Changes
ImageHandle,AudioHandle, andFontHandleare typed handle aliases; the former integer constructors and 3D image registration APIs are removed.Unprepared,Preparing,Ready,Failed). Registration performs no file IO or media decoding.moonbit-community/embed@0.1.3throughdev_build. The games reference generated resource fields directly and reuse handles; remove handwritten path catalogues and fake filesystem readers. Update diagnostics and atlas overlays to support resources without filenames.moonbitlang/x, the browser preloader, and asset manifests. Pages copies only the bundles and static page files, including the arrow-key instruction image.FixedArraythrough the existing JS interop API for method calls, with tests for the currentjs-ffiarray ABI and null handling.Directory inputs still require explicit file dependency lists with the current Moon toolchain; listing a directory alone misses content changes during incremental builds. Generated embedded data is ignored by Git and rebuilt by ordinary Moon commands.
Validation
moon check --target all --deny-warn --warn-list +73moon test --deny-warn --warn-list +73: 446 Wasm and 89 JS tests passed.python3 -m unittest discover -s tests: 30 existing release and ECS API tests passed.moon fmt --check,moon info --target all, pinned codegen freshness checks, andgit diff --check.moon build --target js --release --deny-warn --warn-list +73; verified the Pages copy inputs.