Skip to content

Conversation

@isHavvy
Copy link
Contributor

@isHavvy isHavvy commented Nov 2, 2025

Objective

Explain Local<T> better to newbies.

Solution

Add more examples of how to use Local<T> and document how T is initialized for this type.

I tried to order the examples from basic information to more niche information.

I have no clue if the configuration example is useful or even what it's trying to convey. The blame log shows that there was some configuration thing that was removed.

Furthermore, I added a doc comment to the SystemParam impl giving a very short description of what it provides as a system parameter. I think all non-tuple impls should provide such a blurb so that looking at the implementations for the trait itself provides useful information besides just the name. If that is wanted, an issue should be opened for it. If it is not, either I or the reviewer who commits this can remove the line.

Testing

I ran the doctests. I also built the docs and checked that the links work.

@alice-i-cecile alice-i-cecile added C-Docs An addition or correction to our documentation A-ECS Entities, components, systems, and events S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Nov 3, 2025
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

A few suggestions, but I like the direction of this :)

@isHavvy
Copy link
Contributor Author

isHavvy commented Nov 4, 2025

Review comments addressed.

Also saw a comment in one example that was meant to be deleted after a copy/paste.

Also added another example about using locals to save on reallocations. Do need an opinion on whether it's a good example or not.

@alice-i-cecile
Copy link
Member

Also added another example about using locals to save on reallocations. Do need an opinion on whether it's a good example or not.

I really like this: it's a common and useful pattern.

@alice-i-cecile alice-i-cecile added X-Uncontroversial This work is generally agreed upon D-Straightforward Simple bug fixes and API improvements, docs, test and examples labels Nov 4, 2025
Copy link
Contributor

@Zeophlite Zeophlite left a comment

Choose a reason for hiding this comment

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

Nice

@Zeophlite Zeophlite 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 Nov 5, 2025
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Nov 5, 2025
Merged via the queue into bevyengine:main with commit 0bac137 Nov 5, 2025
42 checks passed
@isHavvy isHavvy deleted the local_param_doc branch November 5, 2025 04:05
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 X-Uncontroversial This work is generally agreed upon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants