Faza 3: modularizarea stratului DOM (script.ts → 10 module)#42
Merged
Conversation
Pure code movement — no behavior change, proven by the untouched e2e suite. script.ts (757 lines) becomes: - dom.ts el<T>() helper + shared element references - labels.ts user-facing texts (single source of truth) - cloudinary.ts status image URLs + offline pre-cache - storage.ts last-station persistence - soundEffects.ts audioInstance (blob preload, warmUp, ensure) + cache - mediaSession.ts Now Playing metadata/handlers + iOS re-registration - serviceWorker.ts registration + deferred idle-time reload - theme.ts prefers-color-scheme theme color - stationSelector.ts accessible listbox, reports picks via onSelect() - main.ts entry point: wiring only, same execution order Notable seams: - the core<->mediaSession cycle is resolved by explicit injection (initMediaSession before createRadioCore, connectMediaSessionCore after) instead of a mutable let; - mediaSession no longer calls into serviceWorker — main composes updateMediaSession + maybeReloadForPendingServiceWorkerUpdate in the deps, preserving the original order. Bundle output unchanged (single js/index.js chunk), so sw.js APP_SHELL needs no bump. Typecheck clean, 63/63 unit, 37/37 e2e untouched, full production-preview smoke passing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
CI Summary
|
…channel) 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.
Ce face
Faza 3 din planul de migrare (
plan.md):script.ts(757 de linii, monolit) devine 10 module cu responsabilitate unică. Mutare pură de cod — zero schimbări de comportament, dovedită de suita e2e neatinsă.main.tsdom.tsel<T>()+ referințele DOM partajatelabels.tscloudinary.tsstorage.tssoundEffects.tsaudioInstance(blob preload, warmUp, ensure) + cache sunetemediaSession.tsserviceWorker.tstheme.tsstationSelector.tsonSelect()Cusături demne de menționat:
core ↔ mediaSessione rezolvat prin injectare explicită (initMediaSessionînainte decreateRadioCore,connectMediaSessionCoredupă) — fărălet coreglobal mutabil.mediaSessionnu mai știe deserviceWorker:maincompuneupdateMediaSession+maybeReloadForPendingServiceWorkerUpdateîn deps, în aceeași ordine ca înainte.js/index.js→APP_SHELLdin sw.js neschimbat, fără bump de cache.Verificare
tsc --noEmitcurat • ✅ Unit 63/63 (neatinse) • ✅ E2E 37/37 — suita neatinsă, dovada refactorului • ✅ Build (structură identică) • ✅ Smoke complet pevite preview🤖 Generated with Claude Code