Skip to content

Update log_layers_ecs example for children macro #18293

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

krunchington
Copy link
Contributor

@krunchington krunchington commented Mar 13, 2025

Objective

Contributes to #18238
Updates the log_layers_ecs, example to use the children! macro.

Note that I did not use a macro, nor Children::spawn for the outer layer. Since the EventReader is borrowed mutably, any .map I did on events.read() was going to have the reference outlive the function body. I believe this scope of change is correct for the PR.

Solution

Updates examples to use the Improved Spawning API merged in #17521

Testing

  • Did you test these changes? If so, how?
    • Opened the examples before and after and verified the same behavior was observed. I did this on Ubuntu 24.04.2 LTS using --features wayland.
  • Are there any parts that need more testing?
    • Other OS's and features can't hurt, but this is such a small change it shouldn't be a problem.
  • How can other people (reviewers) test your changes? Is there anything specific they need to know?
    • Run the examples yourself with and without these changes.
  • If relevant, what platforms did you test these changes on, and are there any important ones you can't test?
    • see above

Showcase

n/a

Migration Guide

n/a

@IQuick143 IQuick143 added A-ECS Entities, components, systems, and events C-Examples An addition or correction to our examples A-UI Graphical user interfaces, styles, layouts, and widgets D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Mar 13, 2025
@krunchington
Copy link
Contributor Author

The more I look at trying to make the outer spawniter work, the more I feel like the submitted changes are the right scope, especially since we reverted the spawniter changes in other related PRs. I think this is ready for straightforward review. Editing PR description to remove the extra context.

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 A-UI Graphical user interfaces, styles, layouts, and widgets C-Examples An addition or correction to our examples D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants