From 7f78cd90b71830f169e192c741b93cbb9e41db56 Mon Sep 17 00:00:00 2001 From: Henry Zimmerman Date: Mon, 7 Oct 2019 10:07:55 -0400 Subject: [PATCH 1/3] Add a default-enabled feature gate for agents and services --- Cargo.toml | 4 +++- src/lib.rs | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 49ba6c8bcfa..1a2344046f8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,9 +49,11 @@ rustversion = "0.1" wasm-bindgen-test = "0.2" [features] -default = [] +default = ["services", "agents"] web_test = [] wasm_test = [] +services = [] +agents = [] yaml = ["serde_yaml"] msgpack = ["rmp-serde"] cbor = ["serde_cbor"] diff --git a/src/lib.rs b/src/lib.rs index 5370a862d28..8f72c484f02 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -74,17 +74,20 @@ pub mod macros { pub use yew_macro::Properties; } -pub mod agent; pub mod app; pub mod callback; pub mod components; pub mod format; pub mod html; pub mod scheduler; -pub mod services; pub mod utils; pub mod virtual_dom; +#[cfg(feature="services")] +pub mod services; +#[cfg(feature="agents")] +pub mod agent; + /// The module that contains all events available in the framework. pub mod events { pub use crate::html::{ChangeData, InputData}; @@ -141,6 +144,7 @@ where /// use yew::prelude::*; /// ``` pub mod prelude { + #[cfg(feature="agents")] pub use crate::agent::{Bridge, Bridged, Threaded}; pub use crate::app::App; pub use crate::callback::Callback; @@ -153,6 +157,7 @@ pub mod prelude { pub use crate::virtual_dom::Classes; /// Prelude module for creating worker. + #[cfg(feature="agents")] pub mod worker { pub use crate::agent::{ Agent, AgentLink, Bridge, Bridged, Context, Global, HandlerId, Job, Private, Public, From e5aa602d4b8723b0d696d077255cb747c0512a87 Mon Sep 17 00:00:00 2001 From: Henry Zimmerman Date: Mon, 7 Oct 2019 10:40:08 -0400 Subject: [PATCH 2/3] cargo fmt --- src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 8f72c484f02..eb69fc8a49d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -83,10 +83,10 @@ pub mod scheduler; pub mod utils; pub mod virtual_dom; -#[cfg(feature="services")] -pub mod services; -#[cfg(feature="agents")] +#[cfg(feature = "agents")] pub mod agent; +#[cfg(feature = "services")] +pub mod services; /// The module that contains all events available in the framework. pub mod events { @@ -144,7 +144,7 @@ where /// use yew::prelude::*; /// ``` pub mod prelude { - #[cfg(feature="agents")] + #[cfg(feature = "agents")] pub use crate::agent::{Bridge, Bridged, Threaded}; pub use crate::app::App; pub use crate::callback::Callback; @@ -157,7 +157,7 @@ pub mod prelude { pub use crate::virtual_dom::Classes; /// Prelude module for creating worker. - #[cfg(feature="agents")] + #[cfg(feature = "agents")] pub mod worker { pub use crate::agent::{ Agent, AgentLink, Bridge, Bridged, Context, Global, HandlerId, Job, Private, Public, From 3a897dd691e5039fac260546ecef9732ad8a228d Mon Sep 17 00:00:00 2001 From: Henry Zimmerman Date: Sun, 10 Nov 2019 21:23:22 -0500 Subject: [PATCH 3/3] change feature name for agent support from agents to agent --- Cargo.toml | 4 ++-- src/lib.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1a2344046f8..1c99cac87b3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,11 +49,11 @@ rustversion = "0.1" wasm-bindgen-test = "0.2" [features] -default = ["services", "agents"] +default = ["services", "agent"] web_test = [] wasm_test = [] services = [] -agents = [] +agent = [] yaml = ["serde_yaml"] msgpack = ["rmp-serde"] cbor = ["serde_cbor"] diff --git a/src/lib.rs b/src/lib.rs index eb69fc8a49d..0a626aa31a3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -83,7 +83,7 @@ pub mod scheduler; pub mod utils; pub mod virtual_dom; -#[cfg(feature = "agents")] +#[cfg(feature = "agent")] pub mod agent; #[cfg(feature = "services")] pub mod services; @@ -144,7 +144,7 @@ where /// use yew::prelude::*; /// ``` pub mod prelude { - #[cfg(feature = "agents")] + #[cfg(feature = "agent")] pub use crate::agent::{Bridge, Bridged, Threaded}; pub use crate::app::App; pub use crate::callback::Callback; @@ -157,7 +157,7 @@ pub mod prelude { pub use crate::virtual_dom::Classes; /// Prelude module for creating worker. - #[cfg(feature = "agents")] + #[cfg(feature = "agent")] pub mod worker { pub use crate::agent::{ Agent, AgentLink, Bridge, Bridged, Context, Global, HandlerId, Job, Private, Public,