Commit 937db1e
perf(webapp): SSR-window and virtualize the env vars table
The page server-rendered every row (~13 KB of markup each), producing
a tens-of-MB HTML document and mounting thousands of row components on
hydration, which froze the browser for projects with many variables
across many environments.
- Server-render only the first 50 rows, hydrate those, then switch to
@tanstack/react-virtual over the full dataset after mount via
useLayoutEffect (server and first client render match — no
hydration mismatch).
- Virtualize with a spacer-row technique inside the existing <table>
so column widths and the sticky header are preserved; extract a
shared EnvironmentVariableTableRow used by both the SSR and virtual
paths to avoid drift.
- Seed useFuzzyFilter from the URL `search` param (controlled mode,
matching the Tasks page) so filtering happens at SSR and deep links
render the correct rows in the initial window.
For ~11k rows the document drops from ~150 MB to ~5 MB with 50 SSR
rows; the load freeze is gone.1 parent 311c6cc commit 937db1e
4 files changed
Lines changed: 706 additions & 180 deletions
File tree
- apps/webapp
- app
- components/primitives
- routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.environment-variables
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
136 | | - | |
| 137 | + | |
137 | 138 | | |
138 | | - | |
| 139 | + | |
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
| |||
0 commit comments