Repository navigation
Daily dead-code sweep 2026-09-27: the #chips compatibility shim, expiry met - #147
Open
EnesYilmazcode wants to merge 4 commits into
Open
EnesYilmazcode wants to merge 4 commits into
EnesYilmazcode wants to merge 4 commits into
Conversation
…expiry met #85 (commit 867c4d4, 2026-09-02) deleted the duration-chip radiogroup and left an empty `<div id="chips" hidden>` in index.html so that any client still running the pre-#85 app.js (cached by the service worker, which serves navigations network-first but everything else cache-first) would not hit a TypeError on its first `attachChips()` call after the deploy. The comment that introduced it says plainly when it can go: "Once a release has shipped with it, no cached app.js reaches for #chips any more and this can go." 25 days and 64 commits (dozens of merged, deployed PRs) have shipped since that commit, so the shim has done its one job many times over. Removed the div and its comment, and the scripts/test/screens.test.mjs test that pinned its presence and wording. The sibling test asserting no #chips CSS rule or JS reference exists is untouched and still passes. index.html shrank by ~620 gzipped bytes; re-measured and updated sw.js's header comment and re-ran scripts/stamp-sw.mjs accordingly. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RUtU2jqDkfDxwyLjYkHHNK
Resolves the sw.js conflict in the stamped shell-size comment and SHELL_CACHE line: both branches had independently restamped it since this PR's base. Keeps the merge, re-stamps SHELL_CACHE for the new merge commit via scripts/stamp-sw.mjs, and recomputes the gzip Shell/ data byte figures in the header comment (and the README's rounded KB figure) for the actual merged tree per scripts/test/sw.test.mjs's own measurement method. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RUtU2jqDkfDxwyLjYkHHNK
Resolves a second sw.js conflict on the SHELL_CACHE line: main re-stamped it again (PR #168) since the last merge. Keeps the merge, re-stamps SHELL_CACHE for the new merge commit via scripts/stamp-sw.mjs, and recomputes the gzip Shell/data byte figures (and README's rounded shell KB figure) since #168 also touched js/app.js, js/map.js and js/sheet.js, all shell assets. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RUtU2jqDkfDxwyLjYkHHNK
# Conflicts: # sw.js
This branch has not been deployed
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.
Automated daily dead-code sweep.
node --testbaseline was green (932 tests, 928 pass, 4 skipped) before any change.Open sweep PRs checked against first: #143 (
deadcode/2026-09-22, removesallWeekCodes), #144 (deadcode/2026-09-23, removesbestGapandinScheduledHours), and #146 (deadcode/2026-09-24, removesinBounds). I read all three diffs in full. Nothing in this PR overlaps what they remove, and those four symbols were excluded from consideration here as already claimed.Method
node scripts/check-dead-code.mjscame back clean (110 files, no dead code). I also ran a corrected variant of its own algorithm looking specifically for exports referenced only from test files (the shape all three open PRs above found) — that surfaced 15 candidates, but every single one turned out to be a false positive once cross-checked againstdev/*.htmlandspikes/*.html: the static checker never walks.htmlfiles at all, so anything imported only fromdev/index.html,spikes/walk.html,spikes/launch.htmletc. looks test-only to it when it isn't (e.g.toLonLatis used live bydev/index.html). Two more (resetRequests/setRequestsinscripts/lib/fetch.mjs) are explicitly documented test-only hooks ("Tests only, so the cap can be exercised without making 3000 stub calls"), and five more (fieldShape/distanceLearningMode/onlineStillExists/buildingJoin/harvestAxisinscripts/live-rot-checks.mjs) are called byscripts/test/live-rot.live.test.mjs, the live-network canary the file's own header says is their only intended caller. None of those are dead.I also statically cross-checked every CSS class/id selector in
index.html's stylesheet, every<symbol id>in the SVG sprite, and everydata-*attribute name againstjs/*.js,index.html, anddev/*.html: all of them have both a writer and a reader somewhere. Nothing there.That left one more category from the brief: "code a comment marks for removal whose condition is now met." A grep for removal-note language turned up exactly one hit, and I verified its condition rather than trusting the label — see below.
I did not build the full CDP runtime-coverage harness this run (
Profiler.startPreciseCoverage/CSS.startRuleUsageTrackingdriving pinned-clock states, the way #146 did). The finding below doesn't need it — it's proven by grep and git history, not by what the browser executes — but that also means I'm not claiming the coverage sweep's kind of exhaustiveness this time. Anything only a runtime sweep would catch is left for tomorrow.Removed: the
#chipscompatibility shim,index.html:1106-1123(most certain)What it was: #85 (commit
867c4d4, 2026-09-02) deleted the duration-chip radiogroup and itsattachChips()/paintChipswiring fromjs/app.js. Becausesw.jsserves navigations network-first but everything else cache-first, the very next deploy after that PR risked pairing a freshindex.htmlwith a stale, cachedjs/app.jsthat still calledattachChips()as the second statement of itsDOMContentLoadedlistener — aTypeErroron a missing#chipsnode, before$('back').onclick, popstate,attachSheet()orboot()ever get wired, i.e. a frozen "finding campus..." screen with no way out for anyone who had the old app.js sitting in their service-worker cache. The empty, hidden<div id="chips">was scaffolding to keep that onequerySelectorAllfrom throwing.The condition, and how I verified it: the comment states its own expiry plainly — "Once a release has shipped with it, no cached app.js reaches for #chips any more and this can go." That shim (comment included) has been present, unchanged, in every commit since
867c4d4.git log 867c4d4..HEADshows 64 commits and 25 days elapsed (2026-09-02 → 2026-09-27), across dozens of merged, deployed PRs — this static site has no build step, so every merge tomainis itself a deploy. The shim only ever needed to survive the single transition immediately after867c4d4; every deploy since has shipped a same-generationapp.jsthat no longer callsattachChips()at all, so any client that has loaded the app even once since 2026-09-02 (a service worker checks for updates on activation, andjs/pwa.jsreloads once when untouched) is long past the risk window.grep -rn "attachChips\|#chips\|\.chip\b"acrossjs/,index.html(outside the shim's own comment),dev/,scripts/(non-test) andspikes/finds nothing else — the only production code that ever referenced it was the code #85 already deleted.What would make me wrong: a real installed client somewhere that hasn't opened the app since before 2026-09-02 and whose service worker never independently updated in the 25 days since. I can't rule that out with certainty for every phone on the planet, but the comment's own bar was "one release," not "every possible installed client forever," and that bar has been cleared by a wide margin.
What I did: removed the comment and the
<div id="chips" hidden>fromindex.html. Removed the test inscripts/test/screens.test.mjs("the #chips node left behind for the old shell is empty, and dated") that asserted the shim's presence and wording — it existed only to guard this exact scaffold. Left the sibling test ("the duration chips are gone from the page, not merely hidden on it") untouched; its assertions about.chip/attachChips/paintChipsbeing absent from the live app are still true and still worth keeping.Deleting ~700 bytes of markup moved
sw.js's measured shell gzip figure from 164,286 to 163,666 bytes (well inside the test's 1% tolerance, but I re-measured with the samegit show HEAD:<file> | gzip -9 -c | wc -cmethod the header names and updated it for accuracy) and re-rannode scripts/stamp-sw.mjs.node --test(931 tests now — one fewer, the deleted shim test — 927 pass, 4 skipped, still green),node scripts/check-dead-code.mjs(clean), andnode scripts/shoot.mjs --check(all five frames pass, no problems) after the change.Not removed, not proven
?dev=1, offline reload, etc. this time, so anything only reachable-but-actually-dead code hiding behind those states is unexamined today, not ruled out.data-*hooks, test-only-looking exports) checked out as live once cross-referenced againstdev/*.htmlandspikes/*.html, which is exactly why nothing else is in this PR.🤖 Generated with Claude Code
https://claude.ai/code/session_01RUtU2jqDkfDxwyLjYkHHNK
Generated by Claude Code