Skip to content

v1.7.3

Latest

Choose a tag to compare

@github-actions github-actions released this 09 Nov 14:44
· 2 commits to master since this release
499fa8e

What's New

v1.7.3 fixes a Service Worker bug where returning users could lose offline caching, and reduces the work Flashbang does before and during the first redirect. The language-edition table from v1.7.2 is no longer part of the cold first-redirect bundle unless the destination actually has per-language editions, and worker startup evaluation drops from 0.22 ms to 0.05 ms in V8.

This release does not change bang or snap syntax, settings or IndexedDB schemas, settings exports, or persisted user data.

Offline catalog fix

  • Load index shards before publishing hot frecency. Production builds load the catalog in index shards, and a fresh worker decodes only the shard that holds the default bang. Publishing the hot-boot record looked up every frequently used bang. When one of those bangs lived in a shard that hadn't been decoded yet, the lookup threw BangShardUnavailableError. The error was swallowed but still aborted warmRuntime before warmAllCatalogShards ran. As a result, the full offline catalog was never cached and the personalized hot-boot record was never published. The worker now decodes the shards it needs, through the index runtime, before it materializes frecency entries.
  • Test the runtime production actually ships. This bug has been present since the sharded string store in v1.7.1, and the existing worker suite only exercised the monolithic catalog. A new sw-index-runtime suite runs a worker against the production index and string-store globals.

Lighter cold first redirect

  • Split tag parsing from edition data. Tag canonicalization, setting validation, and the {lang} shapes now live in a small locale-tag module. locale-table holds only the edition data and has no runtime imports, so it builds as one standalone content-hashed asset: locale-table-[hash].js, which is 5.0 KiB minified and 1.6 KiB Brotli.
  • Import the table only for a {lang} destination. The cold resolver tries the redirect first. If the destination carries a {lang} marker, substitution reports the table as missing, and the resolver imports the asset and retries once. !gh and every other unmarked bang never download it. Any language setting read before the table loads is held and applied on the first substitution.
  • Keep the eager path where it costs nothing. The Service Worker, the full-page fallback, and the settings UI already hold the whole catalog, so they install the table at startup through locale-table-install.
  • Guard the split from both sides. A fresh-process unit test fails if anything on the cold import graph installs the table eagerly. A Playwright test checks that a real cold !w navigation fetches the table and a cold !gh navigation does not. The asset is served with immutable caching on Cloudflare Pages and counts as a required app asset in the build.

Faster worker startup

  • Create shard-unavailable errors on first miss. createShardRuntime used to build one frozen Error per shard up front. The worker creates two runtimes at startup, so every start captured 86 stack traces for errors that are only thrown when a shard is missing. That was about 80% of the worker's top-level evaluation, which now drops from 0.22 ms to 0.05 ms in V8. The cold-fallback page shares the same runtime.
  • Keep the identity guarantee. Each error is still created at most once per shard and then reused, so unavailableShardId still matches by identity and a forged error with the same shardId is still rejected.
  • Report it as a CPU saving. A browser A/B on restart latency stayed within noise. This change lowers startup CPU but does not measurably change redirect latency.

Benchmark and test harness fixes

  • Measure worker restart from a same-origin page. The private-profile restart loop started each measurement from the previous redirect's cross-site page, while the minimal-worker floor started from a same-origin page. Headless Chromium had to spawn a renderer for the restarted worker, which added about 20 ms that the floor never paid. A do-nothing worker restarted from the same cross-site page also reads about 21.7 ms, so the gap came from the harness, not from Flashbang. Navigating to /health first makes the two comparable: restart now reads 3.56 ms against a 2.82 ms floor.
  • Stay under Firefox's navigation rate limit. Firefox blocks a window after 200 navigations in 10 seconds. The in-app paired navigation benchmark ran 5 warmup rounds plus up to 100 measured rounds of two navigations each, so a fast run hit the limit and aborted with a navigation timeout. A run is now capped at 190 navigations, which allows 90 measured rounds.
  • Fix an order-dependent test failure. The index-runtime suite left __CACHE_VERSION__ set after importing its worker. When Bun ran that file first, six hot-boot and cache-cleanup tests ran under the wrong cache name and failed.

Tooling and maintenance

  • CI now enforces coverage on the line-weighted total that the coverage badge reports, with a minimum of 95%. It replaces bunfig's coverageThreshold of 97% lines and 90% functions, which Bun applied to each file separately. Handler and codegen tests were added to cover the paths the new gate exposed.
  • The documentation tree check now lists locale-tag.ts and locale-table-install.ts. The production-build workflow test gets a longer timeout, because it still runs catalog generation and the Brotli pass for real, which takes 2.5 s on an M4 Max and longer on a CI runner.
  • The suite has 743 tests and 100,496 assertions, up from 729 and 100,221 in v1.7.2.
  • The bang catalog has 14,674 triggers, up from 14,627.
  • Bun moves from 1.4.0 to 1.4.4 in packageManager, the Docker builder and runtime images, and every workflow. Biome moves to 2.6.5, Playwright to 1.65, UnoCSS to 66.12, and @types/bun to 1.4.4. Pinned GitHub Actions were bumped through Dependabot.

Validation

  • Local validation passed code generation and all 743 Bun tests with 100,496 assertions.
  • Release-preparation CI passed code generation, TypeScript, Biome over 168 files, a dependency audit with no known vulnerabilities, all 743 Bun tests, the production build, the Docker health gate, and the Chromium, Firefox, and WebKit projects before it merged the automated 1.7.3 package-version pull request.
  • The tag workflow revalidated v1.7.3 and its master ancestry, and repeated code generation, TypeScript, Biome, the audit, all tests, and the production build. It then health-checked, published, attested, signed, and verified ghcr.io/ph1losof/flashbang:1.7.3 and latest at sha256:7b98247a1ee7f4278fcf98daeedca60b41f7e0feb4a17c5901216a2452f460d5.

Full Changelog: v1.7.2...v1.7.3