Skip to content

feat: cache rpc responses for cacheable functions#290

Merged
antfu merged 5 commits intomainfrom
feat/cache
Apr 16, 2026
Merged

feat: cache rpc responses for cacheable functions#290
antfu merged 5 commits intomainfrom
feat/cache

Conversation

@webfansplz
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 16, 2026 16:30
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 16, 2026

Open in StackBlitz

@vitejs/devtools

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

@vitejs/devtools-kit

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

@vitejs/devtools-rolldown

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

@vitejs/devtools-rpc

npm i https://pkg.pr.new/@vitejs/devtools-rpc@290

@vitejs/devtools-self-inspect

npm i https://pkg.pr.new/@vitejs/devtools-self-inspect@290

commit: 3638330

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 introduces opt-in client-side caching for RPC calls by marking certain server RPC functions as cacheable and having the Rolldown DevTools client enable caching based on server-reported function metadata.

Changes:

  • Mark multiple Rolldown RPC query/static functions as cacheable: true.
  • Expose cacheable metadata via the internal devtoolskit:internal:rpc:server:list RPC.
  • Add an RPC cache manager to the DevTools RPC client and enable/configure it from the Rolldown app at connect time.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/rolldown/src/node/rpc/functions/rolldown-list-sessions.ts Mark list-sessions RPC as cacheable.
packages/rolldown/src/node/rpc/functions/rolldown-get-session-summary.ts Mark session summary RPC as cacheable.
packages/rolldown/src/node/rpc/functions/rolldown-get-session-compare-summary.ts Mark compare summary RPC as cacheable.
packages/rolldown/src/node/rpc/functions/rolldown-get-plugin-details.ts Mark plugin details RPC as cacheable.
packages/rolldown/src/node/rpc/functions/rolldown-get-packages.ts Mark packages RPC as cacheable.
packages/rolldown/src/node/rpc/functions/rolldown-get-package-details.ts Mark package details RPC as cacheable.
packages/rolldown/src/node/rpc/functions/rolldown-get-module-info.ts Mark module info RPC as cacheable.
packages/rolldown/src/node/rpc/functions/rolldown-get-chunks-graph.ts Mark chunks graph RPC as cacheable.
packages/rolldown/src/node/rpc/functions/rolldown-get-chunk-info.ts Mark chunk info RPC as cacheable.
packages/rolldown/src/node/rpc/functions/rolldown-get-assets-list.ts Mark assets list RPC as cacheable.
packages/rolldown/src/node/rpc/functions/rolldown-get-asset-details.ts Mark asset details RPC as cacheable.
packages/rolldown/src/app/composables/rpc.ts Enable caching and populate cacheable function list from server metadata.
packages/kit/src/client/rpc.ts Add RpcCacheManager and intercept requests to serve/store cached responses.
packages/core/src/node/rpc/internal/rpc-server-list.ts Include cacheable in server function listing payload.

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

Comment thread packages/kit/src/client/rpc.ts
@antfu antfu merged commit c7f6c6e into main Apr 16, 2026
9 checks passed
@antfu antfu deleted the feat/cache branch April 16, 2026 23:55
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.

3 participants