-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Variants derive macro #1616
Variants derive macro #1616
Conversation
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 just realised that in its current state, this is really just EnumFromInner
from enum_derive
, or, for a more modern example, derive_more
's From
.
Unless we can come up with a way to expand this to be significantly more useful for Yew than these other tools, I don't think we can justify maintaining this.
Instead, we could expand the documentation with a section about how to do this, linking to the available derive macros out there.
What do you say?
I only realised this after finishing the rest of the review and I'm not gonna throw away all this work 😅
That sounds fine too! I was completely unaware of that crates existence. Are the docs generated inline like standard Rust docs, or are they done in some other way? |
The Yew Docs? They're generated by Docusaurus which you can find in the Typed children are mentioned here: docs/concepts/html/components.md Also pinging @teymour-aldridge for input. |
I'll see if I can put something together 😄 |
Visit the preview URL for this PR (updated for commit 7c0be67): https://yew-rs--pr1616-variants-derive-macr-falhdmlv.web.app (expires Sat, 28 Nov 2020 01:27:00 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
Please update website/sitebars.json for the new page to show up. |
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.
Sorry for taking a while to get to this.
Note: these are all just suggestions (except a few typo fixes), feel free to voice disagreement 🙃
docs/concepts/components/children.md
Outdated
- You want to restrict the types of components that can be used as children | ||
on this component. |
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.
- You want to restrict the types of components that can be used as children | |
on this component. | |
- You want to only allow objects of a specific type to be used as children for your component |
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.
Most of this I agree with, but is objects the right term here?
on -> of Co-authored-by: Teymour Aldridge <[email protected]>
Typo fix Co-authored-by: Teymour Aldridge <[email protected]>
Reword Co-authored-by: Teymour Aldridge <[email protected]>
Something else => an alternative method Co-authored-by: Teymour Aldridge <[email protected]>
Rewording Co-authored-by: Teymour Aldridge <[email protected]>
Capitialization fix Co-authored-by: Teymour Aldridge <[email protected]>
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.
Sorry, I expected to get this done much sooner but didn't find the time.
I promised to suggest an improved example for the "Sharing properties" section but I ran into some problems. I've added a comment there to explain it.
It's great that we finally have some documentation for children 🎉 |
Looking forward to contributing more to Yew in the future! |
Description
Adds the functionality described in #1613.
Checklist
cargo make pr-flow
Note: I have not added docs for this feature. I'm not sure if that's a requirement for pull requests though, as its not mentioned in
CONTRIBUTING.md
.