Skip to content

Feature : Migrate telemetry UI from Create React App to Vite#793

Open
hemanthsavasere wants to merge 25 commits into
apache:mainfrom
hemanthsavasere:feat-migrate-telemetry-ui-vite
Open

Feature : Migrate telemetry UI from Create React App to Vite#793
hemanthsavasere wants to merge 25 commits into
apache:mainfrom
hemanthsavasere:feat-migrate-telemetry-ui-vite

Conversation

@hemanthsavasere
Copy link
Copy Markdown
Contributor

@hemanthsavasere hemanthsavasere commented May 30, 2026

Migrate the telemetry UI from Create React App (CRA) to Vite + Vitest, update documentation, and fix post-migration issues, fixing #780

Changes

  • Replaced CRA with Vite: added vite.config.ts, tsconfig.node.json, updated tsconfig.json
  • Replaced Jest with Vitest: added vitest.config.ts, moved setupTests.ts → src/test/setup.ts, rewrote broken CRA smoke test as "renders without crashing"
  • Replaced react-app-env.d.ts with vite-env.d.ts, removed reportWebVitals.ts and its usage in index.tsx
  • Replaced CRA public/index.html with root index.html
  • Regenerated package-lock.json, swapped CRA deps for Vite/Vitest in package.json
  • Added postcss.config.js with autoprefixer for Tailwind CSS v3 compatibility with Vite
  • Added autoprefixer to devDependencies
  • Updated server: asset mount path changed from /static to /assets
  • Updated docs: replaced CRA README content with Vite content; fixed paths (burr/ui → telemetry/ui); corrected proxy config reference (package.json → vite.config.ts)
  • Fixed .prettierignore typo: .eslitrc.js → .eslintrc.js
  • Updated CI: Node.js from 16.x → 20.x in ui.yml

How I tested this

  • CI workflow (ui.yml) passes with Node.js 20.x
  • Vitest smoke test (App.test.tsx) passes — verifies the app renders without crashing
  • npm run build succeeds with Vite
  • npm run start serves via Vite dev server on port 3000

Notes

  • This is purely a build tooling migration; no functional changes to the UI itself
  • The BURR_BASE_PATH window variable is preserved in vite-env.d.ts to maintain existing runtime behavior

Checklist

  • PR has an informative and human-readable title (this will be pulled into the release notes)
  • Changes are limited to a single goal (no scope creep)
  • Code passed the pre-commit check & code is left cleaner/nicer than when first encountered.
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future TODOs are captured in comments
  • Project documentation has been updated if adding/changing functionality.

@github-actions github-actions Bot added area/ui Burr UI (telemetry frontend) area/tracking Telemetry, tracing, OpenTelemetry area/website burr.apache.org website area/ci Workflows, build, release scripts labels May 30, 2026
@hemanthsavasere hemanthsavasere changed the title Feat migrate telemetry UI vite Feature : Migrate telemetry UI from Create React App to Vite May 30, 2026
@hemanthsavasere hemanthsavasere marked this pull request as ready for review May 31, 2026 03:09
@elijahbenizzy
Copy link
Copy Markdown
Contributor

Happy with this in theory -- can you provide:

  1. screenshots as evidence
  2. brief reasoning in documentation for technology choice?
    thanks!

Copy link
Copy Markdown
Contributor

@elijahbenizzy elijahbenizzy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this end-to-end against the worktree — built UI assets, installed burr[start] from the branch, mounted the Vite build into burr/tracking/server/build/, ran the FastAPI server on :7241, and confirmed the migrated UI loads, serves the /assets/index-*.{js,css} bundle from the new mount point, and hits /api/v0/projects correctly against demo data. Nice work — DX win on dev-server boot time alone (85ms vs CRA's ~30s).

One real bug + two non-blocking nits:

🔴 vite.config.ts:9 proxy port

proxy: {
  '/api': 'http://localhost:8000'   // <-- should be 7241
}

The documented dev workflow in docs/contributing/iterating.rst:71 is:

It currently assumes that the tracking server is running on port 7241. The proxy is configured in vite.config.ts.

After this merges, anyone following those docs (start tracking server on 7241, start Vite on 3000) will silently get 404s on every /api/* call. One-character fix. Could you flip to 7241?

🟡 telemetry/ui/scripts/model_costs.json mega-diff

The +9728/-1 is verified noise, not a data update — same 1594 model entries before and after, zero added or removed. It's purely prettier reformatting of a previously-minified file that got swept into the formatting commit. Harmless, but it'd be cleaner to split it into its own "format model_costs.json" commit so future git log -- model_costs.json is actually useful. Not blocking.

🟡 @types/node floor

Jumped ^16^22 while the engine floor is now Node 18. Pinning to ^20 would more accurately reflect the supported floor. Cosmetic, optional.

Everything else I audited cleanly:

  • TypeScript strictness preserved (strict: true intact; only moduleResolution: nodebundler, required for Vite).
  • No surviving /static/ URL references anywhere in source/docs/CLI/examples.
  • No REACT_APP_* env var leftovers.
  • __BURR_BASE_PATH__ migration is correct (declared in vite-env.d.ts, read sites in App.tsx/OpenAPI.ts/appcontainer.tsx/StreamingChatbot.tsx all work, server-side injection in run.py:413 unchanged).
  • vite.config.ts security-neutral (no wide bind, no fs.allow, no prod sourcemaps, no define secrets).
  • Test coverage delta = 0 (the original CRA smoke test asserted getByText(/learn react/i) against a string that has never existed in Burr's UI — it was effectively dead).
  • .gitignore already covers build artifacts; no .env/build/.DS_Store smuggled in.
  • Other CI workflows (release-validation.yml, build-site.yml) already on Node 20+, so the 16 → 18 bump here doesn't strand them.

Backend /static/assets mount + the HTML rewrite logic in run.py:404 for sub-app mounting under a root_path is correctly updated and works in the smoke test.

Flip the proxy port and I'll come back and approve. Thanks for the careful migration write-up.

@hemanthsavasere hemanthsavasere force-pushed the feat-migrate-telemetry-ui-vite branch from 2127c62 to f3e9563 Compare June 2, 2026 19:37
@github-actions github-actions Bot added the pr/needs-rebase Conflicts with main label Jun 2, 2026
…ormatting

- Add postcss.config.js, vite.config.ts, vitest.config.ts to .eslintignore
  (these use Node.js globals but ESLint env only has browser:true)
- Apply prettier formatting fixes from npm run format:fix
- Ensures CI workflow (ui.yml) passes cleanly with Node.js 18.x
@hemanthsavasere hemanthsavasere force-pushed the feat-migrate-telemetry-ui-vite branch from f3e9563 to 3655700 Compare June 2, 2026 19:46
@github-actions github-actions Bot removed the pr/needs-rebase Conflicts with main label Jun 2, 2026
@hemanthsavasere
Copy link
Copy Markdown
Contributor Author

Thanks for the detailed review, really appricate your time. I have addressed all the comments. Can you please take a look at it again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci Workflows, build, release scripts area/tracking Telemetry, tracing, OpenTelemetry area/ui Burr UI (telemetry frontend) area/website burr.apache.org website

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants