2026-06-04 15:52:06 -07:00
|
|
|
import { StartClient } from "@tanstack/react-start/client"
|
|
|
|
|
import { StrictMode } from "react"
|
|
|
|
|
import { hydrateRoot } from "react-dom/client"
|
|
|
|
|
import { registerSW } from "virtual:pwa-register"
|
|
|
|
|
|
2026-07-01 14:25:26 -04:00
|
|
|
// autoUpdate: vite-plugin-pwa generates a SW that calls skipWaiting and
|
|
|
|
|
// clientsClaim, so a new deploy activates for existing tabs. Open dashboard
|
|
|
|
|
// tabs may reload when the service worker takes over; this is acceptable for
|
|
|
|
|
// a dev/internal dashboard where silent updates are preferred over stale
|
|
|
|
|
// bundles. Skip in dev — the SW precaches production-only build artifacts that
|
|
|
|
|
// 404 against the dev server.
|
2026-06-04 16:47:35 -07:00
|
|
|
if (import.meta.env.PROD) {
|
|
|
|
|
registerSW()
|
|
|
|
|
}
|
2026-06-04 15:52:06 -07:00
|
|
|
|
|
|
|
|
hydrateRoot(
|
|
|
|
|
document,
|
|
|
|
|
<StrictMode>
|
|
|
|
|
<StartClient />
|
|
|
|
|
</StrictMode>
|
|
|
|
|
)
|