fix(examples): release JSClosures on every teardown path in MissionControl + SwiflowUIDemo#260
Merged
Merged
Conversation
…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>
📦 Bundle size
✅ Within budget (≤5% growth allowed). Baseline: Swift 6.3, WASM SDK 6.3-RELEASE, measured 2026-06-18. |
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.
Audit backlog B8 (Part-2 Mediums): shipped templates teaching the wrong closure ritual.
Geolocation: its privateClosureRetainerclaims to mirrorPersistentStore's pattern but droppedreleaseAll()—retainer.closures = []leaves both handler closures pinned insharedClosuresper geolocation call. Now carries the canonicalreleaseAll()(self-release inside the firing closure's own body is the sanctioned pattern).Shell.stopHashListener: removed thehashchangelistener and nil'd the field withoutrelease()— the exact gapBrowserNavigator.stopListening(its documented model) closes.EmbeddedTemplates.swiftregenerated (embed-freshness gate); MissionControl + SwiflowUIDemo wasm builds pass locally; whole-packageswift test: 1904 green.🤖 Generated with Claude Code