Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 9, 2026

Preparation for #957 by converting all resolveId, load, and transform hooks in plugin-rsc to nested handler form.

Changes

Converted 18 hooks from direct function form to nested handler object:

// Before
resolveId(source) { ... }
load(id) { ... }
async transform(code, id) { ... }

// After
resolveId: {
  handler(source) { ... }
}
load: {
  handler(id) { ... }
}
transform: {
  async handler(code, id) { ... }
}

Affected hooks:

  • 5 resolveId hooks (rpc-client, assets-manifest, client-references, encryption-key, css-virtual)
  • 7 load hooks (rpc-client, assets-manifest, client-references, client-package, encryption-key, css-virtual, importer-resources)
  • 6 transform hooks (load-environment-module, bootstrap-script, use-client, use-server, css-export, importer-resources)

Pure refactoring—no functional changes. Enables hook filtering and composition patterns required by #957.

Original prompt

I'd like to prepare for #957 by first pure refactoring of making all (or most) of (reoslveId/load/transform) to have nested "handler" form
{ name: 'foo', transform() {} } => { name: 'foo', transform: { handler() {} } }


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Refactor resolveId, load, and transform to nested handler form refactor(plugin-rsc): convert hooks to nested handler form Jan 9, 2026
Copilot AI requested a review from hi-ogawa January 9, 2026 02:20
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.

2 participants