Skip to content
TypeScript

perf(web): the shell command block compiles without manual memoization (#20714)

Julius Marminge7c74a35ea676
diff --git a/apps/web/src/components/chat/ShellCommandBlock.tsx b/apps/web/src/components/chat/ShellCommandBlock.tsx
index 19bd621c7ae..50c47b5859c 100644
--- a/apps/web/src/components/chat/ShellCommandBlock.tsx
+++ b/apps/web/src/components/chat/ShellCommandBlock.tsx
@@ -2,7 +2,7 @@ import {
commandHighlightLanguage,
withVisibleControlCharacters,
} from "@t3tools/client-runtime/work-log/command-label";
-import { Suspense, use, useMemo } from "react";
+import { Suspense, use } from "react";
import { useTheme } from "../../hooks/useTheme";
import { RenderErrorBoundary } from "../RenderErrorBoundary";
@@ -36,10 +36,7 @@ function HighlightedCommand({ code, theme }: { code: string; theme: "light" | "d
const { embeddedScripts } = use(loadEmbeddedScripts());
const language = commandHighlightLanguage(code);
// Only shell syntax nests scripts; PowerShell's own grammar colors its strings.
- const embedded = useMemo(
- () => (language === "shellscript" ? embeddedScripts(code) : []),
- [code, embeddedScripts, language],
- );
+ const embedded = language === "shellscript" ? embeddedScripts(code) : [];
return (
<HighlightedTokens
code={code}