Repository navigation
Do we want a build step? (cache-busting, TypeScript, and a possible React migration are all the same decision) #450
Replies: 2 comments
|
Kat's call: closer to near-term than someday-maybe. The reasoning is the right one -- the app grew from a single team to multi-team with several integrations and a large tab surface, and globals + So the useful question becomes: what open work is now at risk of being done twice? Audit below. This isn't a decision, it's a map -- but it does change what's worth picking up next. Throwaway if React lands -- don't spend effort here now
Durable regardless -- safe to do now
The one that should jump the queue#359 and #360 are the same root cause, and #360 is not cosmetic:
That is a fairness bug affecting real loot decisions, it's silent, and it's fully durable work. It should probably outrank the rest of the frontend queue on merit alone, independent of React. #359 is the proper fix (key by character identity, which the database already models correctly); #360 is the cheap symptom fix. Worth deciding whether to do #359 once, rather than #360 now and #359 later. The genuinely hard call: the Accessibility milestone9 open issues (#435-#442, #369). Most of it is ARIA/semantics on markup that a rewrite regenerates, so doing it now means doing much of it twice -- but "defer accessibility" also means the site stays inaccessible for however long the React question takes, and that's a real cost to real users, not just a scheduling one. Honest framing rather than a recommendation:
My suggestion: ship #435, hold the markup sweep, and revisit the moment the React timeline firms up. But this is a values call as much as an engineering one, so it's yours. Proposed near-term order
And the original trigger for all this: no |
|
Small addendum found while chasing a "buttons lose their styling until hard refresh" report today. Confirmed via Practical effect: for up to 10 minutes after any push, a normal refresh can serve a browser-cached copy of Decided to just live with it for now (hard-refresh when verifying a deploy went live), but flagging it here because it's a second, independent reason to move off GitHub Pages if/when the React build step happens -- not just for the bundler/content-hashing win already discussed above, but because a host with real header control would let the HTML shell specifically be no-cache while long-caching the fingerprinted bundle output. Worth deciding alongside the build-step question rather than revisiting it in isolation later. |
Uh oh!
There was an error while loading. Please reload this page.
Why now
#431 (stale-cache CSS/JS after deploy) forced a small decision that turns out to be a proxy for a much bigger one.
GitHub Pages serves every asset with
Cache-Control: max-age=600and gives us no way to configure that. So to stop browsers running fresh HTML against stale CSS after a deploy, PR #449 stamped?v=<VERSION>onto 31 asset tags acrossindex.html/officer.html/admin.html, plus a CI check to keep them in sync withjs/common.js'sVERSION.That works, and it shipped. But it means a version bump now touches 31 tags. The obvious cleanup is a small script that stamps them mechanically from
VERSION.That script is throwaway work if a build step is coming. Any bundler solves this natively with content-hashed filenames (
common.a3f9c1.js) -- no?v=tags, no sync script, no CI check, and strictly better cache behavior (unchanged files keep their hash and stay cached across deploys, instead of every asset being invalidated on every bump).So before I write that script, it's worth asking the real question.
The actual question
Do we want a build step? Right now we deliberately don't have one, and that has been a real, defended position -- #331 says it plainly:
and then names the exact escape hatch:
A React migration is precisely "a build step arriving for other reasons." So this isn't three independent choices -- it's one hinge that several open threads hang off:
?v=tags, the sync script, and the CI check all get deleted.What we'd actually be signing up for
Being honest about the size of it, because "switch to React" is easy to say:
The codebase today: ~15,200 lines of JS across 26 files, 3 HTML entry points, ~1,000-line
officer.html, 18 tab modules, no components, no modules (plain<script>tags and global functions/vars, withDATAas a shared global).Costs that are easy to underestimate:
js/common.jsthrough avmsandbox harness that works because it's a plain browser script whosevar/functiondeclarations land on a fake global. A module/JSX world obsoletes that harness -- those tests get rewritten, not ported.innerHTMLarchitecture doesn't survive contact with React; every tab becomes components with real state. Incremental migration is possible (island-by-island) but it means running both worlds for a while.What we'd get:
innerHTMLstring building -- the officer tabs especially.What I'd suggest
Not a decision, just a sequencing proposal to react to:
?v=sync script and just eat the 31-tag bump (CI already catches it if we forget -- it fails the PR, it can't silently ship). If React is not happening, write the script and stop thinking about it.So the question that actually unblocks me: is React a real near-term intention, a someday-maybe, or a passing thought? I'll write the sync script or not based on the answer -- and if it's a genuine maybe, the cheapest thing is to leave #431 exactly as it shipped and revisit.
Open questions
All reactions