From f1cd42c4efdf12ffae5fbeff6a1d75ab80fbcc22 Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" Date: Thu, 15 Oct 2026 03:27:11 +0100 Subject: [PATCH] fix(frontend): adapt to the Dependabot group bump (typescript 7, vite 8, @types/react 19) PR #124's frontend group bump broke the build on main in two places; both are adaptor fixes, no behaviour change: - @types/react 19 removed useRef's no-argument overload, so TreeView's two timeout refs now take an explicit undefined initial value: useRef(undefined). - Vite 8 (rolldown) accepts manualChunks only as a function; vite.config.ts now routes plotly.js-dist-min to the 'plotly' chunk functionally, which emits the same separate 4.6 MB chunk as the object form did. Verified: bun run typecheck clean, 42/42 tests pass, bun run build succeeds and still emits assets/plotly-*.js as its own chunk. This also unblocks PR #125, whose Julia-tests job builds the frontend and inherited main's breakage. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- frontend/src/views/TreeView.tsx | 4 ++-- frontend/vite.config.ts | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/frontend/src/views/TreeView.tsx b/frontend/src/views/TreeView.tsx index c0778282..b95f7028 100644 --- a/frontend/src/views/TreeView.tsx +++ b/frontend/src/views/TreeView.tsx @@ -183,7 +183,7 @@ function TreeCanvas({ source, tree, src, toast }: { // Autosave the view document. const firstSave = useRef(true) - const saveTimer = useRef() + const saveTimer = useRef(undefined) const saveNow = useCallback(() => { const doc: TreeViewDoc = { version: 1, @@ -228,7 +228,7 @@ function TreeCanvas({ source, tree, src, toast }: { el.addEventListener('wheel', onWheel, { passive: false }) return () => el.removeEventListener('wheel', onWheel) }, []) - const scrollTimer = useRef() + const scrollTimer = useRef(undefined) const onScroll = () => { const el = scrollRef.current if (!el) return diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index e25db006..8b94649d 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -9,9 +9,10 @@ export default defineConfig({ sourcemap: false, rollupOptions: { output: { - manualChunks: { - plotly: ['plotly.js-dist-min'], - }, + // Vite 8 (rolldown) accepts manualChunks only as a function; the + // object form it replaces listed plotly.js-dist-min by package name. + manualChunks: (id: string) => + id.includes('plotly.js-dist-min') ? 'plotly' : undefined, }, }, },