mirror of
https://github.com/Moepchi/webspeak3.git
synced 2026-12-01 00:42:49 +08:00
Between48f5e35(07.09., registerType: 'autoUpdate') and5b5f4ca(10.09., switched to 'prompt') every client that cached the app froze: the new worker sits in `waiting` and the only code that could release it - the update toast - lives in the build behind that worker. Their next update never arrives, and Pages deletes the hashed assets they still run from, so the bundle they serve does not exist on the server any more. That is how the feedback form went missing on client.webspeak3.de. - Back to 'autoUpdate', with skipWaiting/clientsClaim spelled out: the plugin only sets them when it also injects registerSW.js, so with injectRegister: false the generated worker was byte-identical to the 'prompt' one. Verified in dist/sw.js. - onNeedReload instead of onNeedRefresh: the worker takes over on its own, the toast only decides *when* to reload, so nobody is thrown out of a running connection. - version.json plus a __BUILD_ID__ baked into the bundle, checked every 30 min and on tab focus, deliberately routed around the worker (not in globPatterns, so never precached). If the server is on another build and no new worker turns up, the worker is wedged and the button clears registrations and caches instead of reloading into the same cache. - Dismissing the toast snoozes for 30 min rather than for good. Verified in headless Chromium against simulated deploys: a client stuck on the old worker lands on the new bundle at the first plain F5. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some Oxlint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Oxc
- @vitejs/plugin-react-swc uses SWC
React Compiler
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.
Expanding the Oxlint configuration
If you are developing a production application, we recommend enabling type-aware lint rules by installing oxlint-tsgolint and editing .oxlintrc.json:
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["react", "typescript", "oxc"],
"options": {
"typeAware": true
},
"rules": {
"react/rules-of-hooks": "error",
"react/only-export-components": ["warn", { "allowConstantExport": true }]
}
}
See the Oxlint rules documentation for the full list of rules and categories.