tenseleyflow/claudex / d88a74d

Browse files

perf: disable react strictmode to stop terminal double-mount thrash

Authored by espadonne
SHA
d88a74d60a929421c653e94fecf666c2835b10e0
Parents
c45b847
Tree
e69190f

1 changed file

StatusFile+-
M src/main.tsx 10 6
src/main.tsxmodified
@@ -1,4 +1,3 @@
1
-import React from "react";
21
 import ReactDOM from "react-dom/client";
32
 import App from "./App";
43
 import { installDebugBridge } from "./lib/debug";
@@ -8,8 +7,13 @@ import "./index.css";
87
 // crash during initial render still lands in ~/Library/Logs/claudex.
98
 installDebugBridge();
109
 
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 />);