Repository navigation
chore(deps): upgrade vite to 8.3.1 and repin bundled dev rolldown to 1.2.9 - #15055
Conversation
… to 1.2.9 Vite 8.3.1 inlines rolldown 1.2.9's browser dev runtime into bundledDevClient.mjs, while its rolldown range (~1.2.9) resolves 1.2.10+. rolldown 1.2.10 dropped the kind argument from registerFactory (rolldown#10915), so with a newer rolldown every lazy import() and HMR update in bundled dev mode fails with 'factory.fn is not a function'. Pin rolldown under vite@8.3.1 to 1.2.9, the version Vite 8.3.1 was built against. The tsdown counter-pin is no longer needed since vite and tsdown now share 1.2.9. The next Vite release serves the runtime from the installed rolldown (vite#23568), so the scoped override stops applying once Vite is bumped past 8.3.1. Co-authored-by: Cody Olsen <stipsan@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📦 Bundle Stats —
|
| Metric | Value | vs main (30dcbdf) | vs v6.16.0 |
|---|---|---|---|
| Internal (raw) | 4.48 MB | - | +45.5 KB, +1.0% |
| Internal (gzip) | 1.11 MB | - | +17.0 KB, +1.5% |
| Bundled (raw) | 13.32 MB | - | +64.4 KB, +0.5% |
| Bundled (gzip) | 3.16 MB | - | +21.3 KB, +0.7% |
| Import time | 1.77s | -8ms, -0.5% | +32ms, +1.8% |
bin:sanity
| Metric | Value | vs main (30dcbdf) | vs v6.16.0 |
|---|---|---|---|
| Internal (raw) | 7.1 KB | - | - |
| Internal (gzip) | 2.9 KB | - | - |
| Bundled (raw) | 7.1 KB | - | - |
| Bundled (gzip) | 2.8 KB | - | - |
| Import time | 5ms | -0ms, -0.8% | +0ms, +2.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.
✅ E2E Tests🟢 174 passed • 🟡 45 flaky • (⚪ 91 skipped) • view full report • view run |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The bundled-dev runtime and HMR verification listed in the testing section remains incomplete.
Review effort: Balanced
Findings: None
What changed in this PR
Upgrades Vite to 8.3.1 while preserving bundled-dev compatibility with Rolldown.
Changes:
- Updates Vite from 8.3.0 to 8.3.1.
- Pins Vite 8.3.1 specifically to Rolldown 1.2.9.
- Removes obsolete Rolldown 1.2.8 resolutions.
| File | Description |
|---|---|
pnpm-workspace.yaml |
Updates the catalog and scopes the Rolldown compatibility override. |
pnpm-lock.yaml |
Resolves Vite and all Rolldown consumers consistently. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Coverage Report
File CoverageNo changed files found. |
The CLI loads sanity.cli.ts without the monorepo export condition, so its sanity/cli import needs packages/sanity/lib/cli.js even though the studio sources themselves resolve from src/. Co-authored-by: Cody Olsen <stipsan@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused dependency update, scoped override, lockfile, upstream references, and verification results are internally consistent.
Review effort: Balanced
Findings: None
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The scoped override, generated lockfile, upstream compatibility details, and documentation are consistent and well verified.
Review effort: Balanced
Findings: None
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
…2.9 (#2034) <!-- CURSOR_AGENT_PR_BODY_BEGIN --> ### Description Ports [sanity-io/sanity#15055](sanity-io/sanity#15055) to this repo. `dev/test-studio` runs `sanity dev` with `unstable_bundledDev: true`, so it has the same exposure. Vite 8.3.1 inlines rolldown 1.2.9's browser dev runtime into `bundledDevClient.mjs`, but declares `rolldown: ~1.2.9`. rolldown 1.2.10 dropped the `kind` argument from `registerFactory` ([rolldown#10915](rolldown/rolldown#10915)). With rolldown 1.2.10 or 1.2.11 under Vite 8.3.1, every lazy `import()` and HMR update in bundled dev fails with `TypeError: factory.fn is not a function`. This PR bumps Vite from 8.2.2 to 8.3.1 and adds a `vite@8.3.1>rolldown: 1.2.9` override. The pin is scoped to 8.3.1 because the next Vite release serves the runtime from the installed rolldown ([vite#23568](vitejs/vite#23568)). Delete it when bumping past 8.3.1. _Testing in progress; description will be updated with results._ <!-- CURSOR_AGENT_PR_BODY_END --> <div><a href="https://cursor.com/agents/bc-8a49abed-56bd-47f4-9e16-fbcde27d80eb?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a> <a href="https://cursor.com/background-agent?bcId=bc-8a49abed-56bd-47f4-9e16-fbcde27d80eb&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a> </div> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Cody Olsen <stipsan@users.noreply.github.com>
Description
Vite 8.3.1 ships the
requestLazyclient that #14835 was waiting for, but thevite>rolldownoverride can't be dropped yet. Vite 8.3.1 still inlines rolldown's browser dev runtime intobundledDevClient.mjs, this time the 1.2.9 runtime, while it declaresrolldown: ~1.2.9. rolldown 1.2.10 dropped thekindargument fromregisterFactoryin both its compiler and its runtime (rolldown#10915). With rolldown 1.2.10 or 1.2.11 under Vite 8.3.1, every lazyimport()and every HMR update in bundled dev mode (unstable_bundledDev) fails withTypeError: factory.fn is not a function.So this PR moves the pin rather than removing it. Vite 8.3.1's rolldown is pinned to 1.2.9, which is the version in Vite's own v8.3.1 lockfile. The pin is scoped to
vite@8.3.1because the next Vite release serves the runtime from the installed rolldown instead (vite#23568, merged on Sept 25 but not released yet), so it stops applying once Vite is bumped. Thetsdown>rolldowncounter-pin is removed: Vite and tsdown now share one rolldown 1.2.9, and rolldown 1.2.8 leaves the lockfile.Alternatives considered:
pnpm installkeeps the locked 1.2.9 for now, but the firstpnpm update rolldownor lockfile maintenance moves Vite to 1.2.11 and breaks bundled dev. CI never runs bundled dev mode, so nothing would catch it.What to review
pnpm-workspace.yaml: the scoped override and its removal condition.pnpm-lock.yaml: Vite 8.3.0 becomes 8.3.1, Vite's rolldown goes from 1.2.8 to 1.2.9, and rolldown 1.2.8 is removed together with its bindings and@oxc-project/types@0.149.0. There are no other resolution changes.AGENTS.md: a separate commit. It adds a one-line gotcha:sanity devneeds built packages becausesanity.cli.tsimportssanity/clifromlib/.Testing
I tested a standalone Vite app with
experimental.bundledDev: an initial bundle, one lazyimport(), and two HMR updates, run from a fresh npm install per row.import()and HMRrequestLazy is not a functionfactory.fn is not a functionfactory.fn is not a functionI then ran
dev/design-studio(bundled dev) on this branch, authenticated, and drove it with Playwright:/@vite/lazychunks returned 200, and an edit toCustomPane.tsxhot-updated in place with no reload. There were no page or console errors.pnpm update rolldown(Vite resolves 1.2.11): Vite's error overlay showedfactory.fn is not a functionfromViteDevRuntime.initModule, and nothing rendered.bundled_dev_vite_8_3_1_rolldown_1_2_9_lazy_load_and_hmr.mp4
Pinned: custom pane after the HMR edit
Without the override: factory.fn is not a function
Other checks that passed:
pnpm install --frozen-lockfile,pnpm check:format,tsc --noEmitplus 17 unit tests for@repo/package.bundleagainst Vite 8.3.1, the@sanity/validationsuite (247 tests), and a sample ofsanitysuites (176 tests). Peer-dependency warnings are the same as onmain.CI on the
mainmerge (a942ef8faa) passes everything except E2E shard 1/4, on both chromium and firefox. That shard's one hard failure isversionStatus.spec.ts:64(deprecated studio version), and the same test fails onmainitself, which is still on Vite 8.3.0 (run for30dcbdf90a, run forf5821c33bf). Its retries hit the studio's "Too many requests" dialog. The earlier oxlint error from #14163 is fixed onmainby #15061.Notes for release
N/A – Internal only
To show artifacts inline, enable in settings.