Added bevy/components
method to BRP, which lists all world components
#16626
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New BRP method to list all available fully qualified components in the active world.
After using the newly added BRP feature and trying to build tools around it, I encountered a common issue. There is no way to get all available fully qualified component names from bevy and user space without accumulating them over each entity. Which has an insane cost attached to it.
This is a Problem If you want to provided auto complete for a query API or just want to know what is available without looking into the source code.
This should not be part of the user space, rather be a common method in bevy_remote itself.
Solution
method
:bevy/components
params
: Noneresult
: An array of fully-qualified type names of all world componentsTesting
server
example with curl and JSON-RPC.Showcase
start the server example
cargo run --example server --features="bevy_remote"
get the list result from the new
bevy/components
methodResult
remote_component_list_response.json