Skip to content

Commit 293c052

Browse files
ctaggartjstarry
authored andcommitted
bump wasm-bindgen to 0.2.51 (yewstack#681)
* upgrade wasm-bindgen to 0.2.51 * Run macro tests on beta and update readme * Update README.md * Update .travis.yml
1 parent e4b6512 commit 293c052

15 files changed

+32
-25
lines changed

.travis.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ before_cache:
1515
- ./ci/clear_cache.sh
1616

1717
rust:
18-
- 1.35.0 # min supported
19-
- stable
18+
- 1.39.0 # min supported
19+
# - stable (enable when 1.40.0 is released)
2020
- beta
2121
- nightly
2222

@@ -31,7 +31,7 @@ install:
3131
- rustup component add clippy
3232
- rustup target add wasm32-unknown-unknown
3333
- cargo install cargo-update || true
34-
- cargo install-update-config --version =0.2.50 wasm-bindgen-cli
34+
- cargo install-update-config --version =0.2.54 wasm-bindgen-cli
3535
- cargo install-update wasm-bindgen-cli
3636
- LATEST_CHROMEDRIVER_VERSION=`curl -s "https://chromedriver.storage.googleapis.com/LATEST_RELEASE"`
3737
- curl --retry 5 -LO "https://chromedriver.storage.googleapis.com/${LATEST_CHROMEDRIVER_VERSION}/chromedriver_linux64.zip"

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ toml = { version = "0.4", optional = true }
3838
yew-macro = { version = "0.10.0", path = "crates/macro" }
3939

4040
[target.'cfg(all(target_arch = "wasm32", not(cargo_web)))'.dependencies]
41-
wasm-bindgen = "=0.2.50"
41+
wasm-bindgen = "0.2.54"
4242

4343
[target.'cfg(target_os = "emscripten")'.dependencies]
4444
ryu = "=1.0.0" # 1.0.1 breaks emscripten
@@ -49,7 +49,7 @@ trybuild = "1.0"
4949
rustversion = "0.1"
5050

5151
[target.'cfg(all(target_arch = "wasm32", not(cargo_web)))'.dev-dependencies]
52-
wasm-bindgen-test = "=0.2.50"
52+
wasm-bindgen-test = "0.3.1"
5353

5454
[features]
5555
default = []

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<p>
1515
<a href="https://travis-ci.com/yewstack/yew"><img alt="Build Status" src="https://travis-ci.com/yewstack/yew.svg?branch=master"/></a>
1616
<a href="https://gitter.im/yewframework/Lobby"><img alt="Gitter Chat" src="https://badges.gitter.im/yewframework.svg"/></a>
17-
<a href="https://blog.rust-lang.org/2019/05/23/Rust-1.35.0.html"><img alt="Rustc Version 1.35+" src="https://img.shields.io/badge/rustc-1.35+-lightgray.svg"/></a>
17+
<a href="https://blog.rust-lang.org/2019/11/07/Rust-1.39.0.html"><img alt="Rustc Version 1.39+" src="https://img.shields.io/badge/rustc-1.39+-lightgray.svg"/></a>
1818
</p>
1919

2020
<h4>

examples/js_callback/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ yew = { path = "../.." }
99
stdweb = "^0.4.20"
1010

1111
[target.'cfg(all(target_arch = "wasm32", not(cargo_web)))'.dependencies]
12-
wasm-bindgen = "=0.2.50"
12+
wasm-bindgen = "0.2.54"

tests/derive_props/fail.stderr

+4-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ error[E0599]: no method named `build` found for type `t3::PropsBuilder<t3::Props
1919
| - method `build` not found for this
2020
...
2121
34 | Props::builder().build();
22-
| ^^^^^
22+
| ^^^^^ method not found in `t3::PropsBuilder<t3::PropsBuilderStep_missing_required_prop_value>`
2323

2424
error[E0599]: no method named `b` found for type `t4::PropsBuilder<t4::PropsBuilderStep_missing_required_prop_a>` in the current scope
2525
--> $DIR/fail.rs:48:26
@@ -28,7 +28,8 @@ error[E0599]: no method named `b` found for type `t4::PropsBuilder<t4::PropsBuil
2828
| - method `b` not found for this
2929
...
3030
48 | Props::builder().b(1).a(2).build();
31-
| ^ help: did you mean: `a`
31+
| ^ help: there is a method with a similar name: `a`
3232

33-
Some errors occurred: E0277, E0599.
33+
Some errors have detailed explanations: E0277, E0599.
3434
For more information about an error, try `rustc --explain E0277`.
35+
error: could not compile `yew-tests`.

tests/derive_props_test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#[allow(dead_code)]
2-
#[rustversion::attr(stable(1.35.0), cfg_attr(not(feature = "web_test"), test))]
2+
#[rustversion::attr(beta, cfg_attr(not(feature = "web_test"), test))]
33
fn tests() {
44
let t = trybuild::TestCases::new();
55
t.pass("tests/derive_props/pass.rs");

tests/macro/helpers.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ macro_rules! pass_helper {
66
pass_helper! { @ html $($tail)* }
77
};
88
( @html $head:stmt; $($tail:tt)* ) => {
9-
$head;
9+
$head
1010
pass_helper! { @ html $($tail)* }
1111
};
1212
( $($content:tt)* ) => {

tests/macro/html-block-fail.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ error[E0277]: `()` doesn't implement `std::fmt::Display`
3535
= note: required because of the requirements on the impl of `std::convert::Into<yew::virtual_dom::vnode::VNode<_>>` for `()`
3636

3737
For more information about this error, try `rustc --explain E0277`.
38+
error: could not compile `yew-tests`.

tests/macro/html-component-fail-unimplemented.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ error[E0277]: the trait bound `std::string::String: yew::html::Component` is not
55
| ^^^^^^ the trait `yew::html::Component` is not implemented for `std::string::String`
66

77
For more information about this error, try `rustc --explain E0277`.
8+
error: could not compile `yew-tests`.

tests/macro/html-component-fail.stderr

+8-6
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ error: expected type, found `/`
7878
--> $DIR/html-component-fail.rs:74:14
7979
|
8080
74 | html! { </Child> };
81-
| ^
81+
| ^ expected type
8282

8383
error: this open tag has no corresponding close tag
8484
--> $DIR/html-component-fail.rs:75:13
@@ -113,7 +113,7 @@ error[E0599]: no method named `unknown` found for type `ChildPropertiesBuilder<C
113113
| - method `unknown` not found for this
114114
...
115115
65 | html! { <Child unknown="unknown" /> };
116-
| ^^^^^^^
116+
| ^^^^^^^ method not found in `ChildPropertiesBuilder<ChildPropertiesBuilderStep_missing_required_prop_int>`
117117

118118
error[E0308]: mismatched types
119119
--> $DIR/html-component-fail.rs:67:33
@@ -162,6 +162,10 @@ error[E0308]: mismatched types
162162
|
163163
72 | html! { <Child int=0u32 /> };
164164
| ^^^^ expected i32, found u32
165+
help: you can convert an `u32` to `i32` and panic if the converted value wouldn't fit
166+
|
167+
72 | html! { <Child int=0u32.try_into().unwrap() /> };
168+
| ^^^^^^^^^^^^^^^^^^^^^^^^
165169

166170
error[E0599]: no method named `string` found for type `ChildPropertiesBuilder<ChildPropertiesBuilderStep_missing_required_prop_int>` in the current scope
167171
--> $DIR/html-component-fail.rs:73:20
@@ -170,7 +174,7 @@ error[E0599]: no method named `string` found for type `ChildPropertiesBuilder<Ch
170174
| - method `string` not found for this
171175
...
172176
73 | html! { <Child string="abc" /> };
173-
| ^^^^^^
177+
| ^^^^^^ method not found in `ChildPropertiesBuilder<ChildPropertiesBuilderStep_missing_required_prop_int>`
174178

175179
error[E0599]: no method named `children` found for type `ChildPropertiesBuilder<ChildPropertiesBuilderStep_missing_required_prop_int>` in the current scope
176180
--> $DIR/html-component-fail.rs:77:5
@@ -179,7 +183,7 @@ error[E0599]: no method named `children` found for type `ChildPropertiesBuilder<
179183
| - method `children` not found for this
180184
...
181185
77 | html! { <Child>{ "Not allowed" }</Child> };
182-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
186+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `ChildPropertiesBuilder<ChildPropertiesBuilderStep_missing_required_prop_int>`
183187
|
184188
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
185189

@@ -227,5 +231,3 @@ error[E0277]: the trait bound `yew::virtual_dom::vcomp::VChild<Child, ChildConta
227231
|
228232
= note: required because of the requirements on the impl of `std::convert::Into<yew::virtual_dom::vcomp::VChild<Child, ChildContainer>>` for `yew::virtual_dom::vnode::VNode<_>`
229233
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
230-
231-
Some errors occurred: E0277, E0308, E0425, E0599, E0609.

tests/macro/html-iterable-fail.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,4 @@ error[E0277]: `()` doesn't implement `std::fmt::Display`
6060
= note: required because of the requirements on the impl of `std::convert::Into<yew::virtual_dom::vnode::VNode<_>>` for `&()`
6161

6262
For more information about this error, try `rustc --explain E0277`.
63+
error: could not compile `yew-tests`.

tests/macro/html-list-fail.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,5 @@ error: expected valid html element
3939
|
4040
10 | html! { <>invalid</> };
4141
| ^^^^^^^
42+
43+
error: could not compile `yew-tests`.

tests/macro/html-node-fail.stderr

+4-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ error: unsupported type
2222
11 | html! { b"str" };
2323
| ^^^^^^
2424

25-
error: int literal is too large
25+
error: integer literal is too large
2626
--> $DIR/html-node-fail.rs:12:14
2727
|
2828
12 | html! { 1111111111111111111111111111111111111111111111111111111111111111111111111111 };
@@ -40,7 +40,7 @@ error: unsupported type
4040
14 | html! { <span>{ b"str" }</span> };
4141
| ^^^^^^
4242

43-
error: int literal is too large
43+
error: integer literal is too large
4444
--> $DIR/html-node-fail.rs:15:22
4545
|
4646
15 | html! { <span>{ 1111111111111111111111111111111111111111111111111111111111111111111111111111 }</span> };
@@ -76,5 +76,6 @@ error[E0277]: `()` doesn't implement `std::fmt::Display`
7676
= note: required because of the requirements on the impl of `std::convert::From<()>` for `yew::virtual_dom::vnode::VNode<_>`
7777
= note: required by `std::convert::From::from`
7878

79-
Some errors occurred: E0277, E0425.
79+
Some errors have detailed explanations: E0277, E0425.
8080
For more information about an error, try `rustc --explain E0277`.
81+
error: could not compile `yew-tests`.

tests/macro/html-tag-fail.stderr

+1-3
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ error[E0599]: no method named `to_string` found for type `NotToString` in the cu
197197
| ------------------- method `to_string` not found for this
198198
...
199199
37 | html! { <input string=NotToString /> };
200-
| ^^^^^^^^^^^
200+
| ^^^^^^^^^^^ method not found in `NotToString`
201201
|
202202
= note: the method `to_string` exists but the following trait bounds were not satisfied:
203203
`NotToString : std::string::ToString`
@@ -213,5 +213,3 @@ error[E0308]: mismatched types
213213
|
214214
= note: expected type `yew::html::NodeRef`
215215
found type `()`
216-
217-
Some errors occurred: E0277, E0308, E0599.

tests/macro_test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#[allow(dead_code)]
2-
#[rustversion::attr(stable(1.35.0), cfg_attr(not(feature = "web_test"), test))]
2+
#[rustversion::attr(stable(1.39.0), cfg_attr(not(feature = "web_test"), test))]
33
fn tests() {
44
let t = trybuild::TestCases::new();
55

0 commit comments

Comments
 (0)