v4.13.0
·
75 commits
to main
since this release
Focus: keeping long-lived reader sessions in sync with the latest deploy — an update notification banner and automatic recovery from stale-chunk navigation failures.
Changes
- 🔄 Added the update notification: when a newer build of the documentation goes live, open tabs show a floating, theme-colored banner at the top — "Updated content is available. Please refresh the page." — with Refresh and Dismiss actions. Enabled by default in production builds, localized via the new
system.update.*i18n keys (en-USandpt-BRengine defaults, overridable per project). - 🏗️ Every production build now stamps a build ID — the Cloudflare Pages commit SHA (
CF_PAGES_COMMIT_SHA), aDOCSECTOR_BUILD_IDoverride, or a per-build timestamp — baked into the bundle and emitted asversion.jsonat the site root, with aCache-Control: no-cacherule appended to the generated_headersso CDNs always revalidate it. - 📡 The running app polls
version.jsononce shortly after load, on a fixed interval while the tab is visible, and on tab re-focus (throttled) — degrading silently when the file is missing or the network is down. - ♻️ Added stale chunk auto-recovery: after a redeploy removes the previous build's hashed chunks, failed lazy route imports (
router.onError+vite:preloadError) trigger a full-page reload straight to the route the reader asked for, with a session guard that falls back to the banner instead of reload-looping on a broken deploy. - 🎛️ Added the
updatesconfig key indocsector.config.js:updates: falsedisables the feature,updates: { interval }tunes the polling cadence (default 5 minutes, 30-second floor). - 📚 Updated docs in both locales — new Update Notification manual page (detection flow, recovery behavior, tuning, i18n overrides) and a new Updates section in the Configuration guide.
- ✅ Validated with 239 passing tests (34 new/extended), covering build-ID stamping and
version.jsonemission, poll/dismiss/visibility logic, chunk-error detection, reload loop guarding, and the i18n defaults in both locales.
Notes
- No configuration is required to adopt the feature — sites get it on their next build. Rebuilding the same commit on Cloudflare Pages never prompts readers, since the build ID is the commit SHA.
- Update checks never run during
docsector dev.