perf(tanstack-start): warm the admin panel on dev server start - #17711
Open
r1tsuu wants to merge 1 commit into
Open
perf(tanstack-start): warm the admin panel on dev server start#17711r1tsuu wants to merge 1 commit into
r1tsuu wants to merge 1 commit into
Conversation
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.
Contributor
📦 esbuild Bundle Analysis for payloadThis analysis was generated by esbuild-bundle-analyzer. 🤖 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
/adminrequest — 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:
pnpm devpnpm devTotal CPU work is unchanged; this only moves it off the critical path. Dev only, best-effort, and opt-out via
warmAdmin: falsesince it also initializes Payload and connects to the database at boot.warmAdminPathcovers configs overridingroutes.admin.Also repoints smoke-plugin.mjs at
dist/withPayload/index.js; it importeddist/exports/vite.js, which no longer exists, so the test could not run.