Skip to content

fix(plugin-rsc): move onClientReference to wrapResourceProxy and fix dev #1073

Merged
hi-ogawa merged 2 commits intomainfrom
refactor/rsc-on-client-reference
Jan 21, 2026
Merged

fix(plugin-rsc): move onClientReference to wrapResourceProxy and fix dev #1073
hi-ogawa merged 2 commits intomainfrom
refactor/rsc-on-client-reference

Conversation

@hi-ogawa
Copy link
Copy Markdown
Contributor

@hi-ogawa hi-ogawa commented Jan 20, 2026

Summary

  • Consolidate client reference notification by moving it into the resource proxy getter
  • Remove the separate onLoad callback mechanism from setRequireModule
  • Notify onClientReference early in load (production) alongside preload, and in proxy getter for per-request asset collection

Supersedes closes #1070

🤖 Generated with Claude Code

@hi-ogawa hi-ogawa changed the title refactor(plugin-rsc): move onClientReference notification into wrapResourceProxy fix(plugin-rsc): move onClientReference notification into wrapResourceProxy Jan 20, 2026
@hi-ogawa hi-ogawa changed the title fix(plugin-rsc): move onClientReference notification into wrapResourceProxy fix(plugin-rsc): notify onClientReference during dev Jan 20, 2026
@hi-ogawa hi-ogawa added the trigger: preview Trigger pkg.pr.new label Jan 20, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jan 20, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@vitejs/plugin-react@1073
npm i https://pkg.pr.new/@vitejs/plugin-react-oxc@1073
npm i https://pkg.pr.new/@vitejs/plugin-rsc@1073
npm i https://pkg.pr.new/@vitejs/plugin-react-swc@1073

commit: 2747232

@hi-ogawa hi-ogawa changed the title fix(plugin-rsc): notify onClientReference during dev fix(plugin-rsc): move onClientReference to wrapResourceProxy and fix dev Jan 20, 2026
…pResourceProxy`

Consolidate client reference notification by moving it into the resource
proxy getter, which is called on every export access (not memoized by React).
This eliminates the separate `onLoad` callback mechanism.

- Remove `onLoad` option from `setRequireModule`
- Add `id` parameter to `wrapResourceProxy` and make `deps` required
- Notify `onClientReference` early in `load` (production) alongside preload
- Notify `onClientReference` in proxy getter for per-request asset collection

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@hi-ogawa hi-ogawa force-pushed the refactor/rsc-on-client-reference branch from ef5495f to 5406e46 Compare January 20, 2026 02:08
@hi-ogawa hi-ogawa merged commit f3963a7 into main Jan 21, 2026
22 checks passed
@hi-ogawa hi-ogawa deleted the refactor/rsc-on-client-reference branch January 21, 2026 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

trigger: preview Trigger pkg.pr.new

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant