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

Link to required components docs in component type docs #16687

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

Jondolf
Copy link
Contributor

@Jondolf Jondolf commented Dec 6, 2024

Objective

#16575 moved required component docs from the Component impl to type docs.

However, it doesn't actually link to what required components are and how they work.

Solution

Link to required components!

Testing

I tested the link for some components in different Bevy crates. I did not test in external third party crates, but I would assume that it should work there too.


Showcase

Link to required components

Note: The tooltip doesn't show the #required-components anchor for some reason, but it is there.

@Jondolf Jondolf added C-Docs An addition or correction to our documentation A-ECS Entities, components, systems, and events D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Dec 6, 2024
@chescock chescock added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Dec 6, 2024
Copy link
Contributor

@SpecificProtagonist SpecificProtagonist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not test in external third party crates, but I would assume that it should work there too.

This works when using bevy_ecs directly, but not when depending on bevy:

A component’s [required components](bevy :: ecs::component::Component#required-components) are inserted whenever it is inserted. Note that this will also insert the required components of the required components, recursively, in depth-first order.

crates/bevy_ecs/macros/src/component.rs Outdated Show resolved Hide resolved
Co-authored-by: SpecificProtagonist <[email protected]>
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Dec 10, 2024
Merged via the queue into bevyengine:main with commit 99b6f1d Dec 10, 2024
27 of 28 checks passed
@Jondolf Jondolf deleted the link-to-required-components branch December 10, 2024 11:27
BD103 pushed a commit to BD103/bevy that referenced this pull request Dec 10, 2024
…6687)

# Objective

bevyengine#16575 moved required component docs from the `Component` impl to type
docs.

However, it doesn't actually link to what [required
components](https://docs.rs/bevy/0.15.0/bevy/ecs/component/trait.Component.html#required-components)
are and how they work.

## Solution

Link to [required
components](https://docs.rs/bevy/0.15.0/bevy/ecs/component/trait.Component.html#required-components)!

## Testing

I tested the link for some components in different Bevy crates. I did
not test in external third party crates, but I would assume that it
should work there too.

---

## Showcase

![Link to required
components](https://github.com/user-attachments/assets/888837dd-29a1-4092-be20-c7c6f0910174)

Note: The tooltip doesn't show the `#required-components` anchor for
some reason, but it is there.

---------

Co-authored-by: Alice Cecile <[email protected]>
Co-authored-by: SpecificProtagonist <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Docs An addition or correction to our documentation D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants