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(nuxt): add @since
annotations to exported composables
#25086
Conversation
Run & review this pull request in StackBlitz Codeflow. |
I am wondering whether we should inform about |
@DamianGlowala I thought about this myself. I opted to add them 1) so that they would show up in IntelliSense and 2) for completeness. I'm happy to be overruled by the Nuxt team though π |
I'm happy to have 3.0.0 for the record (then, if we ever omit one, it means for sure that we need to add a |
AI just blew my mind. I asked Phind:
It replied:
And in the terminal:
Which led me to nuxt/framework#8225 which was included in |
All composables exported from |
export function useRequestFetch (): typeof global.$fetch { | ||
if (import.meta.client) { | ||
return globalThis.$fetch | ||
} | ||
return useRequestEvent()?.$fetch as typeof globalThis.$fetch || globalThis.$fetch | ||
} | ||
|
||
/** @since 3.0.0 */ |
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.
When a function has multiple overloads, does each one need it's own annotation? I see that the last overload has a @deprecated
annotation which does not affect the first.
Also, what about the case where a new overload is added in a newer version, can that have it's own @since
annotation?
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'm happy to stick with just one for now.
export function useRequestFetch (): typeof global.$fetch { | ||
if (import.meta.client) { | ||
return globalThis.$fetch | ||
} | ||
return useRequestEvent()?.$fetch as typeof globalThis.$fetch || globalThis.$fetch | ||
} | ||
|
||
/** @since 3.0.0 */ |
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'm happy to stick with just one for now.
Co-authored-by: Daniel Roe <daniel@roe.dev>
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.
Thank you! β€οΈ
π Linked issue
#24950
β Type of change
π Description
This PR is a first step, adding
@since
annotations to exported composables.What is
@since
?As specified by JSDoc
Methodology
π Checklist