Skip to content

Conversation

@Sigma-dev
Copy link
Contributor

Objective

I find myself often confusing add_child and with_child.
Other commands all use verbs to express the action, but with deviates without adding any meaning, whereas spawn is the verb used everywhere else in bevy to describe that exact action.

Therefore I propose renaming it into spawn_child

This opens the conversation on what to do with with_children, as of now spawn_child's hover would still point to it and it wouldn't change.
I am personally for renaming it to spawn_children for the same reasons as with_child (I can add it to this PR, but I thought I'd start here)

Solution

Rename it everywhere and deprecate with_child for the next version, then remove it the version after

@Sigma-dev Sigma-dev force-pushed the feat/rename-with-child-into-spawn-child branch from bce1dac to d556358 Compare November 11, 2025 19:29
@Maxime-Verrier
Copy link

Maxime-Verrier commented Nov 11, 2025

I don't know the talks that lead to the with_child name but EntityCommands::spawn_child doesn't imply it's a child of the entity contained in the EntityCommands.

In fact it confuses me that i got an EntityCommands out of commands::spawn and not just the command that return Self since it looks really like the Commands::spawn method

At least that's my personal opinion on it, maybe i'm too used to the current api.

@hukasu
Copy link
Contributor

hukasu commented Nov 12, 2025

@hukasu hukasu added A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use X-Controversial There is active debate or serious implications around merging this PR S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Nov 12, 2025
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-Usability A targeted quality-of-life change that makes Bevy easier to use S-Needs-Review Needs reviewer attention (from anyone!) to move forward X-Controversial There is active debate or serious implications around merging this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants