-
-
Couldn't load subscription status.
- Fork 191
Use plugin hook filters internally in plugin-rsc #957
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- plugin-react: Remove redundant filter check since hook filter handles it - plugin-react-swc: Add hook filters for default file extensions (.tsx, .ts, .mts, .jsx, .mdx) - Conditional filter application: Only use filters when parserConfig is not custom Co-authored-by: hi-ogawa <4232207+hi-ogawa@users.noreply.github.com>
Change tsx? to (tsx|ts) to make it clearer that both extensions are matched Co-authored-by: hi-ogawa <4232207+hi-ogawa@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot update only packages/plugin-rsc/src
- Revert changes to plugin-react and plugin-react-swc (per review feedback) - Add @rolldown/pluginutils dependency to plugin-rsc - Add hook filters to transform hooks: rsc:vite-client-raw-import, rsc:inject-async-local-storage, rsc:rsc-css-self-accept - Add hook filters to resolveId hook: rsc:react-server-dom-webpack-alias - Add hook filters to load hooks: virtual modules for assets-manifest and client-references - Remove redundant conditional checks where hook filters now handle the filtering Co-authored-by: hi-ogawa <4232207+hi-ogawa@users.noreply.github.com>
Updated to only apply hook filters to Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
The filter already matches CSS files, so this check is redundant Co-authored-by: hi-ogawa <4232207+hi-ogawa@users.noreply.github.com>
Leverage Vite's native hook filter feature (https://vite.dev/guide/api-plugin.html#hook-filters) to optimize file filtering instead of performing redundant checks in handler functions.
Changes
@vitejs/plugin-rsc
@rolldown/pluginutilsas a dependencyrsc:vite-client-raw-import: Filter by code containing__vite_rsc_raw_import__rsc:inject-async-local-storage: Filter by code containingAsyncLocalStoragersc:rsc-css-self-accept: Filter by CSS files with?directquery parameterrsc:react-server-dom-webpack-alias: Filter by id prefix@vitejs/plugin-rsc/vendor/react-server-dom/\0virtual:vite-rsc/assets-manifest\0virtual:vite-rsc/client-referencesExample
Before:
After:
Benefits
Performance improvement: Vite's native filtering is more efficient as it can filter files before calling the handler
Cleaner code: Removes redundant filtering logic where appropriate
Maintains backward compatibility: All existing tests pass
Fixes use plugin hook filter internally #861
Original prompt
💡 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.