Fix WebGL builds: emscripten-safe jslib syntax + crash-safe key stripper stash#1
Open
blockmaker-ai wants to merge 3 commits into
Open
Fix WebGL builds: emscripten-safe jslib syntax + crash-safe key stripper stash#1blockmaker-ai wants to merge 3 commits into
blockmaker-ai wants to merge 3 commits into
Conversation
Unity's emscripten acorn-optimizer (JSDCE/minify pass) cannot convert dynamic import() and optional-chaining AST nodes, failing every WebGL build that includes this plugin with 'MOZ_TO_ME[node.type] is not a function'. Rewrite the 5 dynamic imports via Function-constructor indirection (string bodies are not parsed) and the 3 optional chains as explicit guards. Behavior unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
SessionState dies with the editor session — a failed/cancelled batchmode build exits before OnPostprocessBuild, losing the stash and permanently blanking every BlockmakerConfig apiKey. A Library/ file survives editor restarts, so the InitializeOnLoadMethod safety net can actually restore. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Brings the branch up to dev's head (17 commits): Pera-on-WebGL via the official @perawallet/connect (WCv1, vendored-first), step-2 sign-in RESEND/CANCEL UX, SessionRestoreSettled, session-gated balance/profile polling, build-safe UI glyphs, and dev's independent duplicate of this branch's emscripten jslib fix (6e53795 supersedes f5b8a56 where they touched the same xchain optional chains). Reconciliation on top of the auto-merge: dev's new Pera loader section introduced two bare dynamic import() calls (@perawallet/connect, algosdk) — the exact AST node Unity's emscripten acorn pass cannot parse ('MOZ_TO_ME[node.type] is not a function'), which is this branch's whole reason for existing. Rewrote both via the same Function-constructor indirection f5b8a56 used; behavior unchanged. The branch's unique key-stripper commit (74032f7: stash to Library/ file, not SessionState; restore gated on !BuildPipeline.isBuildingPlayer) is untouched by dev and survives intact. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Two fixes discovered building Polaris for WebGL:
Wallet bridge jslib broke every WebGL build: emscripten's acorn-optimizer cannot convert dynamic
import()and optional-chaining AST nodes (MOZ_TO_ME[node.type] is not a function). Rewrote the 5 dynamic imports via Function-constructor indirection and the 3 optional chains as explicit guards. Behavior unchanged; syntax-checked.Key stripper could permanently blank apiKeys: the SessionState stash dies with the editor session, so a failed/cancelled batchmode build (exactly what a broken jslib causes) lost the stash before restore. Stash now lives in
Library/blockmaker-stripped-keys.json, which survives restarts so the InitializeOnLoadMethod safety net actually works. Verified red→green in a consumer project.🤖 Generated with Claude Code