open-swe/ui/src/client.tsx

22 lines
731 B
TypeScript
Raw Normal View History

import { StartClient } from "@tanstack/react-start/client"
import { StrictMode } from "react"
import { hydrateRoot } from "react-dom/client"
import { registerSW } from "virtual:pwa-register"
// 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.
if (import.meta.env.PROD) {
registerSW()
}
hydrateRoot(
document,
<StrictMode>
<StartClient />
</StrictMode>
)