From 4e5e4a66643bf60aa7daa61dfa3c36148778ccbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=81abor?= Date: Mon, 12 Sep 2022 23:31:05 +0200 Subject: [PATCH 1/3] Initial --- Cargo.toml | 1 + examples/text.js | 10 ++ examples/text.rs | 7 +- src/runtimes/bevy/ext/bevy_ecs/03_ecs.js | 2 +- src/runtimes/bevy/ext/bevy_ecs/04_reflect.js | 20 +++ src/runtimes/bevy/ext/bevy_ecs/mod.rs | 29 +++- src/runtimes/bevy/ext/bevy_ecs/reflect.rs | 46 ++++++ src/runtimes/bevy/ext/bevy_ecs/serde/de.rs | 155 +++++++++++++++++++ src/runtimes/bevy/ext/bevy_ecs/serde/mod.rs | 1 + 9 files changed, 268 insertions(+), 3 deletions(-) create mode 100644 src/runtimes/bevy/ext/bevy_ecs/reflect.rs create mode 100644 src/runtimes/bevy/ext/bevy_ecs/serde/de.rs create mode 100644 src/runtimes/bevy/ext/bevy_ecs/serde/mod.rs diff --git a/Cargo.toml b/Cargo.toml index 090d3e7..e725e08 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -55,6 +55,7 @@ path = "examples/startup_system.rs" [[example]] name = "text" path = "examples/text.rs" +required-features = ["inspector"] [[example]] name = "inspector" diff --git a/examples/text.js b/examples/text.js index d6be556..3328c79 100644 --- a/examples/text.js +++ b/examples/text.js @@ -4,6 +4,7 @@ // in the bottom right. For text within a scene, please see the text2d example. const { Entity, World } = bevyEcs; +const { ReflectableObject } = bevyEcs.reflect; const { Visibility, ComputedVisibility } = bevyRender.view.visibility; const { FocusPolicy } = bevyUi.focus; const { Node, CalculatedSize, Style, AlignSelf, PositionType, Val } = @@ -23,6 +24,15 @@ const { const { Color } = bevyRender.color; const { Vec } = alloc.vec; +class ColorText extends ReflectableObject { + constructor() { + super({}); + } + typeName() { + return "bevy_js::text::ColorText"; + } +} + (async () => { await bevyEcs.waitForWorld(); setup(); diff --git a/examples/text.rs b/examples/text.rs index 95b51e8..400e60d 100644 --- a/examples/text.rs +++ b/examples/text.rs @@ -13,7 +13,12 @@ fn main() { .run(); } -fn setup_runtime(mut runtime: NonSendMut>) { +fn setup_runtime( + mut runtime: NonSendMut>, + inspector: Res, +) { + runtime.register_inspector(inspector.meta()); + let specifier = bjs::resolve::path("./examples/text.js").unwrap(); let _ = runtime.execute_module(specifier.clone(), None); } diff --git a/src/runtimes/bevy/ext/bevy_ecs/03_ecs.js b/src/runtimes/bevy/ext/bevy_ecs/03_ecs.js index f077132..94cad22 100644 --- a/src/runtimes/bevy/ext/bevy_ecs/03_ecs.js +++ b/src/runtimes/bevy/ext/bevy_ecs/03_ecs.js @@ -33,7 +33,7 @@ try { return reflectable.reflect(); } catch (err) { - throw new Error(`Object must implement method "reflect" in order to be reflected: + throw new Error(`Object must implement method "reflect" in order to be registered: ${err}`); } } diff --git a/src/runtimes/bevy/ext/bevy_ecs/04_reflect.js b/src/runtimes/bevy/ext/bevy_ecs/04_reflect.js index 87df39d..ab53ce5 100644 --- a/src/runtimes/bevy/ext/bevy_ecs/04_reflect.js +++ b/src/runtimes/bevy/ext/bevy_ecs/04_reflect.js @@ -1,6 +1,9 @@ "use strict"; ((window) => { + const { core } = window.Deno; + const { worldResourceId, reflect } = window.bevyEcs; + class Reflectable { constructor() {} @@ -75,11 +78,28 @@ } } + class TypeRegistry { + static register(reflectable) { + const reflected = reflect(reflectable); + + try { + core.ops.op_type_registry_register(worldResourceId(), reflected); + } catch (err) { + throw new Error( + `Could not register type: +${JSON.stringify(reflected)} +${err}` + ); + } + } + } + Object.assign(window.bevyEcs, { Reflectable, ReflectableObject, ReflectableArray, ReflectableEnum, ReflectableUnit, + TypeRegistry, }); })(globalThis); diff --git a/src/runtimes/bevy/ext/bevy_ecs/mod.rs b/src/runtimes/bevy/ext/bevy_ecs/mod.rs index 716a9cb..9659d5b 100644 --- a/src/runtimes/bevy/ext/bevy_ecs/mod.rs +++ b/src/runtimes/bevy/ext/bevy_ecs/mod.rs @@ -1,7 +1,17 @@ use crate as bjs; -use bjs::{include_js_files, op, Extension, OpState}; +use bevy::{ + prelude::*, + reflect::{serde::UntypedReflectDeserializer, TypeRegistryInternal}, +}; +use dc::{ + anyhow::Error as AnyError, include_js_files, op, serde::de::DeserializeSeed, serde_v8, + Extension, OpState, +}; +use deno_core as dc; mod entity; +mod reflect; +pub mod serde; pub fn init() -> Extension { Extension::builder() @@ -20,6 +30,23 @@ pub fn init() -> Extension { .build() } +pub(crate) fn deserialize_reflect<'scope>( + scope: &mut deno_core::v8::HandleScope<'scope>, + type_registry: &TypeRegistryInternal, + value: serde_v8::Value, +) -> Result, AnyError> { + let reflect_deserializer = UntypedReflectDeserializer::new(&type_registry); + + let mut value_deserializer = serde_v8::Deserializer::new(scope, value.v8_value, None); + + let mut track = serde_path_to_error::Track::new(); + let tracked = serde_path_to_error::Deserializer::new(&mut value_deserializer, &mut track); + + reflect_deserializer + .deserialize(tracked) + .map_err(|err| AnyError::msg(format!("{}, occured at: {}", err, track.path()))) +} + #[op] async fn op_wait_for_world(state: &mut OpState, rid: bjs::ResourceId) { bjs::runtimes::unwrap_world_resource(state, rid) diff --git a/src/runtimes/bevy/ext/bevy_ecs/reflect.rs b/src/runtimes/bevy/ext/bevy_ecs/reflect.rs new file mode 100644 index 0000000..019d9d1 --- /dev/null +++ b/src/runtimes/bevy/ext/bevy_ecs/reflect.rs @@ -0,0 +1,46 @@ +use crate::{self as bjs}; +use bevy::{ + prelude::*, + reflect::{DynamicInfo, GetTypeRegistration, TypeInfo, TypeRegistration}, + utils::hashbrown::HashMap, +}; +use dc::{anyhow::Error as AnyError, op, serde::de::DeserializeSeed, serde_v8, OpState}; +use deno_core as dc; + +use super::serde::de::DynamicReflectDeserializer; + +#[op(v8)] +pub fn op_type_registry_register<'scope>( + scope: &mut deno_core::v8::HandleScope<'scope>, + state: &mut OpState, + r_world: bjs::ResourceId, + reflectable: serde_v8::Value, +) -> Result<(), AnyError> { + let res = bjs::runtimes::unwrap_world_resource(state, r_world); + let world = res.borrow_world_mut(); + + // Deserialize reflectable value into a dynamic type + + let mut value_deserializer = serde_v8::Deserializer::new(scope, reflectable.v8_value, None); + + let mut track = serde_path_to_error::Track::new(); + let tracked = serde_path_to_error::Deserializer::new(&mut value_deserializer, &mut track); + + let reflected = DynamicReflectDeserializer + .deserialize(tracked) + .map_err(|err| AnyError::msg(format!("{}, occured at: {}", err, track.path())))?; + + // let reflect = reflected.as_ref(); + // let registration = + + // Register dynamic type with the type registry + + // let type_registry = world.resource::().clone(); + // let mut type_registry = type_registry.write(); + + // type_registry.add_registration(registration); + + dbg!(reflected); + + Ok(()) +} diff --git a/src/runtimes/bevy/ext/bevy_ecs/serde/de.rs b/src/runtimes/bevy/ext/bevy_ecs/serde/de.rs new file mode 100644 index 0000000..3b84856 --- /dev/null +++ b/src/runtimes/bevy/ext/bevy_ecs/serde/de.rs @@ -0,0 +1,155 @@ +use bevy::reflect::{DynamicList, DynamicStruct, Reflect}; +use deno_core::serde::{ + self, + de::{DeserializeSeed, Error, MapAccess, SeqAccess, Visitor}, +}; +use std::fmt; + +macro_rules! deserialize_reflect { + ( $dmethod:ident, $t:tt ) => { + fn $dmethod(self, v: $t) -> Result + where + E: Error, + { + Ok(Box::new(v)) + } + }; +} + +pub struct DynamicReflectDeserializer; + +impl<'de> DeserializeSeed<'de> for DynamicReflectDeserializer { + type Value = Box; + + fn deserialize(self, deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + deserializer.deserialize_any(DynamicReflectDeserializerVisitor) + } +} + +struct DynamicReflectDeserializerVisitor; + +impl<'de> Visitor<'de> for DynamicReflectDeserializerVisitor { + type Value = Box; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("map containing a `type` entry containing `value` or a value type") + } + + deserialize_reflect!(visit_bool, bool); + + deserialize_reflect!(visit_i8, i8); + deserialize_reflect!(visit_i16, i16); + deserialize_reflect!(visit_i32, i32); + deserialize_reflect!(visit_i64, i64); + + deserialize_reflect!(visit_u8, u8); + deserialize_reflect!(visit_u16, u16); + deserialize_reflect!(visit_u32, u32); + deserialize_reflect!(visit_u64, u64); + + deserialize_reflect!(visit_f32, f32); + deserialize_reflect!(visit_f64, f64); + + deserialize_reflect!(visit_string, String); + + fn visit_str(self, v: &str) -> Result + where + E: Error, + { + Ok(Box::new(v.to_string())) + } + + fn visit_map(self, mut map: A) -> Result + where + A: MapAccess<'de>, + { + let type_name = map + .next_key::()? + .ok_or_else(|| Error::invalid_length(0, &"at least one entry"))?; + + map.next_value_seed(TypedDynamicReflectDeserializer { type_name }) + } +} + +pub struct TypedDynamicReflectDeserializer { + type_name: String, +} + +impl<'a, 'de> DeserializeSeed<'de> for TypedDynamicReflectDeserializer { + type Value = Box; + + fn deserialize(self, deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + deserializer.deserialize_any(TypedDynamicReflectDeserializerVisitor { + type_name: self.type_name, + }) + } +} + +struct TypedDynamicReflectDeserializerVisitor { + type_name: String, +} + +impl<'de> Visitor<'de> for TypedDynamicReflectDeserializerVisitor { + type Value = Box; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter + .write_str("object that can be represented as dynamic type or reflected as a value") + } + + deserialize_reflect!(visit_bool, bool); + + deserialize_reflect!(visit_i8, i8); + deserialize_reflect!(visit_i16, i16); + deserialize_reflect!(visit_i32, i32); + deserialize_reflect!(visit_i64, i64); + + deserialize_reflect!(visit_u8, u8); + deserialize_reflect!(visit_u16, u16); + deserialize_reflect!(visit_u32, u32); + deserialize_reflect!(visit_u64, u64); + + deserialize_reflect!(visit_f32, f32); + deserialize_reflect!(visit_f64, f64); + + deserialize_reflect!(visit_string, String); + + fn visit_str(self, v: &str) -> Result + where + E: Error, + { + Ok(Box::new(v.to_string())) + } + + fn visit_seq(self, mut seq: A) -> Result + where + A: SeqAccess<'de>, + { + let mut list = DynamicList::default(); + list.set_name(self.type_name); + while let Some(value) = seq.next_element_seed(DynamicReflectDeserializer)? { + list.push_box(value); + } + Ok(Box::new(list)) + } + + fn visit_map(self, mut map: A) -> Result + where + A: MapAccess<'de>, + { + let mut dynamic_struct = DynamicStruct::default(); + dynamic_struct.set_name(self.type_name); + while let Some(key) = map.next_key::()? { + let value = map.next_value_seed(DynamicReflectDeserializer)?; + dynamic_struct.insert_boxed(&key, value); + } + + Ok(Box::new(dynamic_struct)) + } +} diff --git a/src/runtimes/bevy/ext/bevy_ecs/serde/mod.rs b/src/runtimes/bevy/ext/bevy_ecs/serde/mod.rs new file mode 100644 index 0000000..7bbc60f --- /dev/null +++ b/src/runtimes/bevy/ext/bevy_ecs/serde/mod.rs @@ -0,0 +1 @@ +pub mod de; From c3e50a5cf5c3406143f18c82b317fd2c4f009c7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=81abor?= Date: Tue, 13 Sep 2022 00:04:16 +0200 Subject: [PATCH 2/3] Stuck --- Cargo.toml | 1 - examples/text.js | 13 +++++---- examples/text.rs | 7 +---- src/runtimes/bevy/ext/bevy_ecs/mod.rs | 27 ++----------------- src/runtimes/bevy/ext/bevy_ecs/reflect.rs | 13 +++------ src/runtimes/bevy/ext/bevy_ecs/serde/de.rs | 2 ++ .../bevy/ext/glam/f_32/06_affine_3_a.js | 1 + .../bevy/ext/glam/f_32/sse_2/05_mat_3_a.js | 1 + 8 files changed, 18 insertions(+), 47 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e725e08..090d3e7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -55,7 +55,6 @@ path = "examples/startup_system.rs" [[example]] name = "text" path = "examples/text.rs" -required-features = ["inspector"] [[example]] name = "inspector" diff --git a/examples/text.js b/examples/text.js index 3328c79..44c0d9b 100644 --- a/examples/text.js +++ b/examples/text.js @@ -3,8 +3,7 @@ // It displays the current FPS in the top left corner, as well as text that changes color // in the bottom right. For text within a scene, please see the text2d example. -const { Entity, World } = bevyEcs; -const { ReflectableObject } = bevyEcs.reflect; +const { Entity, World, TypeRegistry, ReflectableObject } = bevyEcs; const { Visibility, ComputedVisibility } = bevyRender.view.visibility; const { FocusPolicy } = bevyUi.focus; const { Node, CalculatedSize, Style, AlignSelf, PositionType, Val } = @@ -35,13 +34,16 @@ class ColorText extends ReflectableObject { (async () => { await bevyEcs.waitForWorld(); + + TypeRegistry.register(new ColorText()); + setup(); })(); function setup() { - const handle = bevyAsset.AssetServer.load("fonts/FiraSans-Bold.ttf"); + let handle = bevyAsset.AssetServer.load("fonts/FiraSans-Bold.ttf"); - const entity = World.spawn(); + let entity = World.spawn(); entity .insert(new Node()) .insert( @@ -87,5 +89,6 @@ function setup() { is_visible_in_hierarchy: false, is_visible_in_view: false, }) - ); + ) + .insert(new ColorText()); } diff --git a/examples/text.rs b/examples/text.rs index 400e60d..95b51e8 100644 --- a/examples/text.rs +++ b/examples/text.rs @@ -13,12 +13,7 @@ fn main() { .run(); } -fn setup_runtime( - mut runtime: NonSendMut>, - inspector: Res, -) { - runtime.register_inspector(inspector.meta()); - +fn setup_runtime(mut runtime: NonSendMut>) { let specifier = bjs::resolve::path("./examples/text.js").unwrap(); let _ = runtime.execute_module(specifier.clone(), None); } diff --git a/src/runtimes/bevy/ext/bevy_ecs/mod.rs b/src/runtimes/bevy/ext/bevy_ecs/mod.rs index 9659d5b..ccc5266 100644 --- a/src/runtimes/bevy/ext/bevy_ecs/mod.rs +++ b/src/runtimes/bevy/ext/bevy_ecs/mod.rs @@ -1,12 +1,5 @@ use crate as bjs; -use bevy::{ - prelude::*, - reflect::{serde::UntypedReflectDeserializer, TypeRegistryInternal}, -}; -use dc::{ - anyhow::Error as AnyError, include_js_files, op, serde::de::DeserializeSeed, serde_v8, - Extension, OpState, -}; +use dc::{include_js_files, op, Extension, OpState}; use deno_core as dc; mod entity; @@ -24,29 +17,13 @@ pub fn init() -> Extension { )) .ops(vec![ op_wait_for_world::decl(), + reflect::op_type_registry_register::decl(), entity::op_entity_spawn::decl(), entity::op_entity_insert_component::decl(), ]) .build() } -pub(crate) fn deserialize_reflect<'scope>( - scope: &mut deno_core::v8::HandleScope<'scope>, - type_registry: &TypeRegistryInternal, - value: serde_v8::Value, -) -> Result, AnyError> { - let reflect_deserializer = UntypedReflectDeserializer::new(&type_registry); - - let mut value_deserializer = serde_v8::Deserializer::new(scope, value.v8_value, None); - - let mut track = serde_path_to_error::Track::new(); - let tracked = serde_path_to_error::Deserializer::new(&mut value_deserializer, &mut track); - - reflect_deserializer - .deserialize(tracked) - .map_err(|err| AnyError::msg(format!("{}, occured at: {}", err, track.path()))) -} - #[op] async fn op_wait_for_world(state: &mut OpState, rid: bjs::ResourceId) { bjs::runtimes::unwrap_world_resource(state, rid) diff --git a/src/runtimes/bevy/ext/bevy_ecs/reflect.rs b/src/runtimes/bevy/ext/bevy_ecs/reflect.rs index 019d9d1..ac51ff0 100644 --- a/src/runtimes/bevy/ext/bevy_ecs/reflect.rs +++ b/src/runtimes/bevy/ext/bevy_ecs/reflect.rs @@ -30,17 +30,10 @@ pub fn op_type_registry_register<'scope>( .deserialize(tracked) .map_err(|err| AnyError::msg(format!("{}, occured at: {}", err, track.path())))?; - // let reflect = reflected.as_ref(); - // let registration = + dbg!(&reflected); + dbg!(reflected.get_type_info()); - // Register dynamic type with the type registry - - // let type_registry = world.resource::().clone(); - // let mut type_registry = type_registry.write(); - - // type_registry.add_registration(registration); - - dbg!(reflected); + // TODO: How to get [TypeRegistration] from [dyn Reflect]? Ok(()) } diff --git a/src/runtimes/bevy/ext/bevy_ecs/serde/de.rs b/src/runtimes/bevy/ext/bevy_ecs/serde/de.rs index 3b84856..09298af 100644 --- a/src/runtimes/bevy/ext/bevy_ecs/serde/de.rs +++ b/src/runtimes/bevy/ext/bevy_ecs/serde/de.rs @@ -133,6 +133,7 @@ impl<'de> Visitor<'de> for TypedDynamicReflectDeserializerVisitor { { let mut list = DynamicList::default(); list.set_name(self.type_name); + while let Some(value) = seq.next_element_seed(DynamicReflectDeserializer)? { list.push_box(value); } @@ -145,6 +146,7 @@ impl<'de> Visitor<'de> for TypedDynamicReflectDeserializerVisitor { { let mut dynamic_struct = DynamicStruct::default(); dynamic_struct.set_name(self.type_name); + while let Some(key) = map.next_key::()? { let value = map.next_value_seed(DynamicReflectDeserializer)?; dynamic_struct.insert_boxed(&key, value); diff --git a/src/runtimes/bevy/ext/glam/f_32/06_affine_3_a.js b/src/runtimes/bevy/ext/glam/f_32/06_affine_3_a.js index fd406de..d3c33e2 100644 --- a/src/runtimes/bevy/ext/glam/f_32/06_affine_3_a.js +++ b/src/runtimes/bevy/ext/glam/f_32/06_affine_3_a.js @@ -3,6 +3,7 @@ const { ReflectableArray } = window.bevyEcs; const { Mat3A } = window.glam.f32.sse2.mat3A; const { Vec3A } = window.glam.f32.sse2.vec3A; + class Affine3A extends ReflectableArray { static Zero = () => new Affine3A({ diff --git a/src/runtimes/bevy/ext/glam/f_32/sse_2/05_mat_3_a.js b/src/runtimes/bevy/ext/glam/f_32/sse_2/05_mat_3_a.js index f44b713..4b98788 100644 --- a/src/runtimes/bevy/ext/glam/f_32/sse_2/05_mat_3_a.js +++ b/src/runtimes/bevy/ext/glam/f_32/sse_2/05_mat_3_a.js @@ -2,6 +2,7 @@ ((window) => { const { ReflectableArray } = window.bevyEcs; const { Vec3A } = window.glam.f32.sse2.vec3A; + class Mat3A extends ReflectableArray { static Zero = () => new Mat3A({ From d0f79e77b33d98d72bbe0d08d2ee62096cf0b2d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=81abor?= Date: Tue, 13 Sep 2022 00:43:48 +0200 Subject: [PATCH 3/3] Cleanup --- examples/text.js | 6 ++---- src/runtimes/bevy/ext/bevy_ecs/mod.rs | 3 +-- src/runtimes/bevy/ext/bevy_ecs/reflect.rs | 7 +------ src/runtimes/bevy/ext/bevy_ecs/serde/de.rs | 2 +- src/runtimes/bevy/ext/glam/f_32/06_affine_3_a.js | 1 - src/runtimes/bevy/ext/glam/f_32/sse_2/05_mat_3_a.js | 1 - 6 files changed, 5 insertions(+), 15 deletions(-) diff --git a/examples/text.js b/examples/text.js index 44c0d9b..62d7e2d 100644 --- a/examples/text.js +++ b/examples/text.js @@ -34,16 +34,14 @@ class ColorText extends ReflectableObject { (async () => { await bevyEcs.waitForWorld(); - TypeRegistry.register(new ColorText()); - setup(); })(); function setup() { - let handle = bevyAsset.AssetServer.load("fonts/FiraSans-Bold.ttf"); + const handle = bevyAsset.AssetServer.load("fonts/FiraSans-Bold.ttf"); - let entity = World.spawn(); + const entity = World.spawn(); entity .insert(new Node()) .insert( diff --git a/src/runtimes/bevy/ext/bevy_ecs/mod.rs b/src/runtimes/bevy/ext/bevy_ecs/mod.rs index ccc5266..f330929 100644 --- a/src/runtimes/bevy/ext/bevy_ecs/mod.rs +++ b/src/runtimes/bevy/ext/bevy_ecs/mod.rs @@ -1,6 +1,5 @@ use crate as bjs; -use dc::{include_js_files, op, Extension, OpState}; -use deno_core as dc; +use bjs::{include_js_files, op, Extension, OpState}; mod entity; mod reflect; diff --git a/src/runtimes/bevy/ext/bevy_ecs/reflect.rs b/src/runtimes/bevy/ext/bevy_ecs/reflect.rs index ac51ff0..c4294c6 100644 --- a/src/runtimes/bevy/ext/bevy_ecs/reflect.rs +++ b/src/runtimes/bevy/ext/bevy_ecs/reflect.rs @@ -1,9 +1,4 @@ use crate::{self as bjs}; -use bevy::{ - prelude::*, - reflect::{DynamicInfo, GetTypeRegistration, TypeInfo, TypeRegistration}, - utils::hashbrown::HashMap, -}; use dc::{anyhow::Error as AnyError, op, serde::de::DeserializeSeed, serde_v8, OpState}; use deno_core as dc; @@ -17,7 +12,7 @@ pub fn op_type_registry_register<'scope>( reflectable: serde_v8::Value, ) -> Result<(), AnyError> { let res = bjs::runtimes::unwrap_world_resource(state, r_world); - let world = res.borrow_world_mut(); + let _world = res.borrow_world_mut(); // Deserialize reflectable value into a dynamic type diff --git a/src/runtimes/bevy/ext/bevy_ecs/serde/de.rs b/src/runtimes/bevy/ext/bevy_ecs/serde/de.rs index 09298af..d87247b 100644 --- a/src/runtimes/bevy/ext/bevy_ecs/serde/de.rs +++ b/src/runtimes/bevy/ext/bevy_ecs/serde/de.rs @@ -78,7 +78,7 @@ pub struct TypedDynamicReflectDeserializer { type_name: String, } -impl<'a, 'de> DeserializeSeed<'de> for TypedDynamicReflectDeserializer { +impl<'de> DeserializeSeed<'de> for TypedDynamicReflectDeserializer { type Value = Box; fn deserialize(self, deserializer: D) -> Result diff --git a/src/runtimes/bevy/ext/glam/f_32/06_affine_3_a.js b/src/runtimes/bevy/ext/glam/f_32/06_affine_3_a.js index d3c33e2..fd406de 100644 --- a/src/runtimes/bevy/ext/glam/f_32/06_affine_3_a.js +++ b/src/runtimes/bevy/ext/glam/f_32/06_affine_3_a.js @@ -3,7 +3,6 @@ const { ReflectableArray } = window.bevyEcs; const { Mat3A } = window.glam.f32.sse2.mat3A; const { Vec3A } = window.glam.f32.sse2.vec3A; - class Affine3A extends ReflectableArray { static Zero = () => new Affine3A({ diff --git a/src/runtimes/bevy/ext/glam/f_32/sse_2/05_mat_3_a.js b/src/runtimes/bevy/ext/glam/f_32/sse_2/05_mat_3_a.js index 4b98788..f44b713 100644 --- a/src/runtimes/bevy/ext/glam/f_32/sse_2/05_mat_3_a.js +++ b/src/runtimes/bevy/ext/glam/f_32/sse_2/05_mat_3_a.js @@ -2,7 +2,6 @@ ((window) => { const { ReflectableArray } = window.bevyEcs; const { Vec3A } = window.glam.f32.sse2.vec3A; - class Mat3A extends ReflectableArray { static Zero = () => new Mat3A({