Skip to content

Commit 6d4cd58

Browse files
authored
Bevy 0.16 migration guide fixes (#2051)
1 parent c0c2d38 commit 6d4cd58

7 files changed

+46
-51
lines changed

release-content/0.16/migration-guides/16331_Rename_PointerDownUp__PointerPressedReleased_in_bevy_picki.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
1-
__`bevy_picking/src/pointer.rs`:__
1+
#### `bevy_picking/src/pointer.rs`
22

33
__`enum PressDirection`:__
4-
5-
-
6-
`PressDirection::Down` changes to `PressDirection::Pressed`.
7-
8-
-
9-
`PressDirection::Up` changes to `PressDirection::Released`.
4+
- `PressDirection::Down` changes to `PressDirection::Pressed`.
5+
- `PressDirection::Up` changes to `PressDirection::Released`.
106

117
These changes are also relevant when working with `enum PointerAction`
128

13-
14-
__`bevy_picking/src/events.rs`:__
9+
#### `bevy_picking/src/events.rs`
1510

1611
Clicking and pressing Events in events.rs categories change from [Down], [Up], [Click] to [Pressed], [Released], [Click].
1712

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
Uses of the `ArgList::push` methods should be replaced with the `with` counterpart.
2-
<details>
3-
oldnewpush_argwith_argpush_refwith_refpush_mutwith_mutpush_ownedwith_ownedpush_boxedwith_boxed</details>
2+
3+
old|new
4+
---|---
5+
push_arg|with_arg
6+
push_ref|with_ref
7+
push_mut|with_mut
8+
push_owned|with_owned
9+
push_boxed|with_boxed
Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,16 @@
11
If you were queuing the structs of hierarchy-related commands or `SendEvent` directly, you will need to change them to the methods implemented on `EntityCommands` (or `Commands` for `SendEvent`):
2-
StructMethod`commands.queue(AddChild { child, parent });``commands.entity(parent).add_child(child);` OR `commands.entity(child).set_parent(parent);``commands.queue(AddChildren { children, parent });``commands.entity(parent).add_children(children);``commands.queue(InsertChildren { children, parent });``commands.entity(parent).insert_children(children);``commands.queue(RemoveChildren { children, parent });``commands.entity(parent).remove_children(children);``commands.queue(ReplaceChildren { children, parent });``commands.entity(parent).replace_children(children);``commands.queue(ClearChildren { parent });``commands.entity(parent).clear_children();``commands.queue(RemoveParent { child });``commands.entity(child).remove_parent()``commands.queue(DespawnRecursive { entity, warn: true });``commands.entity(entity).despawn_recursive();``commands.queue(DespawnRecursive { entity, warn: false });``commands.entity(entity).try_despawn_recursive();``commands.queue(DespawnChildrenRecursive { entity, warn: true });``commands.entity(entity).despawn_descendants();``commands.queue(DespawnChildrenRecursive { entity, warn: false});``commands.entity(entity).try_despawn_descendants();``commands.queue(SendEvent { event });``commands.send_event(event);`
2+
3+
Struct|Method
4+
------|------
5+
`commands.queue(AddChild { child, parent });`|`commands.entity(parent).add_child(child);` OR `commands.entity(child).set_parent(parent);`
6+
`commands.queue(AddChildren { children, parent });`|`commands.entity(parent).add_children(children);`
7+
`commands.queue(InsertChildren { children, parent });`|`commands.entity(parent).insert_children(children);`
8+
`commands.queue(RemoveChildren { children, parent });`|`commands.entity(parent).remove_children(children);`
9+
`commands.queue(ReplaceChildren { children, parent });`|`commands.entity(parent).replace_children(children);`
10+
`commands.queue(ClearChildren { parent });`|`commands.entity(parent).clear_children();`
11+
`commands.queue(RemoveParent { child });`|`commands.entity(child).remove_parent()`
12+
`commands.queue(DespawnRecursive { entity, warn: true });`|`commands.entity(entity).despawn_recursive();`
13+
`commands.queue(DespawnRecursive { entity, warn: false });`|`commands.entity(entity).try_despawn_recursive();`
14+
`commands.queue(DespawnChildrenRecursive { entity, warn: true });`|`commands.entity(entity).despawn_descendants();`
15+
`commands.queue(DespawnChildrenRecursive { entity, warn: false});`|`commands.entity(entity).try_despawn_descendants();`
16+
`commands.queue(SendEvent { event });`|`commands.send_event(event);`
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
>
2-
Fix the missing part of Drag https://github.com/bevyengine/bevy/pull/16950
1+
> Fix the missing part of Drag https://github.com/bevyengine/bevy/pull/16950
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
>
2-
If you’re using a project that builds upon the mobile example, remove the `ios_simulator` feature from your `Cargo.toml` (Bevy now handles this internally).
1+
If you're using a project that builds upon the mobile example, remove the `ios_simulator` feature from your `Cargo.toml` (Bevy now handles this internally).

release-content/0.16/migration-guides/_guides.toml

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,6 @@ prs = [17967]
8888
areas = ["Cross-Cutting"]
8989
file_name = "17967_Upgrade_to_Rust_Edition_2024.md"
9090

91-
[[guides]]
92-
title = "Don't reëxport `bevy_image` from `bevy_render`"
93-
prs = [16163]
94-
areas = ["Cross-Cutting", "Rendering"]
95-
file_name = "16163_Dont_reëxport_bevy_image_from_bevy_render.md"
96-
9791
[[guides]]
9892
title = "BRP strict field in query"
9993
prs = [16725]
@@ -329,7 +323,7 @@ areas = ["ECS"]
329323
file_name = "16348_Remove_deprecated_component_reads_and_writes.md"
330324

331325
[[guides]]
332-
title = "Remove flush_and_reserve_invalid_assuming_no_entities"
326+
title = "Remove `flush_and_reserve_invalid_assuming_no_entities`"
333327
prs = [16460]
334328
areas = ["ECS"]
335329
file_name = "16460_Remove_flush_and_reserve_invalid_assuming_no_entities.md"
@@ -359,7 +353,7 @@ areas = ["ECS"]
359353
file_name = "17977_Renamed_EventWritersend_methods_to_write.md"
360354

361355
[[guides]]
362-
title = "Replace VisitEntities with MapEntities"
356+
title = "Replace `VisitEntities` with `MapEntities`"
363357
prs = [18432]
364358
areas = ["ECS"]
365359
file_name = "18432_Replace_VisitEntities_with_MapEntities.md"
@@ -618,7 +612,7 @@ areas = ["Picking"]
618612
file_name = "16872_Rename_focus_in_bevy_picking_to_hover.md"
619613

620614
[[guides]]
621-
title = "Rename Pointer<Down/Up> -> Pointer<Pressed/Released> in bevy_picking."
615+
title = "Rename `Pointer<Down/Up>` to `Pointer<Pressed/Released>` in `bevy_picking`"
622616
prs = [16331]
623617
areas = ["Picking"]
624618
file_name = "16331_Rename_PointerDownUp__PointerPressedReleased_in_bevy_picki.md"
@@ -875,12 +869,6 @@ prs = [16481]
875869
areas = ["Rendering"]
876870
file_name = "16481_cleanup_bevy_renderlibrs.md"
877871

878-
[[guides]]
879-
title = "doc: fix camera link"
880-
prs = [16827]
881-
areas = ["Rendering"]
882-
file_name = "16827_doc_fix_camera_link.md"
883-
884872
[[guides]]
885873
title = "`ExtractedSprites` slice buffer"
886874
prs = [17041]
@@ -1014,10 +1002,10 @@ areas = ["Windowing"]
10141002
file_name = "17121_Support_texture_atlases_in_CustomCursorImage.md"
10151003

10161004
[[guides]]
1017-
title = ":pencil2: Fix typos across bevy"
1018-
prs = [16702]
1019-
areas = []
1020-
file_name = "16702_pencil2_Fix_typos_across_bevy.md"
1005+
title = "`bevy_utils` Refactor"
1006+
prs = [15801, 16112, 16161, 16951, 17158, 17161, 17250, 17254, 17460, 17577]
1007+
areas = ["Utils"]
1008+
file_name = "bevy_utils_decimation.md"
10211009

10221010
[[guides]]
10231011
title = "Link iOS example with `rustc`, and avoid C trampoline"
@@ -1054,9 +1042,3 @@ title = "Use `target_abi = \"sim\"` instead of `ios_simulator` feature"
10541042
prs = [17702]
10551043
areas = []
10561044
file_name = "17702_Use_target_abi__sim_instead_of_ios_simulator_feature.md"
1057-
1058-
[[guides]]
1059-
title = "`bevy_utils` Refactor"
1060-
prs = [15801, 16112, 16161, 16951, 17158, 17161, 17250, 17254, 17460, 17577]
1061-
areas = ["Utils"]
1062-
file_name = "bevy_utils_decimation.md"
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
`bevy_core` has been removed and its items moved into more appropriate locations.
22
Below are some tables showing where items have been moved to
33

4-
**Structs**
4+
#### Structs
55

66
| Item | 0.15 Path | 0.16 Path |
77
| -------------------------------- | ----------- | ----------------- |
@@ -16,20 +16,20 @@ Below are some tables showing where items have been moved to
1616
| `TaskPoolThreadAssignmentPolicy` | `bevy_core` | `bevy_app` |
1717
| `TypeRegistrationPlugin` | `bevy_core` | _Removed_ |
1818

19-
**Functions**
19+
#### Functions
2020

2121
| Item | 0.15 Path | 0.16 Path |
2222
| -------------------------------- | ----------- | ----------------- |
2323
| `update_frame_count` | `bevy_core` | `bevy_diagnostic` |
2424

25-
**Removed**
25+
#### Removed
2626

27-
- `TypeRegistrationPlugin` no longer exists. If you can’t use a default `App` but still need `Name` registered, do so manually.
27+
`TypeRegistrationPlugin` no longer exists. If you can’t use a default `App` but still need `Name` registered, do so manually.
2828

29-
```rust
30-
// Before
31-
app.add_plugins(TypeRegistrationPlugin);
29+
```rust
30+
// Before
31+
app.add_plugins(TypeRegistrationPlugin);
3232

33-
// After
34-
app.register_type::<Name>();
35-
```.
33+
// After
34+
app.register_type::<Name>();
35+
```

0 commit comments

Comments
 (0)