feat(FR-2606): Vite PoC phase 1 — dev server + HMR + React Compiler parity#6869
Merged
graphite-app[bot] merged 1 commit intomainfrom Apr 30, 2026
Conversation
Contributor
Author
This was referenced Apr 22, 2026
Merged
bf0e617 to
7cb1e84
Compare
3 tasks
Contributor
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
|---|---|---|---|
| 🔴 | Statements | 8.12% (+0% 🔼) |
1859/22905 |
| 🔴 | Branches | 7.35% | 1187/16156 |
| 🔴 | Functions | 4.83% (+0.02% 🔼) |
297/6154 |
| 🔴 | Lines | 7.89% (+0% 🔼) |
1750/22190 |
Test suite run success
865 tests passing in 40 suites.
Report generated by 🧪jest coverage report action from 4ac49a9
2 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an initial Vite-based dev-server setup for the react/ workspace to support the Phase 1 PoC of migrating off CRA/Craco while preserving dev-mode behavior (HMR, Relay artifacts, React Compiler annotations, and project-root static asset serving).
Changes:
- Introduces
react/vite.config.tswith Vite dev server config, custom project-root static middleware, HTML transforms, Relay artifact directory routing, SVGR, and Node polyfills. - Adds a
vite:devscript and Vite-related devDependencies inreact/package.json. - Documents Phase 1 scope, validation steps, and follow-ups in
react/VITE_POC_NOTES.md.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| react/vite.config.ts | New Vite config + dev-server middleware to mirror Craco/Cra dev behavior and Babel plugin parity (React Compiler + Relay). |
| react/package.json | Adds vite:dev script and Vite/plugin devDependencies for the PoC. |
| react/VITE_POC_NOTES.md | Captures PoC rationale, verification evidence, and known follow-ups. |
7cb1e84 to
c115607
Compare
c115607 to
7807fa6
Compare
4 tasks
5 tasks
Merge activity
|
…arity (#6869) Resolves #6809(FR-2606) ## Summary First commit of the Vite migration stack. Stands up a working Vite dev server that mirrors the CRA/Craco dev behaviour so downstream commits can iterate safely. - `react/vite.config.ts`: `@vitejs/plugin-react` with `babel-plugin-react-compiler` (annotation mode), `babel-plugin-relay`, and `vite-plugin-svgr`. React Compiler parity with the existing CRA babel config. - `projectRootStaticPlugin`: serves `/resources/`, `/manifest/`, `/dist/`, `/config.toml`, etc. from the project root and reads the real project-root `index.html` as the SPA template (replaces craco `devServer.static` + `HtmlWebpackPlugin`). - `transformIndexHtml` hook injects `/src/index.tsx`, strips `{{nonce}}` in dev, and shims `process.env.NODE_ENV = 'development'` so dev-only branches still work. - Module aliases for `src/`, `backend.ai-ui` workspace source, `backend.ai-client-esm` (from `dist/lib`), and ESM shims for CJS leaf deps (`void-elements`, `use-sync-external-store/shim`). - `optimizeDeps.exclude: ['backend.ai-ui', 'i18next', 'react-i18next']` — intentional; see the follow-up commit that explains the i18n dual-instance requirement. ## Test plan - [x] `pnpm run vite:dev` serves the app at localhost:9083 with HMR working - [x] React Compiler `'use memo'` annotations are applied (manual diff verified post-build) - [x] Relay `graphql\`\`` tagged templates resolve to `__generated__/*` imports ## Stack Part of the Vite migration stack: FR-2606 → FR-2607 → FR-2610 → FR-2608 → FR-2609 → FR-2611 + fixes.
7807fa6 to
4ac49a9
Compare
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.

Resolves #6809(FR-2606)
Summary
First commit of the Vite migration stack. Stands up a working Vite dev server that mirrors the CRA/Craco dev behaviour so downstream commits can iterate safely.
react/vite.config.ts:@vitejs/plugin-reactwithbabel-plugin-react-compiler(annotation mode),babel-plugin-relay, andvite-plugin-svgr. React Compiler parity with the existing CRA babel config.projectRootStaticPlugin: serves/resources/,/manifest/,/dist/,/config.toml, etc. from the project root and reads the real project-rootindex.htmlas the SPA template (replaces cracodevServer.static+HtmlWebpackPlugin).transformIndexHtmlhook injects/src/index.tsx, strips{{nonce}}in dev, and shimsprocess.env.NODE_ENV = 'development'so dev-only branches still work.src/,backend.ai-uiworkspace source,backend.ai-client-esm(fromdist/lib), and ESM shims for CJS leaf deps (void-elements,use-sync-external-store/shim).optimizeDeps.exclude: ['backend.ai-ui', 'i18next', 'react-i18next']— intentional; see the follow-up commit that explains the i18n dual-instance requirement.Test plan
pnpm run vite:devserves the app at localhost:9083 with HMR working'use memo'annotations are applied (manual diff verified post-build)graphql\`tagged templates resolve togenerated/*` importsStack
Part of the Vite migration stack: FR-2606 → FR-2607 → FR-2610 → FR-2608 → FR-2609 → FR-2611 + fixes.