Skip to content

Commit

Permalink
use required-features for function_router
Browse files Browse the repository at this point in the history
  • Loading branch information
WorldSEnder committed May 7, 2022
1 parent a6bfef5 commit 23a70e9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
5 changes: 3 additions & 2 deletions examples/function_router/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ instant = { version = "0.1", features = ["wasm-bindgen"] }
[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { version = "0.2", features = ["js"] }

[features]
csr = ["yew/csr"]
[[bin]]
name = "function_router"
required-features = ["yew/csr"]
2 changes: 1 addition & 1 deletion examples/function_router/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
href="https://cdn.jsdelivr.net/npm/bulma@0.9.0/css/bulma.min.css"
/>
<link data-trunk rel="sass" href="index.scss" />
<link data-trunk rel="rust" data-cargo-features="csr" data-bin="function_router" />
<link data-trunk rel="rust" data-cargo-features="yew/csr" data-bin="function_router" />
</head>

<body></body>
Expand Down
3 changes: 0 additions & 3 deletions examples/function_router/src/bin/function_router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,5 @@ pub use function_router::*;

fn main() {
wasm_logger::init(wasm_logger::Config::new(log::Level::Trace));
#[cfg(feature = "csr")]
yew::Renderer::<App>::new().render();
#[cfg(not(feature = "csr"))]
panic!("You must enable the csr feature to run this binary");
}

0 comments on commit 23a70e9

Please sign in to comment.