feat(dev): enable react-refresh for shared dev-server HMR#913
feat(dev): enable react-refresh for shared dev-server HMR#913gu-stav merged 1 commit intofeat/workbenchfrom
Conversation
3b2ed9e to
77332c9
Compare
📦 Bundle Stats —
|
| Metric | Value | vs feat/workbench (e04493e) |
|---|---|---|
| Internal (raw) | 2.1 KB | - |
| Internal (gzip) | 799 B | - |
| Bundled (raw) | 10.95 MB | - |
| Bundled (gzip) | 2.06 MB | - |
| Import time | 818ms | -9ms, -1.0% |
bin:sanity
| Metric | Value | vs feat/workbench (e04493e) |
|---|---|---|
| Internal (raw) | 975 B | - |
| Internal (gzip) | 460 B | - |
| Bundled (raw) | 9.84 MB | - |
| Bundled (gzip) | 1.77 MB | - |
| Import time | 2.23s | -9ms, -0.4% |
🗺️ 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 (e04493e2)
| Metric | Value | vs feat/workbench (e04493e) |
|---|---|---|
| Internal (raw) | 92.4 KB | - |
| Internal (gzip) | 21.6 KB | - |
| Bundled (raw) | 21.53 MB | - |
| Bundled (gzip) | 3.41 MB | - |
| Import time | 781ms | -4ms, -0.5% |
🗺️ 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 (e04493e2)
| Metric | Value | vs feat/workbench (e04493e) |
|---|---|---|
| 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.
770d32d to
f7b42c8
Compare
77332c9 to
e54e790
Compare
|
Claude finished @gu-stav's task in 2m 31s —— View job Review
Missing changeset This PR modifies
In `http://${httpHost || 'localhost'}:${workbenchPort}`
const resolvedHost = (!httpHost || httpHost === '0.0.0.0') ? 'localhost' : httpHost
const reactRefreshHost = closeWorkbenchServer === undefined
? undefined
: `http://${resolvedHost}:${workbenchPort}` |
Pass `reactRefreshHost` to `@vitejs/plugin-react` so federated Studio modules connect their react-refresh preamble to the workbench host, enabling component-level HMR across the module federation boundary. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@joshuaellis Fixed the lockfile in the feature branch and rebased this branch. |
Coverage Delta
Comparing 13 changed files against main @ Overall Coverage
|
Summary
reactRefreshHostto@vitejs/plugin-reactso federated Studio/App modules connect their react-refresh preamble to the workbench host dev serverdevAction.tscomputes the workbench URL and threads it throughstartStudioDevServer/startAppDevServer→startDevServer→getViteConfig→viteReact({reactRefreshHost})Closes SDK-1187