Skip to content

v0.34.0

Choose a tag to compare

@tannevaled tannevaled released this 15 Nov 12:34
· 5 commits to main since this release
a3ccc46

wasmcache test kit: a simulated deploy now looks like a real one (#51).

The service worker is unchanged from v0.33.0. This release changes the browser test kit (wasmcache/testkit), which consumers run in their own CI.

The problem in v0.33.0's kit: the kit faked a newer build by changing only the worker and the manifest, while the pages it served kept the old ?v=. A site whose page requests a file with ?v= after the reload got a false failure: the worker sends a request carrying another deploy's ?v to the network by design. go-slides hit this on its video worker:

FAIL /playground/video-worker.wasm cached by the old build was requested 1 time(s) in the new one

In a real deploy, the pages' ?v and the worker's version change together, and the file is served from the copied cache entry.

Now:

  • The simulated build serves its pages with ?v= rewritten to its own version. Every request is still counted.
  • The "unchanged files" checked for 0 requests during an update are derived from the bytes, not from the file type.
  • The kit's own fixture has the shape of a real site: pages carrying ?v=, a lazy file fetched from a dedicated Worker at every load, and two scopes sharing one cache name.

Proof, each a mutation that fails by assertion:

  • With the page rewrite disabled, the test fails with the go-slides message above.
  • With the lazy copy removed from sw.js, it fails at /playground/fonts/f.ttf was stored by the old build and was not copied to the new build's cache.

Upgrade from v0.33.0 if you run the kit in CI.