Skip to content

v4.13.0

Choose a tag to compare

@rodrigoslayertech rodrigoslayertech released this 16 Jul 21:00
· 75 commits to main since this release
v4.13.0
0343062

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-US and pt-BR engine defaults, overridable per project).
  • 🏗️ Every production build now stamps a build ID — the Cloudflare Pages commit SHA (CF_PAGES_COMMIT_SHA), a DOCSECTOR_BUILD_ID override, or a per-build timestamp — baked into the bundle and emitted as version.json at the site root, with a Cache-Control: no-cache rule appended to the generated _headers so CDNs always revalidate it.
  • 📡 The running app polls version.json once 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 updates config key in docsector.config.js: updates: false disables 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.json emission, 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.