Repository navigation
feat(gui): Svelte 5 foundation + config-forms slice (#215) - #222
Merged
Merged
Conversation
First slice of the React->Svelte 5 migration (epic #214), strangler-on-main: React stays the live entry; Svelte is reachable only via a dev-only entry (index.svelte.html) and is tree-shaken out of the production build. - Toolchain: @sveltejs/vite-plugin-svelte + svelte-check + @testing-library/svelte alongside the React plugins; svelte.config.js; dual tsconfig (tsc checks TS/TSX, svelte-check checks .svelte/.svelte.ts); svelte-check wired into the GUI CI job. - State: src/state/project-session.svelte.ts runes module - persisted ProjectDocument vs transient session split, revision-based dirty tracking (replaces the config slice of the Zustand projectStore). - Forms: Svelte Mandrel/Tow/Machine config forms + a reusable NumberField primitive, reusing the existing param-form CSS and validation helpers at behaviour parity (live debounced + on-blur validation, backend errors). - Tests: 33 Svelte tests incl. debounced live-validation and blur paths. Production bundle unchanged (Svelte not in the rollup input). For the equivalent config-forms + state surface: 569 -> 356 production LoC. Refs #214
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #215. First slice of the React→Svelte 5 migration (epic #214) and the decision gate for the whole effort.
Strategy: strangler-on-
mainReact stays the live, shipped app (
index.html→src/main.tsx). Svelte is added in parallel, reachable only via a dev-only entry (index.svelte.html→src/main.svelte.ts) that is not in the production rollup input, sovite buildis unchanged until the #221 cutover. Every slice PRs tomainand must pass full CI.What's in this slice
svelte5.56,@sveltejs/vite-plugin-svelte7.1,svelte-check4.7,@testing-library/svelte5.4 — running beside the React plugins.svelte.config.js, a dual tsconfig (tscchecks TS/TSX,svelte-checkchecks.svelte/.svelte.tsviatsconfig.svelte.json), and a newsvelte-checkstep in the GUI CI job.src/state/project-session.svelte.ts: a runes module that splits the persistedProjectDocumentfrom transient session state (filePath / selection / validation) and tracks dirtiness via a revision counter instead of a boolean set in every mutation. Replaces the config slice of the ZustandprojectStore.Mandrel/Tow/Machineforms + a reusableNumberFieldprimitive, reusing the existingparam-formCSS and validation helpers (NUMERIC_RANGES,parseNumericInput) at behaviour parity (immediate store update, debounced live validation, on-blur validation, backend-error display).Decision-gate metrics
The Svelte side already includes a reusable
NumberField(51 LoC) that amortises across every future form/editor; like-for-like forms-only is 308→236 (−23%), with the state layer adding more. Verdict: GO — the LoC/ceremony reduction is real.Verification
tsc,svelte-check(0 errors), 643 vitest tests (58 files), coverage 81/74/79/81 (> 60/65/50/60),stylelint,lint:css:vars,vite build, bundle budget.waitFor-based no-blur test per form). A minor deferral (live-validation on programmatic document changes, currently unreachable) is marked with// minimal:notes and tracked for Migrate project & layer editing to Svelte (editors, native reorder, file ops, export) #217.Notes for reviewers
index.svelte.htmlis dev-only; visithttp://localhost:5173/index.svelte.htmlto preview.Part of #214.