-
-
Notifications
You must be signed in to change notification settings - Fork 728
feat: support sync components #2221
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
β Live Preview ready!
|
β Deploy Preview for nuxt-content ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
β Live Preview ready!
|
| showURL: false | ||
| } | ||
| }, | ||
| components: [], |
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.
WDYT about reusing markdown.tags option for this feature? We can extract all components from markdown.tags map and mark them as global.
!!! This will be a bit confusing if we want to mark a component as global without changing its name.
tags: {
UButton: 'UButton'
}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.
Actually this is a different feature than the tags itself.
We could use markdown.tags to get the extra components as synced though
Co-authored-by: nobkd <[email protected]>
| // Add sync components to use not global components | ||
| const components = (options.components || []).map(pascalCase) | ||
|
|
||
| addPluginTemplate({ |
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.
It would be better if we mark these components as global instead of registering a custom plugin. Marking them as global will help other modules to list these components as global ones. Modules like nuxt-component-meta
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 feature is to avoid using global components and put them in the main bundle of the application actually. I want to see if this improves the performance
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.
I see, Nuxt registers lazy version of global components, but here the goal is to include it directly inside main bundle.
Co-authored-by: nobkd <[email protected]>
|
Merged nuxt/nuxt#22558 to Nuxt, so it will be in v3.7 - might be worth experimenting with but do note my comments in the PR. It might be worth iterating on a few possible alternatives within content. |
π Linked issue
β Type of change
π Description
Add the
componentsoptions to specify the components to add in the main bundle, useful for non-global components from UI library or a way to optimize global components that we use in many pages.π Checklist