Explore ways to improve first-load performance
Los mantenedores suelen responder en 5 días
@stephaniehobson ya está trabajando en esto.
Desde el 19/11/2026.
- #518 de @stephaniehobson — abierto
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, playwright, react, vite
- Área
- frontend, performance
Línea de trabajo
Start by measuring / and /dashboard/user-activity with Lighthouse or WebPageTest on mobile, cold and warm cache; record LCP, CLS, TBT and the request waterfall. Read Main.jsx, lib/fetchCache.js, Application.jsx, Application.styl, docs/architecture/deploy.md and the existing work on branch 468--fresh-paint; the issue lists several possible approaches, so agree on one measurable scope before changing code. Done means the chosen change improves the baseline while preserving status announcements and focus handling, with its result measured and documented.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Ensemble is a client-rendered SPA. index.html has an empty #root, so the first paint and LCP wait for JS to download, parse and fetch data. Below are routes worth exploring. Start by measuring a baseline: Lighthouse / WebPageTest on / and /dashboard/user-activity, throttled to mobile, cold and warm cache. Record LCP, CLS, TBT and the request waterfall.
Render-blocking requests
index-*.js(~214 KB raw) andindex-*.css(~14 KB) both block rendering. Check what the entry bundle holds:npm run size. react-ga4/gtag, react-helmet-async, react-router and markdown-it are candidates to defer or trim.withTracker.jsxcallsReactGA.initializeat import time. Confirm the gtag script is async and doesn't compete with critical requests. Consider initialising it after load.- Inline the critical CSS for the header/shell in
index.html, or check that each route's CSS chunk (Home-*.css,DashboardContainer-*.css) doesn't add a blocking round trip after its JS chunk.
Network dependencies (request chains)
- Cold dashboard waterfall today:
index.html→index.js→DashboardContainerchunk (~178 KB) →${source}/index.json→ N × per-metricindex.json→ charts render.ChartContainer(~268 KB, Observable Plot) is already loaded up front (#509). - Add
<link rel="modulepreload">for the route chunk and<link rel="preload" as="fetch" crossorigin>for the dashboardindex.json. Each copy ofindex.htmlper route path is a natural place for this. Vite could emit per-route HTML at build time. - Start the dashboard
index.jsonfetch in parallel with the chunk load, rather than afterDashboardContainermounts. For example, warmlib/fetchCache.jsfromMain.jsx. - Ask the transposer whether the dashboard index could inline the summary/first metric to cut a round trip.
- Caching:
docs/architecture/deploy.mdnotes that the CDN rewritescache-controltopublic,max-age=0, so theimmutablehashed assets get revalidated on every visit. Raise this with the CDN owners (TerraformFORCE_CACHE_ALL). Also confirm that brotli/gzip compression and HTTP/2/3 are on.
Font display
Application.styldeclares 8 Fira Sans@font-facerules with WOFF/TTF/SVG sources (no WOFF2) and nofont-display. Unused.eotfiles ship in the repo.- The
468--fresh-paintbranch switches to Mozilla Headline/Text WOFF2, which already moves to WOFF2. Fold this work into that branch rather than optimising Fira. - Add
font-display: swap(oroptional) and preload the one or two weights used above the fold. Considersize-adjust/ascent-overrideon the fallback to limit swap shift. Check how many weights and styles the pages actually use.
Layout shifts
- Measure CLS on cold loads. #509 added same-size placeholders for metrics. Check whether any remaining shifts come from the header/footer jumping when
maingoes from empty → spinner → dashboard, the font swap, the region selector and dates arriving, or the "Proceed to …" button appearing late. Spinnerwaits 1 s before showing dots. Confirm its container reserves the final height.
Page skeletons
- Today: route chunk →
LazyBoundaryspinner; dashboard →Spinner("Loading dashboard"); metrics →MetricOverviewPlaceholder/SummaryMetricPlaceholder(striped header + spinner). - Put a static app-shell skeleton (header, nav, footer, page title area) into
index.html's#root, replaced on first render, so something meaningful paints before JS. - Swap the dashboard-level spinner for a skeleton built from
config.json(title, section layout), so the page structure shows beforeindex.jsonarrives. - Keep the
role="status"announcements and the focus handling inMain.jsxworking with any skeleton.
Rehydration / prerendering
- There's no SSR, so nothing gets rehydrated today. Explore build-time prerendering of
/,/contactand each/dashboard/<key>shell (Vite SSG or a small Node prerender script). The deploy already writes an HTML file per route. Then switch fromcreateRoottohydrateRoot. - Risks:
Application.jsxreadswindow.location.href,sessionStorageregion is only known on the client, and live data changes weekly. Prerender the shell only, not the data, and watch for hydration mismatches. - Bonus: the
<noscript>experience and metadata improve (og:titlewithout JS).
Bundle / main-thread
- Check the entry and dashboard chunk sizes with
npm run size. Look at d3 and Observable Plot duplication,distinct-colors,dateformat, and react-spinners. Check whether theChartContainerpreload delays interactivity on/. - Profile long tasks during chart render on mobile CPU throttling.
Guardrails
- Consider a Lighthouse CI or Playwright perf budget (CLS, bundle size) in
ci.ymlonce there's a baseline.
- Lenguaje dominante
- JavaScript
- Estrellas
- 21
- Forks
- 7
- Merge medio
- 3 d 23 h
- PR fusionados (30 d)
- 23
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de mozilla/ensemble
-
Do not show all data by defaultAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
Los mantenedores suelen responder en 5 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 5 días
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
Los mantenedores suelen responder en 5 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
mozilla/ensemble#496 · 2 comentarios ·
Los mantenedores suelen responder en 5 días
-
Post-deploy housekeeping: build script order, source maps, ogimage.xcf, old static/ treePosiblemente ocupada @stephaniehobson la tomó hace 14 días. Abierto
mozilla/ensemble#488 · 1 asignado ·
Los mantenedores suelen responder en 5 días
Todos los issues de mozilla/ensemble
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Inter-Actief/amelink#140 ·
-
area:tooling priority:p3 scope:infrastructure size:s status:ready type:chore
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
Los mantenedores suelen responder en 1 día
-
pre-existing
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día