Skip to content

feat: update rolldown to 1.0.0-rc.13#22097

Merged
sapphi-red merged 1 commit intomainfrom
04-01-feat_update_rolldown_to_1.0.0-rc.13
Apr 7, 2026
Merged

feat: update rolldown to 1.0.0-rc.13#22097
sapphi-red merged 1 commit intomainfrom
04-01-feat_update_rolldown_to_1.0.0-rc.13

Conversation

@shulaoda
Copy link
Copy Markdown
Member

@shulaoda shulaoda commented Apr 1, 2026

See https://github.com/rolldown/rolldown/releases/tag/v1.0.0-rc.13


The cause of the CI error in the Vite ecosystem with TanStack Start can be found here: #22097 (comment)

@shulaoda shulaoda requested a review from sapphi-red April 1, 2026 13:40
@sapphi-red sapphi-red added the p3-significant High priority enhancement (priority) label Apr 2, 2026
sapphi-red
sapphi-red previously approved these changes Apr 2, 2026
@sapphi-red
Copy link
Copy Markdown
Member

/ecosystem-ci run

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 2, 2026

Open in StackBlitz

@vitejs/plugin-legacy

pnpm add https://pkg.pr.new/@vitejs/plugin-legacy@22097 -D
npm i https://pkg.pr.new/@vitejs/plugin-legacy@22097 -D
yarn add https://pkg.pr.new/@vitejs/plugin-legacy@22097.tgz -D

vite

pnpm add https://pkg.pr.new/vite@22097 -D
npm i https://pkg.pr.new/vite@22097 -D
yarn add https://pkg.pr.new/vite@22097.tgz -D

commit: e68a65c

@vite-ecosystem-ci

This comment was marked as outdated.

@sapphi-red
Copy link
Copy Markdown
Member

/ecosystem-ci run

@vite-ecosystem-ci

This comment was marked as outdated.

@sapphi-red sapphi-red dismissed their stale review April 2, 2026 07:38

ecosystem-ci seems to be failing

@shulaoda
Copy link
Copy Markdown
Member Author

shulaoda commented Apr 2, 2026

/ecosystem-ci run

@vite-ecosystem-ci

This comment was marked as outdated.

@shulaoda
Copy link
Copy Markdown
Member Author

shulaoda commented Apr 2, 2026

/ecosystem-ci run

@vite-ecosystem-ci

This comment was marked as outdated.

@shulaoda shulaoda force-pushed the 04-01-feat_update_rolldown_to_1.0.0-rc.13 branch from ddf07a2 to fcc0e47 Compare April 5, 2026 11:33
@shulaoda
Copy link
Copy Markdown
Member Author

shulaoda commented Apr 5, 2026

/ecosystem-ci run

@vite-ecosystem-ci
Copy link
Copy Markdown

📝 Ran ecosystem CI on 8a0a612: Open

suite result latest scheduled
ladle ⏹️ cancelled ⏹️ cancelled
laravel failure success
astro failure failure
react-router failure failure
marko success failure
analogjs failure success
tanstack-start failure success
vite-plugin-svelte success failure
vike failure failure
vitest failure failure

nuxt, qwik, quasar, storybook, sveltekit, vite-environment-examples, unocss, vite-plugin-pwa, vite-plugin-react, waku, vite-plugin-cloudflare, vite-plugin-vue, vite-plugin-rsc, vitepress, vuepress, vite-setup-catalogue

@shulaoda
Copy link
Copy Markdown
Member Author

shulaoda commented Apr 7, 2026

Rolldown 1.0.0-rc.13 Upgrade Impact on TanStack Start (Vite Ecosystem CI)

Overview

This document analyzes the build output differences introduced by the Rolldown upgrade from 1.0.0-rc.12 to 1.0.0-rc.13 in the e2e/solid-start/basic project, and explains why this upgrade causes the CI test tanstack-solid-start-e2e-basic-prerender:test:e2e to fail with a timeout on the following test:

malformed path params should return not found on router link

Build Output Summary

Metric rc.12 rc.13
Client asset files 87 122
Server asset files ~125 ~132
main.js size 152 KB 66 KB
server.js size 178 KB 76 KB
modulepreload hints (per page) ~20 ~51
__vite__mapDeps entries in main 79 41
Total build size 2.9 MB 3.3 MB

Key Structural Differences

1. Code Splitting Strategy

rc.12 bundles most route definitions and rendering logic into main.js. 58 createFileRoute calls live inside main.js, and 41 leaf chunks import back from it.

rc.13 splits aggressively. main.js contains only 26 createFileRoute calls, with the rest placed in standalone chunks. No file imports from main.js at all.

2. Modules Extracted in rc.13

The following modules are inlined in rc.12's main.js but split into separate chunks in rc.13:

Module Size Content
Match-CMd9_syg.js 15 KB Match, Outlet, CatchNotFound, renderRouteNotFound
context-D56_tqst-DAx7BrVZ.js 52 KB Solid context / devtools panel
NotFound-CpiKfo6Q.js 1.3 KB Custom NotFound UI component
scripts-DUuW2SEB.js 0.5 KB Script injection helpers

On the server side, rc.13 additionally extracts:

  • async-local-storage.js — TanStack Start storage context
  • createServerFn.js — Server function creation logic
  • manifest.js — Router manifest handling
  • Match-CRcQ8rLY.js — Server-side Match/render logic
  • __tanstack-start-server-fn-resolver.js — Server function resolver

3. Per-Route Chunk Count Increase

Route group rc.12 rc.13
via-beforeLoad 6 8
via-loader 4 6
via-useServerFn 1 2
ssr-* 5 10
_param 2 4
posts._postId 3 4
route-* 4 6

4. Identical Files (Same Content Hash)

17 client-side files are byte-for-byte identical across both builds:

app-Cy8h3dtF.css, awaited-B3OrTn13.js, CatchBoundary-DhOoBXx2.js, createServerFn-BhW5Y4KM.js, esm-DQ7jM6tH.js, invariant-B6f5ATD-.js, link-CxEt9gzN.js, matchContext-Bl20OafP.js, path-e2_0BDJI.js, preload-helper-CVnbIYRO.js, qss-GezKeQw3.js, redirect-wMYcd8fz.js, root-wa0GuppP.js, router-CWuJ0m8g.js, useRouter-c_KpJbZD.js, utils-BS2imn0v.js, web-BGp5RYrY.js

7 server-side files are also identical.

5. Content-Identical but Hash-Different Files

Many leaf components (e.g., via-beforeLoad notFoundComponent splits) have identical source code but different hashes due to changes in the import graph.

Root Cause of the CI Failure

The Failing Test

test('malformed path params should return not found on router link', async ({ page, baseURL }) => {
  await page.goto('/specialChars/malformed')
  await page.waitForURL(`${baseURL}/specialChars/malformed`)

  const link = page.getByTestId('special-malformed-path-link')
  await link.click()
  await page.waitForLoadState('load')

  await expect(
    page.getByTestId('default-not-found-component'),
  ).toBeInViewport()   // ← times out after 5000ms
})

Expected Client-Side Flow (When Hydrated)

  1. The Link component's onClick handler calls e.preventDefault() and router.navigate({ href: "/specialChars/malformed/%E0%A4" })
  2. buildAndCommitLocation parses the href into to, search, and hash
  3. findRouteMatch attempts to decode %E0%A4 (incomplete UTF-8), catches the URIError, and returns null
  4. The router enters the notFound state
  5. CatchNotFound renders the defaultNotFoundComponent (NotFound with data-testid="default-not-found-component")

This flow is functionally identical in both builds — all the relevant code (router-CWuJ0m8g.js, link-CxEt9gzN.js, path-e2_0BDJI.js) shares the same content hash.

Why rc.13 Fails on CI

The issue is a hydration race condition caused by the increased number of modules.

The test does not wait for hydration before clicking the link — it only waits for URL match via waitForURL. On CI runners (shared, resource-constrained), loading and parsing 51 modules takes significantly longer than 20 modules.

rc.12 (passes):

  • 20 modulepreload hints → fast hydration on CI
  • By the time Playwright clicks, the Link component's event handler is bound
  • e.preventDefault() fires → client-side routing handles the malformed path → NotFound renders

rc.13 (fails):

  • 51 modulepreload hints → slow hydration on CI
  • Playwright clicks before hydration completes → no JS event handler is bound yet
  • The browser follows the native <a href="/specialChars/malformed/%E0%A4"> behavior → full page navigation
  • The server must SSR the malformed URL page, and the client must load all 51 modules again to hydrate
  • The total round-trip (server render + 51 module loads + hydration) exceeds the 5000ms toBeInViewport timeout

Why It Passes Locally

Local machines have significantly more resources (faster CPU, disk I/O, no resource contention). Even with 51 modules, hydration completes before Playwright issues the click.

Conclusion

This is not a functional bug in Rolldown. The core application logic is identical between both builds — all relevant code shares the same content hash. The failure is caused by a change in code splitting heuristics in rc.13, which produces significantly more chunks (122 vs 87 client assets, 51 vs 20 modulepreloads). On resource-constrained CI environments, this increases hydration time enough that the Playwright test clicks the link before hydration completes, changing the execution path from client-side routing to native browser navigation and exceeding the test's timeout.

Possible Solutions

On the Rolldown side

The more aggressive code splitting in rc.13 is likely caused by the experimental.chunkOptimization feature. Disabling it should restore the chunk count and module preload behavior to rc.12 levels, resolving the hydration timing issue on CI.

On the TanStack Start side

Add an explicit hydration wait before interacting with the page. The current test clicks the link immediately after waitForURL, which only guarantees the URL has changed — not that the application JS has loaded and hydrated. For example:

await page.goto('/specialChars/malformed')
await page.waitForURL(`${baseURL}/specialChars/malformed`)

+ // Wait for hydration before clicking
+ await page.waitForFunction(() => {
+   const el = document.querySelector('[data-testid="special-malformed-path-link"]')
+   // After hydration, Solid attaches a click handler via event delegation
+   return el !== null && document.body.$$DELEGATES?.has('click')
+ })

const link = page.getByTestId('special-malformed-path-link')
await link.click()

This makes the test resilient to varying chunk counts and CI performance, regardless of the bundler version.

@shulaoda shulaoda force-pushed the 04-01-feat_update_rolldown_to_1.0.0-rc.13 branch from fcc0e47 to e68a65c Compare April 7, 2026 08:55
@shulaoda shulaoda requested a review from sapphi-red April 7, 2026 08:56
@sapphi-red sapphi-red merged commit 51d3e48 into main Apr 7, 2026
28 of 29 checks passed
@sapphi-red sapphi-red deleted the 04-01-feat_update_rolldown_to_1.0.0-rc.13 branch April 7, 2026 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p3-significant High priority enhancement (priority) trigger: preview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants