-
-
Notifications
You must be signed in to change notification settings - Fork 233
refactor: simplify plugin environment handling #5616
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
Conversation
✅ Deploy Preview for rsbuild ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Pull Request Overview
This PR refactors the plugin environment handling system by removing the RSBUILD_ALL_ENVIRONMENT_SYMBOL
constant and simplifying the logic for matching plugins to environments. The key changes include making environment specifications optional and changing the matching logic to be more explicit.
- Removed
RSBUILD_ALL_ENVIRONMENT_SYMBOL
constant and related logic - Modified
PluginMeta.environment
to be optional, with undefined meaning "all environments" - Simplified environment matching logic with a new
isEnvironmentMatch
function - Refactored plugin removal tracking to use Sets instead of arrays
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
packages/core/src/types/plugin.ts | Made environment property optional in PluginMeta type with documentation |
packages/core/src/pluginManager.ts | Replaced symbol-based logic with optional environment handling and simplified matching |
packages/core/src/initPlugins.ts | Updated function calls to use new environment matching function |
packages/core/src/hooks.ts | Updated function calls to use new environment matching function |
Summary
Improve code readability and simplify plugin environment handling by removing the
RSBUILD_ALL_ENVIRONMENT_SYMBOL
variable.Checklist