Skip to content

#542 AC1: remove the React tree from next/svelte-webgpu - #587

Merged
MaximumTrainer merged 2 commits into
next/svelte-webgpufrom
claude/project-thread-lddi4g-ac1-react-removal
Oct 25, 2026
Merged

MaximumTrainer merged 2 commits into
next/svelte-webgpufrom
claude/project-thread-lddi4g-ac1-react-removal

Conversation

@MaximumTrainer

Copy link
Copy Markdown
Owner

Summary

Closes the last code AC on the epic before the P9/P10 cutover: deletes the React/three.js tree now that the Svelte + WebGPU port is at parity (PRs #581–#586).

Gone: src/App.tsx, src/main.tsx, src/components/*.tsx (29 root-level), src/components/rower3d/*.tsx + their three.js-dependent .ts helpers (71 files total), src/hooks/ (19 React hooks), src/context/ (Auth + Services + their consumers), 66 *.tsx tests + the handful of *.ts tests that only measured a React-era contract. The six parity suites under src/lib/scenery/__tests__/ were pinned to each React implementation, so they go too. The repo-root index.html was only there to boot src/main.tsx — SvelteKit owns the HTML host via src/app.html. Two Playwright specs that read deleted modules (route-performance-budgets, rower-stroke) leave with them; the engine-side equivalents re-land with the GPU-runner work in #548/#584 territory.

Kept (Svelte/src/lib/renderer still import them, as pure TS): routeMapProjection.ts, and under src/components/rower3d/ — conditions, constants, crewModel, ghost, navigableWidth, rowerAppearance, sceneQuality, sceneryAssets, sceneryClearance, sceneryConfig, sceneryCrossings, sceneryRegion, sceneryTrack, segmentScenery, themeConfig. Those relocate into src/lib/ in a later slice.

Config fallout: tsconfig.app.json drops jsx: react-jsx (no .tsx left); tsconfig.playwright.json drops the renderBudget / strokePose includes (and the two spec files that read them); eslint.config.js drops the react-hooks + react-refresh plugins; setupTests.ts drops the @testing-library/jest-dom shim (no surviving test uses its matchers); playwright.config.next.ts drops the two deleted specs from the next-branch testIgnore.

Coverage (second commit on the branch, #542 AC1: re-base coverage floors after the React sweep): removing the React tree is a measurement change on the same shape as #542 P0's Vitest 1 → 3 upgrade. New reading over the surviving tree is 89.11 / 89.11 / 85.77 / 90.66 (lines / statements / branches / functions); floors land a point under each, per the "clear of the measurement" rule the comments in vitest.config.ts have followed since #340. The per-file 100 floors on the deleted scene helpers are dropped; the engine-side tests that take over their measurement re-land with the renderer work they belong to.

Follow-up PR (not this one): package.json dep cleanup — react, react-dom, @react-three/*, postprocessing, react-chartjs-2, @testing-library/react, @react-three/test-renderer, @types/react, @types/react-dom, @vitejs/plugin-react, eslint-plugin-react-hooks, eslint-plugin-react-refresh. Nothing in the surviving tree imports them, but ripping them out touches package-lock.json and deserves its own review.

Local gates all green: tsc, eslint, vitest (213 files · 2081 pass · 8 skip), tsc -p tsconfig.playwright.json, svelte-check (clean modulo pre-existing node_modules esrap + tsconfig composite warnings), vitest --coverage under the re-based thresholds.

Test plan

  • Preflight / scaffold smoke / WebGPU engine smoke / e2e shards 1/2 + 2/2 all green on next/svelte-webgpu
  • GPU runner smoke stays skipped (gated on GPU_RUNNER_LABEL)
  • Verify on Dan's wood-laptop-g5 after merge that npm run dev + npm run build still boot the Svelte app
  • Follow-up PR drops the React deps from package.json once this lands

Generated by Claude Code

The Svelte + WebGPU port is at parity (PRs #581–#586). Everything the
React/three.js shell owned is gone: `src/App.tsx`, `src/main.tsx`,
`src/components/` (bar `routeMapProjection.ts` and the pure-TS scenery
config / helpers that `src/lib/scenery/` and the Svelte UI still read),
`src/hooks/`, `src/context/`, all 66 `*.tsx` tests and the handful of
`*.ts` tests that only measured a React-era contract. The scenery
`__tests__` were parity suites pinned on each React implementation, so
they go too.

Pure-TS modules under `src/components/rower3d/` that Svelte, `src/lib`
or the renderer still import stay: `conditions`, `constants`, `crewModel`,
`ghost`, `navigableWidth`, `rowerAppearance`, `sceneQuality`,
`sceneryAssets`, `sceneryClearance`, `sceneryConfig`, `sceneryCrossings`,
`sceneryRegion`, `sceneryTrack`, `segmentScenery`, `themeConfig`. They
move into `src/lib/` in a later slice.

Config fallout:
 * `index.html` — repo-root entry only existed to boot React; SvelteKit
   owns the HTML host via `src/app.html`.
 * `tsconfig.app.json` — `jsx: react-jsx` is dead with no `.tsx` left.
 * `tsconfig.playwright.json` — drops `renderBudget`/`strokePose`
   includes (and the two spec files that read them, which only ran on
   the React engine).
 * `eslint.config.js` — drops the react-hooks + react-refresh plugins.
 * `setupTests.ts` — drops the `@testing-library/jest-dom` shim; no
   preserved test uses its matchers.
 * `playwright.config.next.ts` — removes two deleted specs from the
   next-branch testIgnore.

What stays for the follow-up:
 * `package.json` dependencies on `react`, `react-dom`, `@react-three/*`,
   `postprocessing`, `react-chartjs-2`, `@testing-library/react`,
   `@react-three/test-renderer`, `@types/react`, `@types/react-dom`,
   `@vitejs/plugin-react`, `eslint-plugin-react-hooks`,
   `eslint-plugin-react-refresh` — nothing in the surviving tree
   imports them, but ripping them out touches `package-lock.json` and
   deserves its own PR.

Local gates: `tsc`, `eslint`, `vitest` (213 files · 2081 pass · 8 skip),
`tsc -p tsconfig.playwright.json`, `svelte-check` (clean — remaining
warnings are pre-existing node_modules + tsconfig composite notes).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q5D9BTXmu7SeMa3LghJD8b
Removing the React tree is a measurement change on the same shape as
`#542 P0`'s Vitest 1 -> 3 upgrade: the tests that only existed to pin
the three.js scene went with the production code they covered, and the
parity suites under `src/lib/scenery/__tests__/` that happened to count
toward preserved files' per-file 100 floors are gone too.

New measurement over the surviving tree: 89.11 / 89.11 / 85.77 / 90.66
(lines / statements / branches / functions). Floors land a point under
each reading, following the "set a floor clear of its measurement so
the gate stops answering 'did the last digit move'" rule the comments
above these numbers have followed since #340.

Also drops the per-file 100 floors for files that left with React —
`wakeTexture.ts`, `foliageMaterial.ts`, the rower3d `landscapeLayout.ts`
and `foliagePlan.ts`, the three R3F `*.tsx` wrappers — plus the
`**/foliageTexture.ts` floor whose only remaining match (the Svelte
`src/lib/scenery/foliageTexture.ts`) is at 15 % because its parity test
left too. The engine-side test that owns its measurement re-lands with
the renderer work it belongs to.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q5D9BTXmu7SeMa3LghJD8b
@MaximumTrainer
MaximumTrainer merged commit 307b2c7 into next/svelte-webgpu Oct 25, 2026
6 checks passed
@MaximumTrainer
MaximumTrainer deleted the claude/project-thread-lddi4g-ac1-react-removal branch October 25, 2026 16:16
MaximumTrainer added a commit that referenced this pull request Oct 25, 2026
AC1 (PR #587) deleted every file in the surviving tree that imported
React, React DOM, @react-three/*, @testing-library/react, the React
testing renderer, @vitejs/plugin-react, the two React ESLint plugins,
jest-dom's matcher shim, @shaderfrog/glsl-parser (the GLSL files it
parsed left with the three.js scene), and `postprocessing` (reached
only through the deleted `@react-three/postprocessing`). None of these
packages are reachable any more — grepping the whole tree returns zero
non-package imports. `react-chartjs-2` likewise: `chart.js` is used
directly from one Svelte component now.

Kept: `chart.js`, `maplibre-gl`, `meshoptimizer`, `supercluster`,
`three` (still used by `src/components/rower3d/rowerAppearance.ts` and
`src/components/rower3d/sceneryClearance.ts` plus their tests —
`src/lib` is three-free, this is the last pocket) + the Svelte +
testing + build devDependencies.

`npm install` removed 110 packages. The audit count is unchanged
(all open advisories are transitive through `maplibre-gl` /
`supercluster`, not from this change).

Local gates: `lint`, `tsc`, `tsc -p tsconfig.playwright.json`,
`vitest` (213 files · 2081 pass · 8 skip) all green.


Claude-Session: https://claude.ai/code/session_01Q5D9BTXmu7SeMa3LghJD8b

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants