web_update_guard 0.1.0
web_update_guard: ^0.1.0 copied to clipboard
Stop Flutter web users running stale cached builds. A CLI stamps and cache-busts build/web; a runtime guard detects new deploys and reloads cleanly.
0.1.0 #
- Initial release.
dart run web_update_guard stamp build/web: content-hash + timestamp build ID,version.json(merged with Flutter's own keys),?v=<buildId>cache-busting ofmain.dart.js,flutter_bootstrap.js,flutter.js,main.dart.wasmandmain.dart.mjs, build-ID<meta>tag. Idempotent.WebUpdateGuard: polling, focus / visibility checks,no-store+ cache-bustedversion.jsonfetch,Stream<UpdateStatus>,checkNow(),applyUpdate()(unregister service workers, clear CacheStorage, refresh the document, reload), auto-reload policiesnever/whenIdle/immediately, reload-loop guard. No-op (unsupported) off the web.- Widgets:
UpdateBanner(inlineMaterialBanneror custom builder) andWebUpdateListener(SnackBar/MaterialBannerviaScaffoldMessenger).