Two defects exposed after the deploy-success loop fix (verified live): 1. Duplicated / skipped transcript lines. The placeholder-log interval did `setLog(prev => [...prev, msgs[i]])` then `i++`. React 18 auto-batches setInterval updaters, so the updater ran after i had advanced and read the wrong index — skipping some lines ([NET], [SENSE]) and duplicating others ([TLS]). Fixed by capturing `const line = msgs[i]` before scheduling the update. A placeholderStartedRef also gates the effect to one run per deploy (reset in startDeploy) as defense-in-depth against re-render churn. 2. Wizard never closed on success. The completedRef guard combined with the auto-close effect's cleanup was self-defeating: a re-render inside the 700ms window (e.g. the [OK] terminal-log append) ran the cleanup, clearing the pending close, and the guard then blocked rescheduling — so onComplete never fired. The timer now lives in a ref cleared only on unmount, so a scheduled close always fires exactly once regardless of re-renders. Adds a regression test that a re-render during the close countdown does not cancel the close. Verified end-to-end against the live instance: all 8 log lines render once in order, the wizard auto-closes, and /deckies does not storm.
React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint 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 ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Remove tseslint.configs.recommended and replace with this
tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
tseslint.configs.stylisticTypeChecked,
// Other configs...
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Enable lint rules for React
reactX.configs['recommended-typescript'],
// Enable lint rules for React DOM
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])