@kazzle/app 0.1.740 → 0.1.742

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kazzle/app",
3
- "version": "0.1.740",
3
+ "version": "0.1.742",
4
4
  "description": "Contracts, tool helpers, Vite helper, and templates for building Kazzle apps.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -10,13 +10,25 @@
10
10
  *
11
11
  * `StrictMode` double-invokes effects in dev to catch bugs from accidental
12
12
  * state mutation. It has no effect in production builds.
13
+ *
14
+ * Service worker: `vite-plugin-pwa` with `registerType: 'autoUpdate'` only
15
+ * activates/reloads when the app calls `registerSW` from
16
+ * `virtual:pwa-register`. Leaving that out leaves a registered worker that
17
+ * never claims updates — published builds would stay stale until a hard
18
+ * refresh. Keep this registration; do not enable `devOptions`.
13
19
  */
14
20
 
15
21
  import { StrictMode } from 'react';
16
22
  import { createRoot } from 'react-dom/client';
23
+ import { registerSW } from 'virtual:pwa-register';
17
24
  import App from './App';
18
25
  import './styles/theme.css';
19
26
 
27
+ // Production only — `virtual:pwa-register` is a no-op when
28
+ // `devOptions.enabled: false`. `immediate: true` + autoUpdate swaps in a new
29
+ // worker as soon as `registration.update()` (or periodic checks) finds one.
30
+ registerSW({ immediate: true });
31
+
20
32
  createRoot(document.getElementById('root')!).render(
21
33
  <StrictMode>
22
34
  <App />