perf(workbench): preload workbench and warmup dev-server files#1042
Merged
gu-stav merged 2 commits intofeat/workbenchfrom May 5, 2026
Merged
perf(workbench): preload workbench and warmup dev-server files#1042gu-stav merged 2 commits intofeat/workbenchfrom
gu-stav merged 2 commits intofeat/workbenchfrom
Conversation
Contributor
📦 Bundle Stats —
|
| Metric | Value | vs feat/workbench (236d11c) |
|---|---|---|
| Internal (raw) | 2.1 KB | - |
| Internal (gzip) | 799 B | - |
| Bundled (raw) | 10.94 MB | - |
| Bundled (gzip) | 2.05 MB | - |
| Import time | 740ms | -2ms, -0.3% |
bin:sanity
| Metric | Value | vs feat/workbench (236d11c) |
|---|---|---|
| Internal (raw) | 975 B | - |
| Internal (gzip) | 460 B | - |
| Bundled (raw) | 9.84 MB | - |
| Bundled (gzip) | 1.77 MB | - |
| Import time | 2.08s | -18ms, -0.9% |
🗺️ View treemap · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
📦 Bundle Stats — @sanity/cli-core
Compared against feat/workbench (236d11ca)
| Metric | Value | vs feat/workbench (236d11c) |
|---|---|---|
| Internal (raw) | 95.5 KB | - |
| Internal (gzip) | 22.5 KB | - |
| Bundled (raw) | 21.62 MB | - |
| Bundled (gzip) | 3.42 MB | - |
| Import time | 700ms | -5ms, -0.8% |
🗺️ View treemap · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
📦 Bundle Stats — create-sanity
Compared against feat/workbench (236d11ca)
| Metric | Value | vs feat/workbench (236d11c) |
|---|---|---|
| Internal (raw) | 976 B | - |
| Internal (gzip) | 507 B | - |
| Bundled (raw) | 50.7 KB | - |
| Bundled (gzip) | 12.6 KB | - |
| Import time | ❌ ChildProcess denied: node | - |
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
Contributor
Coverage Delta
Comparing 39 changed files against main @ Overall Coverage
|
joshuaellis
approved these changes
May 5, 2026
gu-stav
added a commit
that referenced
this pull request
May 5, 2026
* perf(workbench): preload workbench and warmup dev-server files * chore: update auto-generated changeset for PR #1042 --------- Co-authored-by: squiggler-app[bot] <265501495+squiggler-app[bot]@users.noreply.github.com>
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.
Description
Preload the module federation manifest using a
LinkHTTP header and HTML tags and warmup more workbench-related files in Vite.Speeds up loading of workbench - the
remoteUrlis known ahead of time. This reduces the waterfall ofload manifest -> load entrytoload entry.Companion PR: https://github.com/sanity-io/workbench/pull/182
Note
Low Risk
Low risk: changes are limited to the workbench dev-server startup path and only add optional preloading/warmup behavior when a valid remote URL is configured.
Overview
Speeds up workbench startup by preloading the Module Federation manifest when
SANITY_INTERNAL_WORKBENCH_REMOTE_URLis set:writeWorkbenchRuntimenow injectspreconnect+preload as=fetchhints into the generatedindex.html, and the Vite dev server adds a middleware that sets a matchingLinkpreload header on/and/index.html.Improves dev-server responsiveness by expanding Vite
server.warmup.clientFilesto include additional workbench modules and by fire-and-forget fetching the remote manifest to warm the remote's transform/module graph. Tests are extended to cover the new warmup list and header/prefetch behavior.Reviewed by Cursor Bugbot for commit 62b96d1. Bugbot is set up for automated code reviews on this repo. Configure here.