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] Add minimal nuxt version to feature/utility - may be a label or a badge #24950

Open
2 of 4 tasks
mkierdev opened this issue Dec 29, 2023 · 11 comments
Open
2 of 4 tasks

Comments

@mkierdev
Copy link

Describe the feature

Nuxt 3.9 introduced new utility called callOnce. https://nuxt.com/docs/api/utils/call-once

However, if you are reading that page you have no idea that Nuxt 3.9 is required in order to use that utility. Maybe it would be possible to mark minimal nuxt version for a feature to work? It can be implemented as a badge or label.

This information can be:

I believe that simple :badge[v3.9] from Docus is more than enough

Additional information

  • Would you be willing to help implement this feature?
  • Could this feature be implemented as a module?

Final checks

@danielroe
Copy link
Member

danielroe commented Dec 29, 2023

A great idea - and @Atinux and I have talked about this...

If we can't automate it, then it would be nice to annotate.

@manniL
Copy link
Member

manniL commented Dec 29, 2023

I remember this was a topic a few times ago and I'm also all for it. Helpful for upgrading versions or when new (future) features are committed but not released yet 👍🏻

@Atinux Atinux closed this as completed in 792cf67 Dec 29, 2023
@manniL
Copy link
Member

manniL commented Dec 29, 2023

@Atinux not sure if that fully closes the issue as documenting the "first version available" of most features would be nice.

@mkierdev
Copy link
Author

callOnce was just an example of how important it is to provide minimal version info across every feature. I understand that it would be impossible to keep versioning whole docs to each nuxt version for various reasons, so this is why a small notice would be helpful.

Small projects can often be up-to-date, but when we talk about large-scale apps with a lot of dependencies it is not so obvious that they can be updated on day 1.

@Atinux Atinux reopened this Dec 29, 2023
@Atinux
Copy link
Member

Atinux commented Dec 29, 2023

Sure thing! Happy to re-open it as we can improve the docs along the way for each composable / feature with the minimal version associated to it 👍

@warflash
Copy link
Member

Linking #23189

@luc122c
Copy link
Contributor

luc122c commented Jan 1, 2024

Hello, this is a great idea! I remember when developing with WordPress they used @since annotations in the docblock. See, for example, the get_block_asset_url function in WordPress. It has an annotation here saying @since 6.4.0 which then shows up in the changelog and also allows for aggregating changes in versions.

It would be easy enough to add @since JSDoc annotations moving forward. It would be time consuming but not too difficult to look back through the changelogs of releases to see when new functions were added. The docs build would need updating to read and reference the versions.

@manniL
Copy link
Member

manniL commented Jan 1, 2024

@luc122c An @since would be a nice start, especially because of the utilization for auto-generation. It might not work for everything though (e.g. not for components).

@luc122c
Copy link
Contributor

luc122c commented Jan 1, 2024

e.g. not for components

@manniL I've just had a play and although the JSDoc does not show in the IDE, the annotation does carry across to the definition file. Perhaps this is something that could be picked up by an extension (e.g. Volar or Nuxtr)?

Screenshot 2024-01-01 at 2 28 18 pm Screenshot 2024-01-01 at 2 27 44 pm

@luc122c
Copy link
Contributor

luc122c commented Jan 6, 2024

I've started adding @since annotations in #25086; please let me know if I'm on the right track! :)

I've also had a look at how the documentation works, but I'm not sure where we can hook in to read this info and inject it into the docs? I see there are hooks available in unbuild but I'm not sure what they are, or if that's even the right place?

@luc122c
Copy link
Contributor

luc122c commented Jan 18, 2024

Roadmap for completing this issue:

Please let me know if there are any additional requests/ideas (e.g. annotating components)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants