Skip to content

Commit

Permalink
Fixed library types in Cargo.toml (for wasm-pack) (#1088)
Browse files Browse the repository at this point in the history
Also added some missing implementations of Component::change

Co-authored-by: Sebastian Zivota <sebastian.zivota@mailbox.org>
  • Loading branch information
loewenheim and Sebastian Zivota committed Apr 19, 2020
1 parent 688a568 commit b62e4da
Show file tree
Hide file tree
Showing 14 changed files with 45 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/web_sys/counter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ version = "0.1.1"
authors = ["Denis Kolodin <deniskolodin@gmail.com>"]
edition = "2018"

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
js-sys = "0.3"
yew = { path = "../../..", features = ["services", "web_sys"] }
3 changes: 3 additions & 0 deletions examples/web_sys/file_upload/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ version = "0.1.0"
authors = ["Denis Kolodin <deniskolodin@gmail.com>"]
edition = "2018"

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
js-sys = "0.3"
yew = { path = "../../..", features = ["web_sys"] }
4 changes: 4 additions & 0 deletions examples/web_sys/file_upload/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ impl Component for Model {
</div>
}
}

fn change(&mut self, _props: Self::Properties) -> ShouldRender {
false
}
}

impl Model {
Expand Down
3 changes: 3 additions & 0 deletions examples/web_sys/inner_html/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ version = "0.1.0"
authors = ["Garrett Berg <vitiral@gmail.com>"]
edition = "2018"

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
web-sys = { version = "0.3", features = ["console", "Document", "Element", "Node", "Window"] }
yew = { path = "../../..", features = ["web_sys"] }
3 changes: 3 additions & 0 deletions examples/web_sys/js_callback/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ version = "0.1.0"
authors = ["Scott Steele <scottlsteele@gmail.com>"]
edition = "2018"

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
yew = { path = "../../..", features = ["web_sys"] }

Expand Down
3 changes: 3 additions & 0 deletions examples/web_sys/mount_point/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ version = "0.1.0"
authors = ["Ben Berman <ben@standardbots.com>"]
edition = "2018"

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
wasm-bindgen = "0.2"
yew = { path = "../../..", features = ["web_sys"] }
Expand Down
3 changes: 3 additions & 0 deletions examples/web_sys/multi_thread/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ version = "0.1.0"
authors = ["Denis Kolodin <deniskolodin@gmail.com>"]
edition = "2018"

[lib]
crate-type = ["cdylib", "rlib"]

[[bin]]
name = "multi_thread_app"
path = "src/bin/app.rs"
Expand Down
4 changes: 4 additions & 0 deletions examples/web_sys/multi_thread/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,8 @@ impl Component for Model {
</div>
}
}

fn change(&mut self, _props: Self::Properties) -> ShouldRender {
false
}
}
3 changes: 3 additions & 0 deletions examples/web_sys/node_refs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ version = "0.1.0"
authors = ["Justin Starry <justin.starry@icloud.com>"]
edition = "2018"

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
yew = { path = "../../..", features = ["web_sys"] }
web-sys = { version = "0.3", features = ["HtmlElement", "HtmlInputElement", "Node"] }
3 changes: 3 additions & 0 deletions examples/web_sys/npm_and_rest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ version = "0.1.0"
authors = ["Denis Kolodin <deniskolodin@gmail.com>"]
edition = "2018"

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
anyhow = "1"
js-sys = "0.3"
Expand Down
3 changes: 3 additions & 0 deletions examples/web_sys/todomvc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ version = "0.1.0"
authors = ["Denis Kolodin <deniskolodin@gmail.com>"]
edition = "2018"

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
strum = "0.13"
strum_macros = "0.13"
Expand Down
3 changes: 3 additions & 0 deletions examples/web_sys/two_apps/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ version = "0.1.0"
authors = ["Denis Kolodin <deniskolodin@gmail.com>"]
edition = "2018"

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
stdweb = "0.4.20"
yew = { path = "../../..", features = ["web_sys"] }
3 changes: 3 additions & 0 deletions examples/web_sys/webgl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ version = "0.1.0"
authors = ["Miklós Tusz <mdtusz@gmail.com>"]
edition = "2018"

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
js-sys = "0.3"
yew = { path = "../../..", features = ["web_sys"] }
Expand Down
4 changes: 4 additions & 0 deletions examples/web_sys/webgl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ impl Component for Model {
<canvas ref={self.node_ref.clone()} />
}
}

fn change(&mut self, _props: Self::Properties) -> ShouldRender {
false
}
}

impl Model {
Expand Down

0 comments on commit b62e4da

Please sign in to comment.