Skip to content

Commit

Permalink
Re-export ron in bevy_scene (#10529)
Browse files Browse the repository at this point in the history
# Objective

Close #10504. Improve the development experience for working with scenes
by not requiring the user to specify a matching version of `ron` in
their `Cargo.toml`

---------

Co-authored-by: Alice Cecile <[email protected]>
  • Loading branch information
joseph-gio and alice-i-cecile authored Nov 15, 2023
1 parent d0c9e21 commit dcfae72
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions crates/bevy_asset/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ pub use server::*;

pub use bevy_utils::BoxedFuture;

/// Rusty Object Notation, a crate used to serialize and deserialize bevy assets.
pub use ron;

use crate::{
io::{embedded::EmbeddedAssetRegistry, AssetSourceBuilder, AssetSourceBuilders, AssetSourceId},
processor::{AssetProcessor, Process},
Expand Down
1 change: 0 additions & 1 deletion crates/bevy_scene/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ bevy_render = { path = "../bevy_render", version = "0.12.0", optional = true }

# other
serde = { version = "1.0", features = ["derive"], optional = true }
ron = "0.8.0"
uuid = { version = "1.1", features = ["v4"] }
thiserror = "1.0"

Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_scene/src/dynamic_scene.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{DynamicSceneBuilder, Scene, SceneSpawnError};
use crate::{ron, DynamicSceneBuilder, Scene, SceneSpawnError};
use bevy_ecs::{
entity::Entity,
reflect::{AppTypeRegistry, ReflectComponent, ReflectMapEntities},
Expand Down
3 changes: 3 additions & 0 deletions crates/bevy_scene/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ mod scene_spawner;
#[cfg(feature = "serialize")]
pub mod serde;

/// Rusty Object Notation, a crate used to serialize and deserialize bevy scenes.
pub use bevy_asset::ron;

use bevy_ecs::schedule::IntoSystemConfigs;
pub use bundle::*;
pub use dynamic_scene::*;
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_scene/src/scene_loader.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::ron;
#[cfg(feature = "serialize")]
use crate::serde::SceneDeserializer;
use crate::DynamicScene;
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_scene/src/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ impl<'a, 'de> Visitor<'de> for SceneMapVisitor<'a> {

#[cfg(test)]
mod tests {
use crate::ron;
use crate::serde::{SceneDeserializer, SceneSerializer};
use crate::{DynamicScene, DynamicSceneBuilder};
use bevy_ecs::entity::{Entity, EntityMapper, MapEntities};
Expand Down
2 changes: 1 addition & 1 deletion examples/asset/custom_asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use bevy::utils::thiserror;
use bevy::{
asset::{io::Reader, AssetLoader, AsyncReadExt, LoadContext},
asset::{io::Reader, ron, AssetLoader, AsyncReadExt, LoadContext},
prelude::*,
reflect::TypePath,
utils::BoxedFuture,
Expand Down
1 change: 1 addition & 0 deletions examples/asset/processing/asset_processing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use bevy::{
embedded_asset,
io::{Reader, Writer},
processor::LoadAndSave,
ron,
saver::{AssetSaver, SavedAsset},
AssetLoader, AsyncReadExt, AsyncWriteExt, LoadContext,
},
Expand Down

0 comments on commit dcfae72

Please sign in to comment.