bevy icon indicating copy to clipboard operation
bevy copied to clipboard

BRP methods naming pass

Open Leinnan opened this issue 10 months ago • 5 comments

Consider renaming the methods to be a little more hierarchical. It would make sense to group them more, something like: bevy/mutate_component -> bevy/world/components/mutate bevy/list_resources -> bevy/world/resources/list bevy/insert_resource -> bevy/world/resources/insert bevy/remove_resource -> bevy/world/resources/remove bevy/mutate_resource -> bevy/world/resources/mutate

Leinnan avatar Feb 26 '25 19:02 Leinnan

For a little bit of context, the reason that I didn't find the time to implement this in my PR is basically that I got stunlocked thinking about how to namespace existing things 😅

For example:

  • Does bevy/get belong in some component namespace?
  • What about bevy/query? (By contrast, something like bevy/list is a more clear-cut "yes" to me.)
  • Should there be something like an entity namespace? Entities and components are often interconnected, and query is just as much about locating entities as it is about finding component values.

mweatherley avatar Feb 26 '25 22:02 mweatherley

I was thinking a bit about this and I would split all of the existing calls into bevy/world and bevy/registry. Then in bevy/world we could have categories for resources and components and what does not fit there could be in bevy/world.

Leinnan avatar Feb 27 '25 10:02 Leinnan

@mweatherley do you feel that you would want to do it and make a PR for it before 0.16? Because on the one hand I don't know if I have enough time for it right know myself, but I would really want to make that change before BRP gets more popular and changing it would mean that more people need to adapt to breaking change.

Leinnan avatar Mar 07 '25 15:03 Leinnan

@Leinnan I don't think I will realistically get around to changing this before 0.16 myself.

mweatherley avatar Mar 10 '25 17:03 mweatherley

Hi @Leinnan, @mweatherley or anybody else, would you please review the linked PR #19377?

splo avatar Jun 03 '25 09:06 splo