Changeset 87696ce in Klonkt


Ignore:
Timestamp:
08/18/2026 06:47:58 PM (3 weeks ago)
Author:
Bart <bart@…>
Branches:
main
Children:
847775c
Parents:
85b51bf
git-author:
Bart <bart@…> (08/18/2026 04:37:05 AM)
git-committer:
Bart <bart@…> (08/18/2026 06:47:58 PM)
Message:

De mod/-modules krijgen een cache-buster: MOD_V

/assets staat buiten development op max-age=1y, en de dynamische import van
assets/js/mod/*.js had als enige geen ?v= -- style.css, audio.css en
audio-player.js hebben er al jaren een. Gevolg: wie de pagina eerder bezocht,
draaide een jaar lang de oude module. Een reparatie bereikt dan precies de
bezoekers die de fout al hebben.

Gemerkt bij read.js: de gerepareerde module stond goed op de server (curl
bevestigde het) maar de browser bleef de oude draaien, ook na herladen en na het
wissen van de service-worker-caches. En de hernoemde klasse maakte het zichtbaar:
oude JS zet read-chrome-weg, nieuwe CSS luistert naar read-chrome-hidden, dus de
balken schoven bij die bezoekers helemaal niet meer weg.

Eén nummer voor de hele map, met de hand te bumpen; de regel staat nu ook in
CLAUDE.md en AGENTS.md, want een discipline die nergens staat is er geen.

Co-Authored-By: Claude Opus 5 <claude@…>

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • AGENTS.md

    r85b51bf r87696ce  
    3636- `apt-get` - use `-y` flag
    3737- `brew` - use `HOMEBREW_NO_AUTO_UPDATE=1` env var
     38
     39## Conventions & Patterns
     40
     41- **Bump `MOD_V` whenever you change anything in `src/assets/js/mod/`.** It sits
     42  at the top of the module loader in `src/views/shell.ejs` and is the
     43  cache-buster for every page module. `/assets` is served `max-age=1y` outside
     44  development, so without a bump a browser that visited before keeps running the
     45  old module for a year — meaning a fix reaches everyone *except* the people who
     46  already have the bug. Same discipline as `audio-player.js?v=N` a few hundred
     47  lines up. One number for the whole directory: bumping too often costs one
     48  download, bumping too rarely costs a bugfix that never arrives.
     49
     50- **Comments and commit messages in Dutch, identifiers in English.** The modules
     51  in `assets/js/mod` read `setIcon`, `uploadOne`, `applyAccent`; the comments
     52  around them are Dutch prose. Both halves matter — a Dutch identifier in an
     53  English file is the same wrong note as an English comment in a Dutch one. This
     54  extends to anything long-lived and outward-facing: URL paths and CSS class
     55  names are English (`/read`, `.read-end`), never a Dutch verb form.
    3856
    3957<!-- BEGIN BEADS INTEGRATION v:1 profile:minimal hash:7510c1e2 -->
  • CLAUDE.md

    r85b51bf r87696ce  
    7272## Conventions & Patterns
    7373
    74 _Add your project-specific conventions here_
     74- **Bump `MOD_V` whenever you change anything in `src/assets/js/mod/`.** It sits
     75  at the top of the module loader in `src/views/shell.ejs` and is the
     76  cache-buster for every page module. `/assets` is served `max-age=1y` outside
     77  development, so without a bump a browser that visited before keeps running the
     78  old module for a year — meaning a fix reaches everyone *except* the people who
     79  already have the bug. Same discipline as `audio-player.js?v=N` a few hundred
     80  lines up. One number for the whole directory: bumping too often costs one
     81  download, bumping too rarely costs a bugfix that never arrives.
     82
     83- **Comments and commit messages in Dutch, identifiers in English.** The modules
     84  in `assets/js/mod` read `setIcon`, `uploadOne`, `applyAccent`; the comments
     85  around them are Dutch prose. Both halves matter — a Dutch identifier in an
     86  English file is the same wrong note as an English comment in a Dutch one. This
     87  extends to anything long-lived and outward-facing: URL paths and CSS class
     88  names are English (`/read`, `.read-end`), never a Dutch verb form.
  • src/views/shell.ejs

    r85b51bf r87696ce  
    496496  window.__modBoot = true;
    497497
     498  // ?v=N — cache-buster voor ALLE modules in assets/js/mod, net als bij
     499  // audio-player.js hierboven. BUMP BIJ ELKE WIJZIGING IN DIE MAP. Zonder
     500  // query staat /assets op max-age=1y, en dan blijft een browser die de
     501  // pagina eerder bezocht een jaar lang de oude module draaien: een
     502  // reparatie bereikt precies de bezoekers die hem al hebben.
     503  // Eén nummer voor de hele map. Te vaak bumpen kost één download; te weinig
     504  // bumpen kost een bugfix die nooit aankomt.
     505  var MOD_V = 1;
     506
    498507  // name -> 1 (aan het laden) of de module-namespace (geladen). Een module
    499508  // die `init` exporteert draait die bij ELKE paginawissel waarop hij actief
     
    514523      if (loaded[name]) { start(name, loaded[name]); return; }
    515524      loaded[name] = 1;
    516       import('/assets/js/mod/' + name + '.js').then(function (m) {
     525      import('/assets/js/mod/' + name + '.js?v=' + MOD_V).then(function (m) {
    517526        loaded[name] = m;
    518527        start(name, m);
Note: See TracChangeset for help on using the changeset viewer.