-
Notifications
You must be signed in to change notification settings - Fork 142
Add customComponent flag for plugin tag configurations
#2786
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: master
Are you sure you want to change the base?
Conversation
Enables Vue compiler to recognize custom HTML elements
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 adds support for plugins to configure custom HTML elements (Web Components) that should be ignored by the Vue compiler during server-side rendering. This prevents Vue from attempting to resolve custom elements as Vue components, which would cause warnings or errors.
Changes:
- Added optional
customComponentboolean flag to theTagConfigstype definition - Implemented filtering of custom element tags in the Vue compiler configuration
- Updated documentation to explain the new configuration option
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/core/src/plugins/Plugin.ts | Added optional customComponent property to TagConfigs type |
| packages/core/src/Page/PageVueServerRenderer.ts | Collected custom element tags from PluginManager and configured Vue compiler's isCustomElement option |
| docs/devGuide/development/writingPlugins.md | Documented the new customComponent tag configuration property |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2786 +/- ##
=======================================
Coverage 71.67% 71.67%
=======================================
Files 134 134
Lines 7286 7291 +5
Branches 1609 1525 -84
=======================================
+ Hits 5222 5226 +4
- Misses 1937 2019 +82
+ Partials 127 46 -81 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const customElementTags = new Set(Object.entries(PluginManager.tagConfig) | ||
| .filter(([, config]) => config.customComponent) | ||
| .map(([tagName]) => tagName)); |
Copilot
AI
Jan 19, 2026
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.
This new feature lacks test coverage. Consider adding tests to verify that tags with customComponent: true are correctly passed to the Vue compiler's isCustomElement option. This would help ensure the feature works as expected and prevent regressions in the future.
Enables Vue compiler to recognize custom HTML elements
What is the purpose of this pull request?
Overview of changes:
Adds support for plugins to configure specific tags as "custom elements" to be ignored by the Vue compiler.
Currently, if a plugin introduces Custom Elements (Web Components), Vue attempts to resolve them as Vue components during SSR, leading to warnings or errors. This PR allows plugins to opt-in to the
isCustomElementcompiler option viatagConfig.packages/core: UpdatedTagConfigstype inPlugin.tsto include thecustomComponentproperty.packages/core: UpdatedPageVueServerRenderer.tsto collect tags withcustomComponent: truefrom thePluginManagerand pass them to the VuecompilerOptions.isCustomElementcheck.docs: UpdatedwritingPlugins.mdto document the new configuration option.Anything you'd like to highlight/discuss:
Testing instructions:
customComponent: trueare ignored by the Vue component resolver and preserved as custom elements in the output.Proposed commit message: (wrap lines at 72 characters)
Add
customComponentflag for plugin tag configAdds support for plugins to configure specific tags as
"custom elements" to be ignored by the Vue compiler.
Checklist: ☑️
Reviewer checklist:
Indicate the SEMVER impact of the PR:
At the end of the review, please label the PR with the appropriate label:
r.Major,r.Minor,r.Patch.Breaking change release note preparation (if applicable):