-
Notifications
You must be signed in to change notification settings - Fork 351
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some missing migration guides from older PRs (#1850)
- Loading branch information
1 parent
291bda9
commit e3e3973
Showing
30 changed files
with
292 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
- `Text2dBounds` has been replaced with `TextBounds`, and it now accepts `Option`s to the bounds, instead of using `f32::INFINITY` to indicate lack of bounds | ||
- Textsizes should be changed, dividing the current size with 1.2 will result in the same size as before. | ||
- `TextSettings` struct is removed | ||
- Feature `subpixel_alignment` has been removed since cosmic-text already does this automatically | ||
- TextBundles and things rendering texts requires the `CosmicBuffer` Component on them as well |
11 changes: 11 additions & 0 deletions
11
...tion-guides/10823_Generalized_IntoAssetSourceId_and_IntoAssetPath_Implementa.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
In areas where these implementations where being used, you can now add `from_static` in order to get the original specialised implementation which avoids creating an `Arc` internally. | ||
|
||
```rust | ||
// Before | ||
let asset_path = AssetPath::from("my/path/to/an/asset.ext"); | ||
|
||
// After | ||
let asset_path = AssetPath::from_static("my/path/to/an/asset.ext"); | ||
``` | ||
|
||
To be clear, this is only required if you wish to maintain the performance benefit that came with the specialisation. Existing code is _not_ broken by this change. |
1 change: 1 addition & 0 deletions
1
...tent/0.15/migration-guides/12637_check_sampler_type_in_as_bind_group_derives.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!-- TODO --> |
1 change: 1 addition & 0 deletions
1
...tion-guides/13045_Support_on_thread_spawn_and_on_thread_destroy_for_TaskPool.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- `TaskPooolThreadAssignmentPolicy` now has two additional fields: `on_thread_spawn` and `on_thread_destroy`. Please consider defaulting them to `None`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- Updated to `wgpu` 0.20, `naga` 0.20, and `naga_oil` 0.14 | ||
- All of Naga’s [`Capabilities`](https://docs.rs/naga/latest/naga/valid/struct.Capabilities.html) should now be properly detected and supported. | ||
- Timestamps inside encoders are now disallowed on WebGPU to follow the spec (they still work on native). Use the `TIMESTAMP_QUERY_INSIDE_ENCODERS ` wgpu feature to check for support. | ||
- You can now use many numeric built-ins in `const` contexts (eg. `abs`, `cos`, `floor`, `max`, etc, see https://github.com/gfx-rs/wgpu/blob/v0.20/CHANGELOG.md#wgsl-const-evaluation-for-many-more-built-ins for the whole list) | ||
- You can now use Subgroup operations in shaders on supported hardware (see https://github.com/gfx-rs/wgpu/blob/v0.20/CHANGELOG.md#subgroup-operations for limitations and which features to check) | ||
- `u64` and `i64` are now supported in shaders on supported hardware (requires the `SHADER_INT64 ` feature, supported on desktop Vulkan, DX12 with DXC, and Metal with MSL 2.3+) |
2 changes: 2 additions & 0 deletions
2
...ation-guides/13419_Allow_mix_of_hdr_and_nonhdr_cameras_to_same_render_target.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- | ||
- Change `CameraOutputMode` to use `ClearColorConfig` instead of `LoadOp`. |
30 changes: 30 additions & 0 deletions
30
....15/migration-guides/13707_Make_gLTF_node_children_Handle_instead_of_objects.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
If accessing children, use `Assets<GltfNode>` resource to get the actual child object. | ||
|
||
__Before__ | ||
|
||
```rs | ||
fn gltf_print_first_node_children_system(gltf_component_query: Query<Handle<Gltf>>, gltf_assets: Res<Assets<Gltf>>, gltf_nodes: Res<Assets<GltfNode>>) { | ||
for gltf_handle in gltf_component_query.iter() { | ||
let gltf_root = gltf_assets.get(gltf_handle).unwrap(); | ||
let first_node_handle = gltf_root.nodes.get(0).unwrap(); | ||
let first_node = gltf_nodes.get(first_node_handle).unwrap(); | ||
let first_child = first_node.children.get(0).unwrap(); | ||
println!("First nodes child node name is {:?)", first_child.name); | ||
} | ||
} | ||
``` | ||
|
||
__After__ | ||
|
||
```rs | ||
fn gltf_print_first_node_children_system(gltf_component_query: Query<Handle<Gltf>>, gltf_assets: Res<Assets<Gltf>>, gltf_nodes: Res<Assets<GltfNode>>) { | ||
for gltf_handle in gltf_component_query.iter() { | ||
let gltf_root = gltf_assets.get(gltf_handle).unwrap(); | ||
let first_node_handle = gltf_root.nodes.get(0).unwrap(); | ||
let first_node = gltf_nodes.get(first_node_handle).unwrap(); | ||
let first_child_handle = first_node.children.get(0).unwrap(); | ||
let first_child = gltf_nodes.get(first_child_handle).unwrap(); | ||
println!("First nodes child node name is {:?)", first_child.name); | ||
} | ||
} | ||
``` |
2 changes: 2 additions & 0 deletions
2
.../0.15/migration-guides/13717_Uncouple_DynamicTextureAtlasBuilder_from_assets.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- Replace the `glyph_id` and `subpixel_offset` of a few text atlas APIs by a single `place_glyph: PlacedGlyph` parameter trivially combining the two. | ||
- `DynamicTextureAtlasBuilder::add_texture` now takes a `&mut Image`, rather than a `Handle<Image>`. To access this, fetch the underlying image using `Assets<Image>::get_mut`. |
9 changes: 9 additions & 0 deletions
9
release-content/0.15/migration-guides/13727_Add_mappings_to_EntityMapper.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
- If you are implementing `EntityMapper` yourself, you can use the below as a stub implementation: | ||
|
||
```rust | ||
fn mappings(&self) -> impl Iterator<Item = (Entity, Entity)> { | ||
unimplemented!() | ||
} | ||
``` | ||
|
||
- If you were using `EntityMapper` as a trait object (`dyn EntityMapper`), instead use `dyn DynEntityMapper` and its associated methods. |
1 change: 1 addition & 0 deletions
1
.../0.15/migration-guides/13745_Improve_error_handling_for_AssetServeradd_async.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!-- TODO --> |
1 change: 1 addition & 0 deletions
1
...tion-guides/13759_Adds_back_in_way_to_convert_color_to_u8_array_implemented_.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!-- TODO --> |
1 change: 1 addition & 0 deletions
1
...-content/0.15/migration-guides/13760_Add_Display_implementation_to_DebugName.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- In code which uses DebugName you should now use the Display implementation rather than the Debug implementation (ie {} instead of {:?} if you were printing it out). |
2 changes: 2 additions & 0 deletions
2
...ase-content/0.15/migration-guides/13784_Rename_and_Extend_Run_Conditions_API.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- The `and_then` run condition method has been replaced with the `and` run condition method. | ||
- The `or_else` run condition method has been replaced with the `or` run condition method. |
1 change: 1 addition & 0 deletions
1
...5/migration-guides/13837_Use_a_well_defined_type_for_sides_in_RegularPolygon.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- `RegularPolygon` now uses `u32` instead of `usize` for the number of sides |
1 change: 1 addition & 0 deletions
1
...gration-guides/13919_IntoSystemConfigschain_ignore_deferreds_return_type_fix.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!-- TODO --> |
1 change: 1 addition & 0 deletions
1
...tion-guides/13927_Use_u32_for_all_resolutionsubdivision_fields_in_bevy_gizmo.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- All gizmos now take `u32` instead of `usize` for their resolution/subdivision/segment counts |
1 change: 1 addition & 0 deletions
1
...igration-guides/13930_Use_u32_for_resolutionsubdivision_in_primitive_meshing.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- All primitive mesh builders now take `u32` instead of `usize` for their resolution/subdivision/segment counts |
1 change: 1 addition & 0 deletions
1
...tion-guides/13934_Change_Worldinspect_entity_to_return_an_Iterator_instead_o.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- `World::inspect_entity` now returns an `Iterator` instead of a `Vec`. If you need a `Vec`, immediately collect the iterator: `world.inspect_entity(entity).collect<Vec<_>>()` |
1 change: 1 addition & 0 deletions
1
...se-content/0.15/migration-guides/14001_Handle_CtrlC_in_the_terminal_properly.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
If you are overriding the `Ctrl+C` handler then you should call `TerminalCtrlCHandlerPlugin::gracefully_exit` from your handler. It will tell the app to exit. |
3 changes: 3 additions & 0 deletions
3
...tion-guides/14017_Make_default_behavior_for_BackgroundColor_and_BorderColor_.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
- `BackgroundColor` no longer tints the color of images in `ImageBundle` or `ButtonBundle`. Set `UiImage::color` to tint images instead. | ||
- The default texture for `UiImage` is now a transparent white square. Use `UiImage::solid_color` to quickly draw debug images. | ||
- The default value for `BackgroundColor` and `BorderColor` is now transparent. Set the color to white manually to return to previous behavior. |
1 change: 1 addition & 0 deletions
1
...tion-guides/14048_Added_feature_switch_to_default_Standard_Materials_new_ani.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Add feature pbr_anisotropy_texture if you are using that texture in any standard materials. |
1 change: 1 addition & 0 deletions
1
....15/migration-guides/14052_Merge_BuildWorldChildren_and_BuildChildren_traits.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
n/a |
38 changes: 38 additions & 0 deletions
38
...se-content/0.15/migration-guides/14082_Optimize_common_usages_of_AssetReader.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
The trait method `bevy_asset::io::AssetReader::read` (and `read_meta`) now return an opaque type instead of a boxed trait object. Implementors of these methods should change the type signatures appropriately | ||
|
||
```rust | ||
impl AssetReader for MyReader { | ||
// Before | ||
async fn read<'a>(&'a self, path: &'a Path) -> Result<Box<Reader<'a>>, AssetReaderError> { | ||
let reader = // construct a reader | ||
Box::new(reader) as Box<Reader<'a>> | ||
} | ||
|
||
// After | ||
async fn read<'a>(&'a self, path: &'a Path) -> Result<impl Reader + 'a, AssetReaderError> { | ||
// create a reader | ||
} | ||
} | ||
``` | ||
|
||
`bevy::asset::io::Reader` is now a trait, rather than a type alias for a trait object. Implementors of `AssetLoader::load` will need to adjust the method signature accordingly | ||
|
||
```rust | ||
impl AssetLoader for MyLoader { | ||
async fn load<'a>( | ||
&'a self, | ||
// Before: | ||
reader: &'a mut bevy::asset::io::Reader, | ||
// After: | ||
reader: &'a mut dyn bevy::asset::io::Reader, | ||
_: &'a Self::Settings, | ||
load_context: &'a mut LoadContext<'_>, | ||
) -> Result<Self::Asset, Self::Error> { | ||
} | ||
``` | ||
|
||
Additionally, implementors of `AssetReader` that return a type implementing `futures_io::AsyncRead` and `AsyncSeek` might need to explicitly implement `bevy::asset::io::Reader` for that type. | ||
|
||
```rust | ||
impl bevy::asset::io::Reader for MyAsyncReadAndSeek {} | ||
``` |
1 change: 1 addition & 0 deletions
1
release-content/0.15/migration-guides/14091_Bump_accesskit_to_016.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
`accesskit`’s `Role::StaticText` variant has been renamed to `Role::Label`. |
2 changes: 2 additions & 0 deletions
2
...-content/0.15/migration-guides/7207_reflect_implement_the_unique_reflect_rfc.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- Most instances of `dyn Reflect` should be changed to `dyn PartialReflect` which is less restrictive, however trait bounds should generally stay as `T: Reflect`. | ||
- The new `PartialReflect::{as_partial_reflect, as_partial_reflect_mut, into_partial_reflect, try_as_reflect, try_as_reflect_mut, try_into_reflect}` methods as well as `Reflect::{as_reflect, as_reflect_mut, into_reflect}` will need to be implemented for manual implementors of `Reflect`. |
1 change: 1 addition & 0 deletions
1
release-content/0.15/migration-guides/8997_Optional_UI_rendering.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
`UiPlugin` has a new field `enable_rendering`. If set to false, the UI’s rendering systems won’t be added to the `RenderApp` and no UI elements will be drawn. The layout and interaction components will still be updated as normal. |
1 change: 1 addition & 0 deletions
1
release-content/0.15/migration-guides/9889_Simplified_ui_stack_system.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
The `ZIndex` enum has been split into two separate components `ZIndex` (which replaces `ZIndex::Local`) and `GlobalZIndex` (which replaces `ZIndex::Global`). An entity can have both a `ZIndex` and `GlobalZIndex`, in comparisons `ZIndex` breaks ties if two `GlobalZindex` values are equal. |
Oops, something went wrong.