refactor(workbench): drop reactRefreshHost plumbing#1109
Conversation
📦 Bundle Stats —
|
| Metric | Value | vs feat/workbench (d73d551) |
|---|---|---|
| Internal (raw) | 2.1 KB | -8 B, -0.4% |
| Internal (gzip) | 799 B | -2 B, -0.2% |
| Bundled (raw) | 10.97 MB | -8 B, -0.0% |
| Bundled (gzip) | 2.06 MB | -8 B, -0.0% |
| Import time | 822ms | -5ms, -0.6% |
bin:sanity
| Metric | Value | vs feat/workbench (d73d551) |
|---|---|---|
| Internal (raw) | 1023 B | - |
| Internal (gzip) | 486 B | - |
| Bundled (raw) | 9.84 MB | - |
| Bundled (gzip) | 1.77 MB | - |
| Import time | 2.27s | +18ms, +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 — @sanity/cli-core
Compared against feat/workbench (d73d5518)
| Metric | Value | vs feat/workbench (d73d551) |
|---|---|---|
| Internal (raw) | 99.5 KB | - |
| Internal (gzip) | 23.4 KB | - |
| Bundled (raw) | 21.64 MB | - |
| Bundled (gzip) | 3.43 MB | - |
| Import time | 788ms | -9ms, -1.2% |
🗺️ 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 (d73d5518)
| Metric | Value | vs feat/workbench (d73d551) |
|---|---|---|
| Internal (raw) | 908 B | - |
| Internal (gzip) | 483 B | - |
| Bundled (raw) | 931 B | - |
| Bundled (gzip) | 491 B | - |
| 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.
reactRefreshHost plumbing
|
Claude finished @gu-stav's task in 2m 54s —— View job ReviewI reviewed the diff against Bugbot findings on the latest commit (
Other observations
Suggestions (non-blocking)
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 05b0145. Configure here.
Coverage Delta
Comparing 42 changed files against main @ Overall Coverage
|
…on owns HMR With `dev.remoteHmr: true` landing in `@module-federation/vite` (via workbench PR sanity-io/workbench#208), the federation plugin wires Fast Refresh through the host automatically. The workbench port no longer needs to leak from `devAction` down through `start{Studio,App}DevServer` → `startDevServer` → `getViteConfig` into `@vitejs/plugin-react`. Removing that field exposed `workbenchAvailable` as the last piece of workbench-derived state on `DevActionOptions`, used only to suppress a URL log suffix in the leaf starters. Hoisted that output into `devAction`, which already owns the "Workbench dev server started at …" line — all dev-server output formatting now lives in one place. Net: the build pipeline has zero awareness of whether a workbench host exists. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The federation pipeline no longer creates `.__mf__temp` directories, so the gitignore entry (and the test asserting it gets scaffolded) are obsolete. Removes the entry from the template gitignore, the federated fixture, and the bootstrap test, and drops the changeset that introduced the entry since the change is no longer shipping.
The reactRefreshHost cleanup also dropped the "App dev server started on port X"
and "...ms and running at http://..." lines from the leaf starters and replaced
them with a single "${label} dev server started at ${appUrl}" line in devAction.
That changed user-visible text and broke dev.test.ts on every shard.
Restore the original log lines (and the workbenchAvailable plumbing they depend
on for the no-workbench branch). The reactRefreshHost removal stays untouched —
build pipeline still has zero awareness of workbench hosts.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

Description
With
dev.remoteHmr: truelanding in@module-federation/vite(via workbench PR sanity-io/workbench#208), the federation plugin wires Fast Refresh through the host automatically. The workbench port no longer needs to leak fromdevActiondown throughstart{Studio,App}DevServer→startDevServer→getViteConfiginto@vitejs/plugin-react.Also drops the
.__mf__tempignore entries from templates and fixtures — federation no longer writes that directory at build time, so the entries are stale.Net: the build pipeline has zero awareness of whether a workbench host exists.
Depends on a
@sanity/federationrelease containing sanity-io/workbench#208 before merging.Note
Medium Risk
Changes dev/build server configuration for federated development by removing
reactRefreshHostpropagation into Vite/React, which could impact Fast Refresh/HMR behavior if federation plugin assumptions differ. Also updates template/fixture ignores, low risk but could change generated project git status.Overview
Removes the
reactRefreshHostoption end-to-end (CLIdevAction→start{Studio,App}DevServer→startDevServer→getViteConfig), so federated dev no longer injects a host URL into@vitejs/plugin-reactfor Fast Refresh.Cleans up associated tests and types, and drops stale
.__mf__tempignore entries from templates/fixtures (and the related changeset) now that federation no longer writes that directory.Reviewed by Cursor Bugbot for commit 6da820b. Bugbot is set up for automated code reviews on this repo. Configure here.