Skip to content

fix(rolldown): bound memory during plugin detail hydration - #592

Draft
hyoban wants to merge 1 commit into
vitejs:mainfrom
hyoban:fix/rolldown-plugin-hydration
Draft

hyoban wants to merge 1 commit into
vitejs:mainfrom
hyoban:fix/rolldown-plugin-hydration

Conversation

@hyoban

@hyoban hyoban commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Description

Opening plugin details on a large Rolldown trace can exhaust the heap: hydration reads every plugin's hook events before filtering, then resolves all transform contents together.

Read indexed hooks in batches of up to 128 calls and 1 MiB of source event bytes, retaining only the requested plugin's metrics. Compare transform contents in groups of up to 128 calls so event payloads and resolved strings can be released between groups. An oversized hook is read alone; this bounds bulk reads rather than imposing a total heap limit.

Linked Issues

None.

Additional context

Adds five regression cases covering call and byte limits, oversized hooks, filtering and ordering across modules, transform equality, and string references with missing index entries. All five fail on the previous implementation and pass with this change. Reader cache eviction is unchanged.

Validation: pnpm lint, pnpm build, and pnpm test --run passed (347 passed, 2 skipped). pnpm typecheck reports the same eight existing Nuxt/Vite plugin type errors as unmodified 59260bfd, in the Oxc, Rolldown, and Vite src/modules/rpc.ts files.

@pkg-pr-new

pkg-pr-new Bot commented Sep 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

@vitejs/devtools

npm i https://pkg.pr.new/@vitejs/devtools@592

@vitejs/devtools-kit

npm i https://pkg.pr.new/@vitejs/devtools-kit@592

@vitejs/devtools-oxc

npm i https://pkg.pr.new/@vitejs/devtools-oxc@592

@vitejs/devtools-rolldown

npm i https://pkg.pr.new/@vitejs/devtools-rolldown@592

@vitejs/devtools-vite

npm i https://pkg.pr.new/@vitejs/devtools-vite@592

@vitejs/devtools-vitest

npm i https://pkg.pr.new/@vitejs/devtools-vitest@592

commit: d0f44bf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant