Re-export ron in bevy_scene (#10529)

# 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 <alice.i.cecile@gmail.com>
This commit is contained in:
Joseph 2023-11-15 06:45:54 -08:00 committed by GitHub
parent d0c9e2197a
commit dcfae72386
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 11 additions and 3 deletions

View File

@ -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},

View File

@ -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"

View File

@ -1,4 +1,4 @@
use crate::{DynamicSceneBuilder, Scene, SceneSpawnError};
use crate::{ron, DynamicSceneBuilder, Scene, SceneSpawnError};
use bevy_ecs::{
entity::Entity,
reflect::{AppTypeRegistry, ReflectComponent, ReflectMapEntities},

View File

@ -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::*;

View File

@ -1,3 +1,4 @@
use crate::ron;
#[cfg(feature = "serialize")]
use crate::serde::SceneDeserializer;
use crate::DynamicScene;

View File

@ -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};

View File

@ -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,

View File

@ -5,6 +5,7 @@ use bevy::{
embedded_asset,
io::{Reader, Writer},
processor::LoadAndSave,
ron,
saver::{AssetSaver, SavedAsset},
AssetLoader, AsyncReadExt, AsyncWriteExt, LoadContext,
},