makefile updates for file size

master
David O'Connor 5 years ago
commit f6b66468b7

@ -16,22 +16,6 @@ workspace = false
command = "cargo" command = "cargo"
args = ["build", "--release"] args = ["build", "--release"]
[tasks.build]
description = "Build, and create wasms"
workspace = false
dependencies = ["compile", "create_wasm"]
[tasks.watch]
description = "Build, create wasms, and watch/recompile files for changes"
workspace = false
dependencies = ["build", "create_wasm"]
watch = { ignore_pattern="pkg/*" }
[tasks.compile_release]
description = "Build, and create wasms, with the --release flag"
workspace = false
dependencies = ["build_release", "create_wasm_release"]
[tasks.create_wasm] [tasks.create_wasm]
description = "Build with wasm-pack" description = "Build with wasm-pack"
install_crate = { crate_name = "wasm-pack", binary = "wasm-pack", test_arg = "-V" } install_crate = { crate_name = "wasm-pack", binary = "wasm-pack", test_arg = "-V" }
@ -44,6 +28,17 @@ install_crate = { crate_name = "wasm-pack", binary = "wasm-pack", test_arg = "-V
command = "wasm-pack" command = "wasm-pack"
args = ["build", "--target", "no-modules", "--out-name", "package"] args = ["build", "--target", "no-modules", "--out-name", "package"]
[tasks.build]
description = "Build, and create wasms"
workspace = false
dependencies = ["compile", "create_wasm"]
[tasks.watch]
description = "Build, create wasms, and watch/recompile files for changes"
workspace = false
dependencies = ["build", "create_wasm"]
watch = { ignore_pattern="pkg/*" }
[tasks.serve] [tasks.serve]
description = "Start server" description = "Start server"
install_crate = { crate_name = "microserver", binary = "microserver", test_arg = "-h" } install_crate = { crate_name = "microserver", binary = "microserver", test_arg = "-h" }

@ -25,7 +25,7 @@ enum Msg {
Increment, Increment,
} }
fn update(msg: Msg, model: &mut Model, _: &mut Orders<Msg>) { fn update(msg: Msg, model: &mut Model, _: &mut impl Orders<Msg>) {
match msg { match msg {
Msg::Increment => model.val += 1, Msg::Increment => model.val += 1,
} }
@ -34,7 +34,7 @@ fn update(msg: Msg, model: &mut Model, _: &mut Orders<Msg>) {
// View // View
fn view(model: &Model) -> View<Msg> { fn view(model: &Model) -> impl View<Msg> {
button![ button![
simple_ev(Ev::Click, Msg::Increment), simple_ev(Ev::Click, Msg::Increment),
format!("Hello, World × {}", model.val) format!("Hello, World × {}", model.val)
@ -43,7 +43,7 @@ fn view(model: &Model) -> View<Msg> {
#[wasm_bindgen] #[wasm_bindgen]
pub fn render() { pub fn render() {
seed::App::build(Model::default(), update, view) seed::App::build(|_, _| Model::default(), update, view)
.finish() .finish()
.run(); .run();

Loading…
Cancel
Save