pediatric-ai-scribe-v3/public/app/index.html
Daniel dc002360b0 perf(client): code-split every heavy route via React.lazy()
Cuts the initial bundle roughly in half. Users who open Home,
Extensions, or FAQ download ~343 kB / 106 kB gz instead of 817 kB /
230 kB gz. Heavy clinical reference data (PE_DATA, Fenton LMS,
Rosner BP splines, 15 Bedside drug panels, 10 Calculator formulas,
13 Settings sub-sections, 10 Admin sub-tabs) only loads when the
user opens that route.

client/src/App.tsx
  Every route except Home / Extensions / FAQ wrapped in
  React.lazy(() => import(...)) + <Suspense fallback>. Extensions and
  FAQ stay in the main chunk because they're small (3 kB, 2 kB) and
  likely visited early. The RouteFallback component shows a single
  "Loading…" line — Vite prefetches chunks on hover so the delay is
  typically invisible.

Resulting chunks (gzipped):
  • index.js             106 kB   React + Router + Query + Layout +
                                   Home + Extensions + FAQ
  • Bedside.js            33 kB   15 clinical dosing panels
  • PeGuide.js            36 kB   PE_DATA hierarchy + scales + sounds
  • Calculators.js        42 kB   All 10 calculators + BP Rosner
                                   coefficients + Fenton + BMI LMS
  • Settings.js           10 kB   13 Settings sub-sections
  • Admin.js               7 kB   10 Admin sub-tabs
  • Learning.js            3 kB
  • Fenton chunk (shared)  3 kB   Reused between Bedside neonatal
                                   and the Growth Charts calculator
  • Note pages (each)  1-2 kB   Encounter / SOAP / Well / Sick /
                                   Hospital / Chart / Dictation / Vax /
                                   Catch-up individually chunked

Vite's 500 kB chunk-size warning is gone. No functional changes.
2026-04-24 02:28:52 +02:00

15 lines
554 B
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/app/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>client</title>
<script type="module" crossorigin src="/app/assets/index-B0uH73Hx.js"></script>
<link rel="modulepreload" crossorigin href="/app/assets/jsx-runtime-ByY1xr43.js">
<link rel="stylesheet" crossorigin href="/app/assets/index-DnJqszjp.css">
</head>
<body>
<div id="root"></div>
</body>
</html>