Skip to content

refactor(rolldown): derive package data from rolldown logs#365

Open
webfansplz wants to merge 5 commits into
mainfrom
refactor/packages
Open

refactor(rolldown): derive package data from rolldown logs#365
webfansplz wants to merge 5 commits into
mainfrom
refactor/packages

Conversation

@webfansplz
Copy link
Copy Markdown
Member

Be related to rolldown/rolldown#9399, Close #160

Screenshot:

iShot_2026-05-25_17 29 16 iShot_2026-05-25_17 28 10

Copilot AI review requested due to automatic review settings May 26, 2026 00:32
@webfansplz webfansplz marked this pull request as draft May 26, 2026 00:33
@webfansplz webfansplz force-pushed the refactor/packages branch from 04b4080 to 172a99a Compare May 26, 2026 00:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the Rolldown DevTools “Packages” data flow to stop reading node_modules after build and instead derive package metadata directly from Rolldown logs (via the new PackageGraphReady event), improving determinism for post-build analysis.

Changes:

  • Switch package collection to use Rolldown’s package graph (PackageGraphReady) and persist it in the log cache.
  • Update shared types and UI to use a stable package id, add support messaging when package graph data is unavailable, and surface “unbundled” packages.
  • Remove @pnpm/read-project-manifest usage/dependency and bump log cache version.

Reviewed changes

Copilot reviewed 13 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pnpm-workspace.yaml Removes the pnpm manifest reader catalog entry (no longer needed for package discovery).
packages/rolldown/src/shared/types/data.ts Adds PackageInfo.id, PackageInfo.isUsed, and introduces PackageMeta return shape.
packages/rolldown/src/node/rpc/functions/rolldown-get-packages.ts Derives package list from Rolldown package graph logs and returns PackageMeta.
packages/rolldown/src/node/rolldown/log-cache.ts Bumps cache version and persists packageGraphReady + packages in cached manager snapshots.
packages/rolldown/src/node/rolldown/events-reader.ts Includes PackageGraphReady in package summary reads.
packages/rolldown/src/node/rolldown/events-manager.ts Handles PackageGraphReady to populate manager.packages and readiness flag.
packages/rolldown/src/node/rolldown/tests/events-reader.test.ts Adds coverage asserting PackageGraphReady is read into the manager.
packages/rolldown/src/app/pages/session/[session]/packages.vue Updates UI to consume PackageMeta, use id for selection, and adds unsupported-build messaging.
packages/rolldown/src/app/pages/compare/[sessions]/index.vue Adapts compare page to the new PackageMeta RPC response.
packages/rolldown/src/app/components/packages/Table.vue Uses id as stable key/query param and adds an “Unbundled” badge + empty-size display.
packages/rolldown/src/app/components/packages/Duplicated.vue Enables “used/unbundled” badge display in duplicated package groups.
packages/rolldown/src/app/components/data/PackageDetailsLoader.vue Switches details loading to use package id and simplifies name handling.
packages/rolldown/package.json Removes @pnpm/read-project-manifest and the previous inlined dependency list.
packages/core/src/client/webcomponents/.generated/css.ts Regenerated CSS output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/rolldown/package.json
Comment thread packages/rolldown/src/node/rpc/functions/rolldown-get-packages.ts
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 26, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@vitejs/devtools@365
npm i https://pkg.pr.new/@vitejs/devtools-kit@365
npm i https://pkg.pr.new/@vitejs/devtools-rolldown@365
npm i https://pkg.pr.new/@vitejs/devtools-self-inspect@365

commit: 9ce22a3

@webfansplz webfansplz force-pushed the refactor/packages branch from 351f380 to 9ce22a3 Compare May 26, 2026 01:06
@webfansplz webfansplz marked this pull request as ready for review May 26, 2026 01:08
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.

Vite: Avoid reading node_modules after building

2 participants