Skip to content

fix(examples): release JSClosures on every teardown path in MissionControl + SwiflowUIDemo#260

Merged
zzal merged 1 commit into
mainfrom
fix/template-closure-releases
Jul 20, 2026
Merged

fix(examples): release JSClosures on every teardown path in MissionControl + SwiflowUIDemo#260
zzal merged 1 commit into
mainfrom
fix/template-closure-releases

Conversation

@zzal

@zzal zzal commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Audit backlog B8 (Part-2 Mediums): shipped templates teaching the wrong closure ritual.

  • MissionControl Geolocation: its private ClosureRetainer claims to mirror PersistentStore's pattern but dropped releaseAll()retainer.closures = [] leaves both handler closures pinned in sharedClosures per geolocation call. Now carries the canonical releaseAll() (self-release inside the firing closure's own body is the sanctioned pattern).
  • SwiflowUIDemo Shell.stopHashListener: removed the hashchange listener and nil'd the field without release() — the exact gap BrowserNavigator.stopListening (its documented model) closes.

EmbeddedTemplates.swift regenerated (embed-freshness gate); MissionControl + SwiflowUIDemo wasm builds pass locally; whole-package swift test: 1904 green.

🤖 Generated with Claude Code

…ntrol + SwiflowUIDemo

MissionControl's Geolocation copied PersistentStore's ClosureRetainer
pattern but dropped the load-bearing releaseAll() — clearing the array
leaves both handler closures pinned in JavaScriptKit's static table on
every geolocation call. SwiflowUIDemo's Shell removed its hashchange
listener without release(), the same gap its stated model
(BrowserNavigator.stopListening) closes explicitly. Shipped templates
teach the closure ritual; both now demonstrate the correct one.

EmbeddedTemplates regenerated; both examples wasm-build locally;
whole-package swift test: 1904 green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

📦 Bundle size

Artifact Baseline This PR Δ
App.wasm 5.06 MB 5.23 MB +3.45%
App.wasm (gzip) 1.80 MB 1.87 MB +3.56%
JS runtime 54.5 KB 54.5 KB +0.00%
JS runtime (gzip) 11.3 KB 11.3 KB +0.00%
Total (gzip) 1.81 MB 1.88 MB +3.54%

✅ Within budget (≤5% growth allowed).

Baseline: Swift 6.3, WASM SDK 6.3-RELEASE, measured 2026-06-18.

@zzal
zzal merged commit 5e28f51 into main Jul 20, 2026
21 of 24 checks passed
@zzal
zzal deleted the fix/template-closure-releases branch July 20, 2026 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant