perf: disable react strictmode to stop terminal double-mount thrash
- SHA
d88a74d60a929421c653e94fecf666c2835b10e0- Parents
-
c45b847 - Tree
e69190f
d88a74d
d88a74d60a929421c653e94fecf666c2835b10e0c45b847
e69190f| Status | File | + | - |
|---|---|---|---|
| M |
src/main.tsx
|
10 | 6 |
src/main.tsxmodified@@ -1,4 +1,3 @@ | ||
| 1 | -import React from "react"; | |
| 2 | 1 | import ReactDOM from "react-dom/client"; |
| 3 | 2 | import App from "./App"; |
| 4 | 3 | import { installDebugBridge } from "./lib/debug"; |
@@ -8,8 +7,13 @@ import "./index.css"; | ||
| 8 | 7 | // crash during initial render still lands in ~/Library/Logs/claudex. |
| 9 | 8 | installDebugBridge(); |
| 10 | 9 | |
| 11 | -ReactDOM.createRoot(document.getElementById("root")!).render( | |
| 12 | - <React.StrictMode> | |
| 13 | - <App /> | |
| 14 | - </React.StrictMode>, | |
| 15 | -); | |
| 10 | +// StrictMode is intentionally OFF. Its dev-only double-invoke of | |
| 11 | +// effects forced every TerminalPane mount to run `new Terminal()` | |
| 12 | +// + `term.open()` + WebGL context init + ring-buffer replay | |
| 13 | +// twice, which on a macOS webview triggers WebGL context | |
| 14 | +// thrashing and multi-second main-thread stalls every time the | |
| 15 | +// user switches sessions. See ~/Library/Logs/claudex/claudex.log | |
| 16 | +// circa 2026-04-11 for the signature `mount begin → unmount → | |
| 17 | +// mount begin` pattern that proved it. Reinstate once the xterm | |
| 18 | +// mount path is genuinely idempotent and cheap. | |
| 19 | +ReactDOM.createRoot(document.getElementById("root")!).render(<App />); | |