feat: migrate frontend from React 19 to Svelte 5 + SvelteKit#85
Open
droarty wants to merge 3 commits into
Open
feat: migrate frontend from React 19 to Svelte 5 + SvelteKit#85droarty wants to merge 3 commits into
droarty wants to merge 3 commits into
Conversation
- Rename apps/web → apps/web-react (preserved as reference) - Scaffold apps/web as SvelteKit SPA (adapter-static, port 4200) - Port all services verbatim: EventManager, documentModelStore, api - Replace AuthContext with Svelte writable store (auth.ts) - Replace React Router with SvelteKit file-based routes (8 pages) - Port all layout components to Svelte 5 runes - Implement recursive LayoutNode/LayoutRenderer for workflow-driven UI - Replace Radix UI with native Svelte implementations (accordion, tabs) - Port TreeView to Svelte using <details>/<summary> pattern - Replace useSyncExternalStore with $effect + subscribeToModel - Build succeeds: 251 modules transformed, adapter-static output clean Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… project Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
This PR is attempting to replace React with Svelte to see if the size of the output shrinks...
After asking claude to compare outputs from the react version and the svelte version, this is what it came up with:
React wins on total size — barely:
They're essentially identical — within 1 KB of each other. The difference is that React ships one large file (339 KB), while Svelte code-splits into ~48 small chunks that load lazily per route. In practice Svelte will often send less to the browser on first load because it only downloads the chunks needed for the current page — the full 340 KB is only reached if you visit every route.
The React bundle is also slightly inflated here because it includes react-dom (the full runtime) and several Radix UI components, while Svelte's runtime is much smaller and Vite tree-shook more aggressively.
So I am sitting on this PR for now... we an look into it again down the road.
apps/web→apps/web-react(React 19 app preserved as reference)apps/webas SvelteKit 2 SPA (adapter-static, port 4200, Vite 6)EventManager,documentModelStore,api)AuthContextwith a Sveltewritablestore (auth.ts)afterUpdate, no<svelte:component>, no<svelte:self>)LayoutNode/LayoutRendererfor workflow-driven UI using dynamic imports +{#await}patternTreeViewusing<details>/<summary>native elementsuseSyncExternalStorewith$effect+ manual subscription todocumentModelStoreadapter-staticoutput cleanCloses #82
Test plan
npm run restart:web— dev server starts on :4200 ✅/login— form renders, login works, redirects to dashboardnpx nx test api— backend tests still pass🤖 Generated with Claude Code