feat(admin): reload once when a chunk fails to load after a deploy (quick-261028-rqb)
- installChunkReloadGuard reloads on vite:preloadError, at most once per 60 s through a sessionStorage timestamp; no storage means no reload
This commit is contained in:
@@ -45,6 +45,8 @@ When the server offers more than one admin language (`meta.locales` of `GET .../
|
||||
|
||||
A tab opened before a deploy would otherwise keep running the old admin against the new server, because the session refreshes silently. The SPA reads the build it booted with from the `summer-admin-build` meta of the served `index.html` and asks `<prefix>/build.json` again when the window gets focus, when the tab becomes visible and every 5 minutes while it is visible, at most once every 30 seconds. When the server answers a different build, a banner at the bottom right says that a new version is available, with Reload and Close buttons. The SPA never reloads by itself: Reload goes through the usual page reload, so a form with unsaved changes still asks first, and Close hides the banner until yet another build is deployed. When the served index carries no build, as under the Vite dev server, the check is off.
|
||||
|
||||
A tab that still runs the old build may ask for a script chunk the new build no longer has. A failed chunk load (Vite's `vite:preloadError` event) reloads the page once, which loads the new build. A timestamp in `sessionStorage` (`summer-admin.chunk-reload`) blocks a second automatic reload within 60 seconds, so a reload that does not help never loops, and without usable `sessionStorage` the SPA does not reload at all.
|
||||
|
||||
## Keyboard shortcuts
|
||||
|
||||
As in WinterCMS, a shortcut presses a button on the screen. Ctrl and Cmd are both accepted on every platform; the tooltips name Cmd (⌘) on macOS.
|
||||
|
||||
Reference in New Issue
Block a user