Skip to content

Commit

Permalink
refactor!: use explicit imports internally to speed up compile times …
Browse files Browse the repository at this point in the history
…and exclude hidden Data traits from prelude
  • Loading branch information
matthunz committed Dec 3, 2024
1 parent b159478 commit 07bfd96
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 12 deletions.
2 changes: 2 additions & 0 deletions macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ pub fn derive_data(input: TokenStream) -> TokenStream {
#[doc(hidden)]
#[allow(non_snake_case)]
fn #check_ident <#generic_params> (t: #ident <#generic_ty_params>) {
use #actuate::data::{FieldWrap, DataField, FnField, StaticField};

(&&FieldWrap(t.#field_ident)).check()
}
}
Expand Down
6 changes: 5 additions & 1 deletion src/animation.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
use crate::prelude::*;
use crate::{
data::Data,
ecs::{use_world, use_world_once},
use_local_task, use_mut, use_ref, ScopeState, Signal, SignalMut,
};
use bevy_ecs::prelude::*;
use bevy_math::VectorSpace;
use bevy_time::Time;
Expand Down
2 changes: 1 addition & 1 deletion src/compose/catch.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::CatchContext;
use crate::prelude::*;
use crate::{compose::Compose, data::Data, use_provider, Scope, Signal};
use core::{error::Error as StdError, mem};

/// Create a composable that catches errors from its children.
Expand Down
2 changes: 1 addition & 1 deletion src/compose/dyn_compose.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::AnyCompose;
use crate::{prelude::*, ScopeData};
use crate::{compose::Compose, use_ref, Scope, ScopeData};
use core::{any::TypeId, cell::UnsafeCell, mem};

/// Create a new dynamically-typed composable.
Expand Down
2 changes: 1 addition & 1 deletion src/compose/from_iter.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::AnyCompose;
use crate::{prelude::*, ScopeData};
use crate::{compose::Compose, data::Data, use_ref, Scope, ScopeData, Signal};
use core::{cell::RefCell, mem};

/// Composable from an iterator, created with [`from_iter`].
Expand Down
2 changes: 1 addition & 1 deletion src/compose/memo.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::prelude::*;
use crate::{compose::Compose, data::Data, use_ref, Scope, Signal};
use alloc::borrow::Cow;
use core::cell::RefCell;

Expand Down
2 changes: 1 addition & 1 deletion src/compose/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{prelude::*, ScopeData};
use crate::{data::Data, use_context, use_ref, Scope, ScopeData, ScopeState};
use alloc::borrow::Cow;
use core::{
any::TypeId,
Expand Down
6 changes: 4 additions & 2 deletions src/composer.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use crate::{prelude::*, ScopeData};
use crate::{
compose::{AnyCompose, CatchContext, Compose},
ScopeData,
};
use alloc::{rc::Rc, sync::Arc, task::Wake};
use compose::{AnyCompose, CatchContext};
use core::{
any::TypeId,
cell::{Cell, RefCell},
Expand Down
2 changes: 1 addition & 1 deletion src/data.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{prelude::*, HashMap};
use crate::{compose::DynCompose, HashMap};
use core::{error::Error, future::Future, pin::Pin};

pub use actuate_macros::{data, Data};
Expand Down
4 changes: 2 additions & 2 deletions src/ecs.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{
composer::Composer,
prelude::{Signal, *},
compose::Compose, composer::Composer, data::Data, use_callback, use_context, use_drop,
use_provider, use_ref, Scope, ScopeState, Signal,
};
use bevy_app::{App, Plugin};
use bevy_ecs::{
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ use std::collections::HashMap;
pub mod prelude {
pub use crate::{
compose::{self, catch, dyn_compose, memo, Compose, DynCompose, Error, Memo},
data::{data, Data, DataField, FieldWrap, FnField, StaticField},
data::{data, Data},
use_callback, use_context, use_drop, use_local_task, use_memo, use_mut, use_provider,
use_ref, Cow, Map, RefMap, Scope, ScopeState, Signal, SignalMut,
};
Expand Down

0 comments on commit 07bfd96

Please sign in to comment.