Skip to content

Commit 05436de

Browse files
authored
Merge pull request #7 from rparrett/move-serialization-thing
2 parents c19322b + 0c89f63 commit 05436de

File tree

1 file changed

+0
-38
lines changed
  • content/learn/book/migration-guides/0.8-0.9

1 file changed

+0
-38
lines changed

content/learn/book/migration-guides/0.8-0.9/_index.md

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -772,44 +772,6 @@ Note: You can still derive `Clone`, but it’s not required in order to compile.
772772
* relax `T: ?Sized` bound in `Mut<T>`
773773
* replace all instances of `ReflectMut` with `Mut<dyn Reflect>`
774774

775-
### [Update enum derives](https://github.com/bevyengine/bevy/pull/5473)
776-
777-
Bevy-defined enums have been updated to implement `Enum` and are not considered value types (`ReflectRef::Value`) anymore. This means that their serialized representations will need to be updated. For example, given the Bevy enum:
778-
779-
```rust
780-
pub enum ScalingMode {
781-
None,
782-
WindowSize,
783-
Auto { min_width: f32, min_height: f32 },
784-
FixedVertical(f32),
785-
FixedHorizontal(f32),
786-
}
787-
```
788-
789-
You will need to update the serialized versions accordingly.
790-
791-
```js
792-
// OLD FORMAT
793-
{
794-
"type": "bevy_render::camera::projection::ScalingMode",
795-
"value": FixedHorizontal(720),
796-
},
797-
798-
// NEW FORMAT
799-
{
800-
"type": "bevy_render::camera::projection::ScalingMode",
801-
"enum": {
802-
"variant": "FixedHorizontal",
803-
"tuple": [
804-
{
805-
"type": "f32",
806-
"value": 720,
807-
},
808-
],
809-
},
810-
},
811-
```
812-
813775
### [remove blanket `Serialize + Deserialize` requirement for `Reflect` on generic types](https://github.com/bevyengine/bevy/pull/5197)
814776

815777
`.register_type` for generic types like `Option<T>`, `Vec<T>`, `HashMap<K, V>` will no longer insert `ReflectSerialize` and `ReflectDeserialize` type data. Instead you need to register it separately for concrete generic types like so:

0 commit comments

Comments
 (0)