bevy/crates
andriyDev adbb53b87f
Return an error when direct-nested-loading a subasset (#18213)
# Objective

- Prevents #18291.
- Previously, attempting to direct-nested-load a subasset would return
the root of the nested-loaded asset. This is most problematic when doing
direct-nested-**untyped**-loads of subassets, where you may not even
realize you're dealing with the entirely wrong asset (at least with
typed loads, *most of the time* the root asset has a different type from
the subasset, and so at least you'd get an error that the types don't
match).

## Solution

- We now return an error when doing these kinds of loads.

Note an alternative would be to "solve" this problem, by just looking up
the appropriate subasset after doing the nested load. However there's
two problems: 1) we don't know which subassets of the root asset are
necessary for the subasset we are looking up (so any handles in that
subasset may never get registered), 2) a solution will likely hamper
attempts to resolve #18010. AFAICT, no one has complained about this
issue, so it doesn't seem critical to fix this for now.

## Testing

- Added a test to ensure this returns an error. I also checked that the
error before this was just a mismatched type error, meaning it was
trying to pass off the root asset type `CoolText` as the subasset type
`SubText` (which would have worked had I not been using typed loads).
2025-03-13 16:36:18 +00:00
..
bevy_a11y
bevy_animation Update petgraph requirement from 0.6 to 0.7 (#18224) 2025-03-10 07:12:27 +00:00
bevy_app Small cleanup for ECS error handling (#18280) 2025-03-13 00:13:02 +00:00
bevy_asset Return an error when direct-nested-loading a subasset (#18213) 2025-03-13 16:36:18 +00:00
bevy_audio Support for non-browser wasm (#17499) 2025-03-07 21:22:28 +00:00
bevy_color Add Saturation trait to bevy_color (#18202) 2025-03-10 21:52:04 +00:00
bevy_core_pipeline Generic system config (#17962) 2025-03-12 00:12:30 +00:00
bevy_derive allow Call and Closure expressions in hook macro attributes (#18017) 2025-03-06 16:39:11 +00:00
bevy_dev_tools Generic system config (#17962) 2025-03-12 00:12:30 +00:00
bevy_diagnostic Add no_std support to bevy (#17955) 2025-03-07 03:39:46 +00:00
bevy_dylib
bevy_ecs Small cleanup for ECS error handling (#18280) 2025-03-13 00:13:02 +00:00
bevy_encase_derive Internalize BevyManifest logic. Switch to RwLock (#18263) 2025-03-12 00:46:01 +00:00
bevy_gilrs Replace some !Send resources with thread_local! (#17730) 2025-03-04 07:48:02 +00:00
bevy_gizmos Generic system config (#17962) 2025-03-12 00:12:30 +00:00
bevy_gltf Add no_std support to bevy (#17955) 2025-03-07 03:39:46 +00:00
bevy_image Add no_std support to bevy (#17955) 2025-03-07 03:39:46 +00:00
bevy_input Generic system config (#17962) 2025-03-12 00:12:30 +00:00
bevy_input_focus
bevy_internal don't use bevy_pbr for base bevy_gizmos plugin (#17581) 2025-03-10 21:16:52 +00:00
bevy_log Add print_stdout and print_stderr lints (#17446) (#18233) 2025-03-11 19:35:48 +00:00
bevy_macro_utils Switch to ImDocument in BevyManifest (#18272) 2025-03-12 20:15:39 +00:00
bevy_math implement Bounded2d for ConvexPolygon (#18286) 2025-03-13 16:35:52 +00:00
bevy_mesh Fix mesh tangent attribute matching in mesh transform operations (#17992) 2025-03-07 17:39:42 +00:00
bevy_mikktspace Add print_stdout and print_stderr lints (#17446) (#18233) 2025-03-11 19:35:48 +00:00
bevy_pbr Generic system config (#17962) 2025-03-12 00:12:30 +00:00
bevy_picking Sync up the Derive of DragEntry to match the other events (#18220) 2025-03-11 19:58:20 +00:00
bevy_platform_support Support for non-browser wasm (#17499) 2025-03-07 21:22:28 +00:00
bevy_ptr
bevy_reflect Add print_stdout and print_stderr lints (#17446) (#18233) 2025-03-11 19:35:48 +00:00
bevy_remote RPC Discover endpoint with basic informations (#18068) 2025-03-12 23:32:06 +00:00
bevy_render Generic system config (#17962) 2025-03-12 00:12:30 +00:00
bevy_scene Generic system config (#17962) 2025-03-12 00:12:30 +00:00
bevy_sprite Add no_std support to bevy (#17955) 2025-03-07 03:39:46 +00:00
bevy_state Generic system config (#17962) 2025-03-12 00:12:30 +00:00
bevy_tasks Add print_stdout and print_stderr lints (#17446) (#18233) 2025-03-11 19:35:48 +00:00
bevy_text Upgrade to cosmic-text 0.13 (#18239) 2025-03-12 18:03:45 +00:00
bevy_time Generic system config (#17962) 2025-03-12 00:12:30 +00:00
bevy_transform Generic system config (#17962) 2025-03-12 00:12:30 +00:00
bevy_ui Remove the entity index from the UI phase's sort key (#18273) 2025-03-12 17:11:02 +00:00
bevy_utils
bevy_window Rework WindowMode::Fullscreen API (#17525) 2025-03-11 01:20:53 +00:00
bevy_winit Rework WindowMode::Fullscreen API (#17525) 2025-03-11 01:20:53 +00:00