bevy/crates
eugineerd 3b6d01972b
Unify filtering by id in EntityClonerBuilder (#19977)
# Objective
#19649 introduced new `*_if_new` and `*_by_bundle_id_*` variations to
`EntityClonerBuilder` filtering functionality, which resulted in
increase in method permutations - there are now 8 allow variants to
support various id types and 2 different insert modes.

## Solution
This PR introduces a new trait `FilterableIds` to unify all id types and
their `IntoIterator` implementations, which is somewhat similar to
`WorldEntityFetch`. It supports `TypeId`, `ComponentId` and `BundleId`,
allowing us to reduce the number of `allow` methods to 4: `allow`,
`allow_if_new`, `allow_by_ids`, `allow_by_ids_if_new`. The function
signature is a bit less readable now, but the docs mention types that
can be passed in.

## Testing
All existing tests pass, performance is unchanged.

---------

Co-authored-by: urben1680 <55257931+urben1680@users.noreply.github.com>
2025-07-07 20:00:37 +00:00
..
bevy_a11y Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_animation consistently dont use smallvec default features (#19972) 2025-07-06 04:25:26 +00:00
bevy_anti_aliasing fix percentage signs in SMAA (#19987) 2025-07-06 22:24:26 +00:00
bevy_app Run RenderStartup in/before extract instead of after it. (#19926) 2025-07-07 01:31:40 +00:00
bevy_asset fix panic looking for extension in multibyte unicode paths (#19933) 2025-07-03 22:27:07 +00:00
bevy_audio SpatialListener now requires a Transform (#19357) 2025-07-07 19:48:57 +00:00
bevy_camera consistently dont use smallvec default features (#19972) 2025-07-06 04:25:26 +00:00
bevy_color Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
bevy_core_pipeline consistently dont use smallvec default features (#19972) 2025-07-06 04:25:26 +00:00
bevy_core_widgets Newtyped ScrollPosition (#19881) 2025-07-01 17:41:48 +00:00
bevy_derive Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_dev_tools Upgrade to Rust 1.88 (#19825) 2025-06-26 19:38:19 +00:00
bevy_diagnostic updating: very very minorly (#19827) 2025-06-26 21:48:20 +00:00
bevy_dylib Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_ecs Unify filtering by id in EntityClonerBuilder (#19977) 2025-07-07 20:00:37 +00:00
bevy_encase_derive Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_feathers Feathers toggle switches. (#19928) 2025-07-03 01:09:31 +00:00
bevy_gilrs Add newlines before impl blocks (#19746) 2025-06-22 23:07:02 +00:00
bevy_gizmos Use RenderStartup in bevy_gizmos. (#19898) 2025-07-02 20:38:37 +00:00
bevy_gltf consistently dont use smallvec default features (#19972) 2025-07-06 04:25:26 +00:00
bevy_image optimize ktx2 level data concatenation (#19845) 2025-06-29 21:59:56 +00:00
bevy_input bevy_input: build warnings without bevy_reflect (#19862) 2025-06-29 17:13:43 +00:00
bevy_input_focus Upgrade to Rust 1.88 (#19825) 2025-06-26 19:38:19 +00:00
bevy_internal make optional crates for mesh, camera, and light (#19997) 2025-07-07 07:35:32 +00:00
bevy_light bevy_light (#19991) 2025-07-07 00:07:38 +00:00
bevy_log Upgrade to Rust 1.88 (#19825) 2025-06-26 19:38:19 +00:00
bevy_macro_utils Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_math consistently dont use smallvec default features (#19972) 2025-07-06 04:25:26 +00:00
bevy_mesh refactor(mesh): move Mesh3d and Mesh2d into bevy_mesh (#19943) 2025-07-04 16:24:21 +00:00
bevy_mikktspace Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_pbr make optional crates for mesh, camera, and light (#19997) 2025-07-07 07:35:32 +00:00
bevy_picking Extract members of PickingPlugin and PointerInputPlugin into new types (#19078) 2025-07-07 19:40:25 +00:00
bevy_platform bevy_platform: clippy without default features (#19860) 2025-06-29 17:12:57 +00:00
bevy_ptr Add newlines before impl blocks (#19746) 2025-06-22 23:07:02 +00:00
bevy_reflect bevy_reflect: Introduce reflect_clone_and_take. (#19944) 2025-07-07 19:57:29 +00:00
bevy_remote Add support for returning all Component and values to query method in the Bevy Remote Protocol (#19857) 2025-07-03 18:51:32 +00:00
bevy_render make optional crates for mesh, camera, and light (#19997) 2025-07-07 07:35:32 +00:00
bevy_scene Upgrade to Rust 1.88 (#19825) 2025-06-26 19:38:19 +00:00
bevy_solari Make render and compute pipeline descriptors defaultable. (#19903) 2025-07-02 18:47:27 +00:00
bevy_sprite Split bevy_camera out of bevy_render (#19949) 2025-07-04 23:31:16 +00:00
bevy_state doc improvement for StateTransition (#19597) 2025-07-07 19:51:46 +00:00
bevy_tasks Update derive_more requirement from 1 to 2 (#19671) 2025-06-24 11:13:04 +00:00
bevy_text consistently dont use smallvec default features (#19972) 2025-07-06 04:25:26 +00:00
bevy_time Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_transform Update derive_more requirement from 1 to 2 (#19671) 2025-06-24 11:13:04 +00:00
bevy_ui consistently dont use smallvec default features (#19972) 2025-07-06 04:25:26 +00:00
bevy_ui_render consistently dont use smallvec default features (#19972) 2025-07-06 04:25:26 +00:00
bevy_utils Have System::run_unsafe return Result. (#19145) 2025-07-03 21:48:09 +00:00
bevy_window bevy_window: fix compilation without default features (#19870) 2025-06-30 20:51:52 +00:00
bevy_winit bevy_winit: fix compile and clippy on wasm (#19869) 2025-06-29 21:30:28 +00:00