Skip to content

Commit

Permalink
Add a default-enabled feature gate for agents and services (#684)
Browse files Browse the repository at this point in the history
* Add a default-enabled feature gate for agents and services

* cargo fmt

* change feature name for agent support from agents to agent
  • Loading branch information
hgzimmerman authored and jstarry committed Nov 11, 2019
1 parent 5cc48d0 commit 1c54ab1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ trybuild = "1.0"
rustversion = "0.1"

[features]
default = []
default = ["services", "agent"]
doc_test = []
web_test = []
wasm_test = []
services = []
agent = []
yaml = ["serde_yaml"]
msgpack = ["rmp-serde"]
cbor = ["serde_cbor"]
Expand Down
9 changes: 7 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,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 = "agent")]
pub mod agent;
#[cfg(feature = "services")]
pub mod services;

/// The module that contains all events available in the framework.
pub mod events {
pub use crate::html::{ChangeData, InputData};
Expand Down Expand Up @@ -142,6 +145,7 @@ where
/// use yew::prelude::*;
/// ```
pub mod prelude {
#[cfg(feature = "agent")]
pub use crate::agent::{Bridge, Bridged, Threaded};
pub use crate::app::App;
pub use crate::callback::Callback;
Expand All @@ -154,6 +158,7 @@ pub mod prelude {
pub use crate::virtual_dom::Classes;

/// Prelude module for creating worker.
#[cfg(feature = "agent")]
pub mod worker {
pub use crate::agent::{
Agent, AgentLink, Bridge, Bridged, Context, Global, HandlerId, Job, Private, Public,
Expand Down

0 comments on commit 1c54ab1

Please sign in to comment.