From 3067cb39430e271e103668693f9f9edd745800ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9l=C3=A8ne=20Amanita?= Date: Mon, 10 Jul 2023 12:44:01 +0100 Subject: [PATCH 1/5] Add missing details for UI in Migration Guide 0.10 -> 0.11 --- .../migration-guides/0.10-0.11/_index.md | 41 ++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/content/learn/migration-guides/0.10-0.11/_index.md b/content/learn/migration-guides/0.10-0.11/_index.md index 8a105e83a3..b0c011a213 100644 --- a/content/learn/migration-guides/0.10-0.11/_index.md +++ b/content/learn/migration-guides/0.10-0.11/_index.md @@ -1315,7 +1315,19 @@ The event `TouchPhase::Cancelled` is now called `TouchPhase::Canceled`
UI
-The `UiSystem::Flex` system set has been renamed to `UiSystem::Layout` +- The `UiSystem::Flex` system set has been renamed to `UiSystem::Layout`. +- It is not possible to use the struct literal update syntax in const time with `Style` anymore, since one of its field implements `Drop`, doing so would raise a "the destructor for this type cannot be evaluated in constants" error. Implement all the fields or don't use `Style` in a `const` variable. See [this issue](https://github.com/bevyengine/bevy/issues/9095). + +```rust +// 0.10 +pub const ABSOLUTE_STYLE: Style = Style { + position_type: PositionType::Absolute, + ..Style::DEFAULT +}; + +// 0.11 +// Implement all the fields or don't use const +``` ### [`MeasureFunc` improvements](https://github.com/bevyengine/bevy/pull/8402) @@ -1327,6 +1339,33 @@ The `UiSystem::Flex` system set has been renamed to `UiSystem::Layout` - The `upsert_leaf` function has been removed from `UiSurface` and replaced with `update_measure` which updates the `MeasureFunc` without node insertion. - The `dyn_clone` method has been removed from the `Measure` trait. - The new function of `CalculatedSize` has been replaced with the method `set`. +- `ImageBundle` and `TextBundle` don't implement `Clone` anymore. [You can either](https://github.com/bevyengine/bevy-website/issues/699): + - Wrap yourself the bundle type and implement `Clone` by skipping cloning the `ContentSize` field. + - Use a closure instead of `clone`: + + ```rust + // 0.10 + let circle = ImageBundle { + style: image_style, + image: materials.circle.clone(), + ..Default::default() + }; + commands.spawn(circle.clone()); + commands.spawn(circle.clone()); + commands.spawn(circle.clone()); + commands.spawn(circle.clone()); + + // 0.11 + let circle = || ImageBundle { + style: image_style, + image: materials.circle.clone(), + ..Default::default() + }; + commands.spawn(circle()); + commands.spawn(circle()); + commands.spawn(circle()); + commands.spawn(circle()); + ``` ### [Divide by `UiScale` when converting UI coordinates from physical to logical](https://github.com/bevyengine/bevy/pull/8720) From 401e4d1204ab96e01e773fd31410c104cbfdc215 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9l=C3=A8ne=20Amanita?= Date: Mon, 10 Jul 2023 13:28:27 +0100 Subject: [PATCH 2/5] CI? --- content/learn/migration-guides/0.10-0.11/_index.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/content/learn/migration-guides/0.10-0.11/_index.md b/content/learn/migration-guides/0.10-0.11/_index.md index b0c011a213..dc9110db40 100644 --- a/content/learn/migration-guides/0.10-0.11/_index.md +++ b/content/learn/migration-guides/0.10-0.11/_index.md @@ -1340,8 +1340,9 @@ pub const ABSOLUTE_STYLE: Style = Style { - The `dyn_clone` method has been removed from the `Measure` trait. - The new function of `CalculatedSize` has been replaced with the method `set`. - `ImageBundle` and `TextBundle` don't implement `Clone` anymore. [You can either](https://github.com/bevyengine/bevy-website/issues/699): - - Wrap yourself the bundle type and implement `Clone` by skipping cloning the `ContentSize` field. - - Use a closure instead of `clone`: + + 1. Wrap yourself the bundle type and implement `Clone` by skipping cloning the `ContentSize` field. + 2. Use a closure instead of `clone`: ```rust // 0.10 From b2858ff06eca7662f8d151f1296e87be0a9d91d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9l=C3=A8ne=20Amanita?= Date: Mon, 10 Jul 2023 17:01:50 +0100 Subject: [PATCH 3/5] Missing information about removing #[bundle] --- .../learn/migration-guides/0.10-0.11/_index.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/content/learn/migration-guides/0.10-0.11/_index.md b/content/learn/migration-guides/0.10-0.11/_index.md index dc9110db40..ff80c29f2e 100644 --- a/content/learn/migration-guides/0.10-0.11/_index.md +++ b/content/learn/migration-guides/0.10-0.11/_index.md @@ -781,6 +781,24 @@ Replace `OnUpdate` with `run_if(in_state(xxx))`. `QueryEntityError::QueryDoesNotMatch`'s display message changed from "The given entity does not have the requested component." to "The given entity's components do not match the query.". + +### [Update syn, encase, glam and hexasphere](https://github.com/bevyengine/bevy/pull/8573) + +
+
ECS
+
+ +Using `#[bundle]` attribute when deriving `Bundle` for nested bundles now throws an error. It was already not required since version 0.9, see [the migration guide](https://bevyengine.org/learn/migration-guides/0.8-0.9/#implement-bundle-for-component-use-bundle-tuples-for-insertion). + +```rust +#[derive(Bundle)] +struct PlayerBundle { + #[bundle] // Remove this line + sprite_bundle: SpriteBundle, + collider: Collider, +} +``` + ### [Rename keys like `LAlt` to `AltLeft`](https://github.com/bevyengine/bevy/pull/8792)
From 81694d1d262bce8753bde4a400c4b1e6f78fd5ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9l=C3=A8ne=20Amanita?= Date: Mon, 10 Jul 2023 17:05:25 +0100 Subject: [PATCH 4/5] CI --- content/learn/migration-guides/0.10-0.11/_index.md | 1 - 1 file changed, 1 deletion(-) diff --git a/content/learn/migration-guides/0.10-0.11/_index.md b/content/learn/migration-guides/0.10-0.11/_index.md index ff80c29f2e..7074ae74e5 100644 --- a/content/learn/migration-guides/0.10-0.11/_index.md +++ b/content/learn/migration-guides/0.10-0.11/_index.md @@ -781,7 +781,6 @@ Replace `OnUpdate` with `run_if(in_state(xxx))`. `QueryEntityError::QueryDoesNotMatch`'s display message changed from "The given entity does not have the requested component." to "The given entity's components do not match the query.". - ### [Update syn, encase, glam and hexasphere](https://github.com/bevyengine/bevy/pull/8573)
From 7b51bbf161bd102e00ee70e5619d72fd1d273e0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9l=C3=A8ne=20Amanita?= Date: Mon, 10 Jul 2023 17:09:07 +0100 Subject: [PATCH 5/5] Fix typo in 0.11 news --- content/news/2023-07-09-bevy-0.11/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/news/2023-07-09-bevy-0.11/index.md b/content/news/2023-07-09-bevy-0.11/index.md index f70d2f3fa0..178b111481 100644 --- a/content/news/2023-07-09-bevy-0.11/index.md +++ b/content/news/2023-07-09-bevy-0.11/index.md @@ -540,7 +540,7 @@ At first glance, this might not seem very useful. But in combination with per-tu ```rust app.add_systems(Update, ( - (attack, defend).in_set(Combat).before(check_health) + (attack, defend).in_set(Combat).before(check_health), check_health, (handle_death, respawn).after(check_health) )) @@ -551,7 +551,7 @@ app.add_systems(Update, ( ```rust app.add_systems(Update, ( - (attack, defend).in_set(Combat) + (attack, defend).in_set(Combat), check_health, (handle_death, respawn) ).chain()