Skip to content

add documentation for function component type alias#2435

Closed
sbruton wants to merge 2 commits into
yewstack:masterfrom
sbruton:master
Closed

add documentation for function component type alias#2435
sbruton wants to merge 2 commits into
yewstack:masterfrom
sbruton:master

Conversation

@sbruton
Copy link
Copy Markdown
Contributor

@sbruton sbruton commented Feb 5, 2022

Description

The #[function_component] proc macro currently generates the type alias without any documentation. This causes issues when using the missing_docs lint, especially when using #![deny(missing_docs)].

This PR adds a simple one-line doc tag to the function component's type alias, ending clippy's ceaseless harassment.

Checklist

  • I have run cargo make pr-flow
  • I have reviewed my own code
  • I have added tests – no, doesn't seem relevant

@voidpumpkin voidpumpkin added A-yew-macro Area: The yew-macro crate documentation labels Feb 5, 2022
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 5, 2022

Visit the preview URL for this PR (updated for commit 688a9b8):

https://yew-rs-api--pr2435-master-evghheeu.web.app

(expires Sat, 12 Feb 2022 09:33:43 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@futursolo
Copy link
Copy Markdown
Member

futursolo commented Feb 6, 2022

The attributes of the function component are applied to the hidden inner function at the moment.

I think it might make more sense to extract the doc comments from the original attributes and apply them on the type alias?

@sbruton
Copy link
Copy Markdown
Contributor Author

sbruton commented Feb 8, 2022

Sounds right. I don't have time to do this right now. I'll circle back around when I can and see if it's still outstanding.

@ranile ranile added the S-waiting-on-author Status: awaiting action from the author of the issue/PR label Feb 8, 2022
@ranile ranile closed this in #2478 Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-yew-macro Area: The yew-macro crate documentation S-waiting-on-author Status: awaiting action from the author of the issue/PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants