Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some missing migration guides from older PRs #1850

Merged
merged 9 commits into from
Nov 26, 2024
13 changes: 0 additions & 13 deletions generate-release/src/github_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,19 +198,6 @@ impl GithubClient {

prs.append(&mut prs_in_page);
page += 1;
if let Some(pr) = prs.last() {
if let Some(datetime_utc) = datetime_utc {
if let Some(closed_at) = pr.closed_at {
if closed_at < datetime_utc {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This data seems to be unreliable, and early filtering here doesn't actually do us any good.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that this filtering seems pointless

println!(
"\x1b[93mSkipping PR closed before the target datetime {}\x1b[0m",
closed_at
);
break;
}
}
}
}
}

// Make sure the older PRs from the last page aren't returned
Expand Down
13 changes: 4 additions & 9 deletions generate-release/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,16 @@ pub fn get_merged_prs(
.context("Failed to get commits")?;
println!("Found {} commits", commits.len());

println!("Getting list of all merged PRs from {from} to {to} with label {label:?}");
println!("Getting list of all merged PRs with label {label:?}");

let base_commit = client.get_commit(from, BevyRepo::Bevy)?;
let base_commit_date = &base_commit.commit.committer.date[0..10];

// We also get the list of merged PRs in batches instead of getting them separately for each commit
let prs = client.get_issues_and_prs(
BevyRepo::Bevy,
IssueState::Merged,
Some(base_commit_date),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not totally clear to me why this helps, based on GH's documentation about the since param in their API, but it does seem to cause more stuff to get generated.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that was my impression too :(

label,
)?;
// We can't set a `since` date, as the PRs requested are filtered by date opened, not date merged
let prs = client.get_issues_and_prs(BevyRepo::Bevy, IssueState::Merged, None, label)?;
println!(
"Found {} merged PRs and {} commits since {} (the base commit date)",
prs.len(),
"Found {} commits since {} (the base commit date)",
commits.len(),
base_commit_date
);
Expand Down
5 changes: 5 additions & 0 deletions release-content/0.15/migration-guides/10193_Cosmic_text.md
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
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.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- TODO -->
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`.
6 changes: 6 additions & 0 deletions release-content/0.15/migration-guides/13186_Wgpu_020.md
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+)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-
- Change `CameraOutputMode` to use `ClearColorConfig` instead of `LoadOp`.
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);
}
}
```
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`.
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.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- TODO -->
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- TODO -->
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).
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.
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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- TODO -->
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
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
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<_>>()`
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.
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.
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.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
n/a
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 {}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
`accesskit`’s `Role::StaticText` variant has been renamed to `Role::Label`.
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`.
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.
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.
Loading