Skip to content

perf(tanstack-start): warm the admin panel on dev server start - #17711

Open
r1tsuu wants to merge 1 commit into
mainfrom
feat/tanstack-warm-admin
Open

perf(tanstack-start): warm the admin panel on dev server start#17711
r1tsuu wants to merge 1 commit into
mainfrom
feat/tanstack-warm-admin

Conversation

@r1tsuu

@r1tsuu r1tsuu commented Aug 7, 2026

Copy link
Copy Markdown
Member

The admin's server-side module graph is ~1,900 modules (mostly @payloadcms/ui) and can't be externalized or pre-bundled, because the RSC pipeline needs each module's 'use client' directives and CSS imports. Vite has no persistent cache for that transform, so it reruns every dev boot.

On demand, the whole cost lands on the first /admin request — however long the developer waited before navigating, since nothing starts until the request arrives. Warming at startup overlaps it with switching to the browser.

Wait before the admin renders, blank template on an M4 Max:

Developer navigates Before After
6s after pnpm dev 8.2s 4.0s
12s after pnpm dev 8.0s 0.05s

Total CPU work is unchanged; this only moves it off the critical path. Dev only, best-effort, and opt-out via warmAdmin: false since it also initializes Payload and connects to the database at boot. warmAdminPath covers configs overriding routes.admin.

Also repoints smoke-plugin.mjs at dist/withPayload/index.js; it imported dist/exports/vite.js, which no longer exists, so the test could not run.

The admin's server-side module graph is ~1,900 modules (mostly
`@payloadcms/ui`) and can't be externalized or pre-bundled, because the RSC
pipeline needs each module's `'use client'` directives and CSS imports. Vite
has no persistent cache for that transform, so it reruns every dev boot.

On demand, the whole cost lands on the first `/admin` request — however long
the developer waited before navigating, since nothing starts until the
request arrives. Warming at startup overlaps it with switching to the browser.

Wait before the admin renders, blank template on an M4 Max:

| Developer navigates | Before | After |
| --- | --- | --- |
| 6s after `pnpm dev` | 8.2s | 4.0s |
| 12s after `pnpm dev` | 8.0s | 0.05s |

Total CPU work is unchanged; this only moves it off the critical path. Dev
only, best-effort, and opt-out via `warmAdmin: false` since it also
initializes Payload and connects to the database at boot. `warmAdminPath`
covers configs overriding `routes.admin`.

Also repoints smoke-plugin.mjs at `dist/withPayload/index.js`; it imported
`dist/exports/vite.js`, which no longer exists, so the test could not run.
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

📦 esbuild Bundle Analysis for payload

This analysis was generated by esbuild-bundle-analyzer. 🤖
This PR introduced no changes to the esbuild bundle! 🙌

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant