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

Improve bevy_reflect no_std support #18060

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions crates/bevy_reflect/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ bevy = ["smallvec", "smol_str"]
debug = ["debug_stack"]

## When enabled, keeps track of the current serialization/deserialization context for better error messages
debug_stack = []
debug_stack = ["std"]

# Integrations

Expand All @@ -46,7 +46,7 @@ smallvec = ["dep:smallvec"]
uuid = ["dep:uuid"]

## Adds reflection support to `wgpu-types` types.
wgpu-types = ["dep:wgpu-types", "std"]
wgpu-types = ["dep:wgpu-types"]

# Platform Compatibility

Expand All @@ -62,6 +62,7 @@ std = [
"smol_str?/std",
"uuid?/std",
"bevy_platform_support/std",
"wgpu-types?/std",
]

## `critical-section` provides the building blocks for synchronization primitives
Expand Down Expand Up @@ -109,7 +110,9 @@ uuid = { version = "1.13.1", default-features = false, optional = true, features
"serde",
] }
variadics_please = "1.1"
wgpu-types = { version = "24", features = ["serde"], optional = true }
wgpu-types = { version = "24", features = [
"serde",
], optional = true, default-features = false }

[target.'cfg(target_arch = "wasm32")'.dependencies]
uuid = { version = "1.13.1", default-features = false, features = ["js"] }
Expand Down
7 changes: 4 additions & 3 deletions crates/bevy_reflect/src/func/registry.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use alloc::borrow::Cow;
use bevy_platform_support::collections::HashMap;
use bevy_platform_support::sync::Arc;
use bevy_platform_support::{
collections::HashMap,
sync::{Arc, PoisonError, RwLock, RwLockReadGuard, RwLockWriteGuard},
};
use core::fmt::Debug;
use std::sync::{PoisonError, RwLock, RwLockReadGuard, RwLockWriteGuard};

use crate::func::{
ArgList, DynamicFunction, FunctionRegistrationError, FunctionResult, IntoFunction,
Expand Down