Skip to content
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

docs(migration): state how to register components in content folder as global components #2935

Conversation

BayBreezy
Copy link
Contributor

In v2, this was done automatically. It has to be explicitly added in v3.

The issue raised can be found here #2930

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

While migrating from v2, I noticed that all the components that were once global and could be passed as a string to the <component /> element were no longer being displayed. The components created under components/content were no longer automatically registered as global components.

This PR just adds this note to the migration page so that users know that they have to explicitly mark components within the components/content folder as global.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

… as global components

In v2, this was done automatically. It has to be explicitly added in v3.
@ineshbose
Copy link
Member

Aside from hook, the file names can be renamed to include .global.vue suffix, right?

Copy link
Member

@farnabaz farnabaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. However, this action is not necessary for all users, in your case it is required because you are using these components as dynamic components.

Instead of adding a section, let's add a note in Rendering Components section and notify about changing from global to non-global. And link to Nuxt Custom Components Directories for more details about Nuxt components system.

@BayBreezy
Copy link
Contributor Author

Aside from hook, the file names can be renamed to include .global.vue suffix, right?

Yes. You can do that too. For me, there are too many global components to do this.

@BayBreezy
Copy link
Contributor Author

Nuxt Custom Components Directories

I made the changes just now.
Removed the section and just added another point under the Rendering Components section.

Copy link
Member

@farnabaz farnabaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@farnabaz farnabaz merged commit b7e3ae7 into nuxt:v3 Jan 2, 2025
1 check passed
@Mathias265
Copy link

Beautifull work

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.

4 participants