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

Rename useMeta to useHead #13651

Closed
pi0 opened this issue Apr 4, 2022 · 9 comments · Fixed by nuxt/framework#4066
Closed

Rename useMeta to useHead #13651

pi0 opened this issue Apr 4, 2022 · 9 comments · Fixed by nuxt/framework#4066
Assignees

Comments

@pi0
Copy link
Member

pi0 commented Apr 4, 2022

@atinux One issue is that useMeta shall be renamed to useHead from my POV (to be consistent with Nuxt 2 as well and avoid confusion with router meta)

Renaming meta to head, can make API consistent and familiar with Nuxt 2 and less chance of confusing with arbitrary meta definitions such as (more importantly) definePageMeta.

Copy link
Member

atinux commented Apr 4, 2022

I believe we can keep useMeta as an alias + display a warning about migrating to useHead and useMeta will be removed for Nuxt 3 stable version.

@pi0
Copy link
Member Author

pi0 commented Apr 4, 2022

I believe we can keep useMeta as an alias + display a warning about migrating to useHead and useMeta will be removed for Nuxt 3 stable version.

Certainly we would need backward compatibility and deprecate option and composable first :)

Copy link
Member

atinux commented Apr 4, 2022

Is this something that you want to work on @danielroe ?

Copy link
Member

atinux commented Apr 4, 2022

Or do you have any suggestions or things that we may missed regarding the renaming?

@antfu
Copy link
Member

antfu commented Apr 4, 2022

I guess also the meta configure entry in nuxt.config.js for consistency? I agree with moving to head as meta also, as meta sounds a bit too general(or ambiguous) to me.

@danielroe
Copy link
Member

I am okay with renaming it useHead (and having head and head() options in config/components instead of meta and head()). It will reduce confusion but not entirely settle it.

@danielroe danielroe self-assigned this Apr 4, 2022
@frbuceta
Copy link
Contributor

frbuceta commented Apr 4, 2022

This is an off-topic but related to useMeta... In nuxt@2 you could define a layout-level middleware that would affect all the pages that use it. Would this be possible in nuxt@3?

@Intevel
Copy link
Contributor

Intevel commented Apr 4, 2022

Related to that, should the shortcuts be renamed then too? #13555

Copy link
Member

atinux commented Apr 5, 2022

Updating the issue, I think the shortcuts should reflect the current html tag, useMetaDescription still makes sense.

@danielroe danielroe added the 3.x label Jan 19, 2023
@danielroe danielroe transferred this issue from nuxt/framework Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants