Frontend: production deploy ships React dev builds + in-browser Babel — slow first paint, console warnings leak #122

Closed
opened 2026-05-26 18:21:51 -04:00 by zgaetano · 1 comment
Owner

Duplicate of #139 — fixed in 04ce096.

Duplicate of #139 — fixed in 04ce096.
Author
Owner

Fix Plan — #122 Production ships React dev builds + in-browser Babel

Root cause: index.html loads react.development.js, react-dom.development.js, @babel/standalone. JSX compiled in browser on every page load. Several seconds slower first paint. Dev warnings leak to console.

Fix:

  1. Switch to production React:
<script src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
<script src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
  1. Pre-compile JSX at Docker build time:
# In Dockerfile for web-ui
RUN npm install -g esbuild
RUN esbuild src/app.jsx --bundle --outfile=dist/app.js --platform=browser --target=es2020
  1. Remove @babel/standalone from index.html.

Files: index.html, Dockerfile (web-ui)
Effort: ~2h
**Priority: P3 — performance + polish

## Fix Plan — #122 Production ships React dev builds + in-browser Babel **Root cause:** `index.html` loads `react.development.js`, `react-dom.development.js`, `@babel/standalone`. JSX compiled in browser on every page load. Several seconds slower first paint. Dev warnings leak to console. **Fix:** 1. **Switch to production React:** ```html <script src="https://unpkg.com/react@18/umd/react.production.min.js"></script> <script src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script> ``` 2. **Pre-compile JSX at Docker build time:** ```dockerfile # In Dockerfile for web-ui RUN npm install -g esbuild RUN esbuild src/app.jsx --bundle --outfile=dist/app.js --platform=browser --target=es2020 ``` 3. **Remove `@babel/standalone` from `index.html`.** **Files:** `index.html`, `Dockerfile` (web-ui) **Effort:** ~2h **Priority: P3 — performance + polish
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: WildDragonLLC/dragonflight#122
No description provided.