Skip to content

Commit 7ca6076

Browse files
committed
Release 0.2.3
1 parent a00e209 commit 7ca6076

File tree

28 files changed

+266
-878
lines changed

28 files changed

+266
-878
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ rust:
44
os:
55
- linux
66
- osx
7-
#- windows
7+
- windows
88
addons:
99
firefox: latest
1010
cache: cargo
1111
before_script:
1212
- rustup target add wasm32-unknown-unknown
13-
- cargo install wasm-bindgen-cli --vers 0.2.29 || true
14-
- cargo install wasm-pack --vers 0.5.1 || true
13+
- cargo install wasm-bindgen-cli --vers 0.2.33 || true
14+
- cargo install wasm-pack --vers 0.6.0 || true
1515
script:
1616
- cargo build --tests --target wasm32-unknown-unknown
1717
- wasm-pack test --headless --firefox

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
## V0.2.3
44
- Fixed a bug where initially-empty text won't update
55
- Added more tests
6+
- Exposed web_sys Document and Window in top level of Seed create, with .expect
7+
- Modified build scripts to keep the wasm output name fixed at 'package', simplifying example/quickstart renames
8+
- Tests now work in Windows due to update in wasm-pack
69

710
## V0.2.2
811
- Overhaul of fetch module

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "seed"
3-
version = "0.2.2"
3+
version = "0.2.3"
44
description = "A Rust framework for creating web apps, using WebAssembly"
55
authors = ["DavidOConnor <[email protected]>"]
66
license = "MIT"
@@ -16,14 +16,14 @@ edition = "2018"
1616
crate-type = ["cdylib", "rlib"]
1717

1818
[dev-dependencies]
19-
wasm-bindgen-test = "^0.2.31" # NOTE: keep in sync with wasm-bindgen version
19+
wasm-bindgen-test = "^0.2.33" # NOTE: keep in sync with wasm-bindgen version
2020

2121
[dependencies]
22-
wasm-bindgen = {version = "^0.2.31", features = ["serde-serialize"]}
22+
wasm-bindgen = {version = "^0.2.33", features = ["serde-serialize"]}
2323
js-sys = "0.3.6"
2424
console_error_panic_hook = "^0.1.5"
25-
serde = { version = "^1.0.80", features = ['derive'] }
26-
serde_json = "^1.0.33"
25+
serde = { version = "^1.0.85", features = ['derive'] }
26+
serde_json = "^1.0.36"
2727
futures = "^0.1.20"
2828
wasm-bindgen-futures = "^0.3.6"
2929

README.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@
99

1010
The best place to learn is the [guide](https://seed-rs.org) - this readme is an excerpt from it.
1111

12-
## Quickstart
13-
1412
## Setup
15-
This framework requires you to first install [Rust](https://www.rust-lang.org/tools/install).
13+
This framework requires you to install [Rust](https://www.rust-lang.org/tools/install).
1614

1715
You'll need a recent version of Rust: `rustup update`
1816

@@ -41,22 +39,21 @@ If not using the quickstart repo, create an Html file with a body that contains
4139
```html
4240
<section id="main"></section>
4341

44-
<script src='./pkg/appname.js'></script>
42+
<script src='./pkg/package.js'></script>
4543

4644
<script>
4745
const { render } = wasm_bindgen;
4846
function run() {
4947
render();
5048
}
51-
wasm_bindgen('./pkg/appname_bg.wasm')
49+
wasm_bindgen('./pkg/package_bg.wasm')
5250
.then(run)
5351
.catch(console.error);
5452
</script>
5553
```
5654
The first line above is an empty element with id: It's where your app will render. The subsequent ones load your app's wasm modules.
5755

58-
The quickstart repo includes this file, but you will need to rename the two
59-
occurances of `appname`. (If your project name has a hyphen, use an underscore instead here) You will eventually need to modify this file to
56+
The quickstart repo includes this file. You will eventually need to modify it to
6057
change the page's title, add a description, favicon, stylesheet etc.
6158

6259
`Cargo.toml`, which is a file created by Cargo that describes your app, needs `wasm-bindgen`, `web-sys`, and `
@@ -75,7 +72,7 @@ edition = "2018"
7572
crate-type = ["cdylib"]
7673

7774
[dependencies]
78-
seed = "^0.2.0"
75+
seed = "^0.1.12"
7976
wasm-bindgen = "^0.2.29"
8077
web-sys = "^0.3.6"
8178
```
@@ -143,8 +140,7 @@ fn success_level(clicks: i32) -> El<Msg> {
143140
p![ descrip ]
144141
}
145142

146-
/// The top-level component we pass to the virtual dom. Must accept the model as its
147-
/// only parameter, and output a single El.
143+
/// The top-level component we pass to the virtual dom.
148144
fn view(state: seed::App<Msg, Model>, model: Model) -> El<Msg> {
149145
let plural = if model.count == 1 {""} else {"s"};
150146

@@ -195,7 +191,7 @@ cargo build --target wasm32-unknown-unknown
195191
```
196192
and
197193
```
198-
wasm-bindgen target/wasm32-unknown-unknown/debug/appname.wasm --no modules --out-dir ./pkg
194+
wasm-bindgen target/wasm32-unknown-unknown/debug/appname.wasm --no modules --out-dir ./pkg --out-name package
199195
```
200196
where `appname` is replaced with your app's name. This compiles your code in the target
201197
folder, and populates the pkg folder with your WASM module, a Typescript definitions file,
@@ -212,6 +208,8 @@ For development, you can view your app using a shimmed Python dev server, as des
212208
from the quickstart repo, and run `python serve.py`).
213209

214210
In the future, the build script and commands above may be replaced by [wasm-pack](https://github.com/rustwasm/wasm-pack).
211+
You may use it now if you wish, but may run into issues running the examples, enabling no-modules mode,
212+
and syntax-highlighting in the compile logs.
215213

216214
## Running included examples
217215
To run an example located in the [examples folder](https://github.com/David-OConnor/seed/tree/master/examples),

examples/counter/build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
cargo build --target wasm32-unknown-unknown
2-
wasm-bindgen ../../target/wasm32-unknown-unknown/debug/counter.wasm --no-modules --out-dir ./pkg
2+
wasm-bindgen ../../target/wasm32-unknown-unknown/debug/counter.wasm --no-modules --out-dir ./pkg --out-name package

examples/counter/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env bash
22
cargo build --target wasm32-unknown-unknown
3-
wasm-bindgen ../../target/wasm32-unknown-unknown/debug/counter.wasm --no-modules --out-dir ./pkg
3+
wasm-bindgen ../../target/wasm32-unknown-unknown/debug/counter.wasm --no-modules --out-dir ./pkg --out-name package

examples/counter/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<body>
1717
<section id="main"></section>
1818

19-
<script src='./pkg/counter.js'></script>
19+
<script src='./pkg/package.js'></script>
2020

2121
<script>
2222
// the `wasm_bindgen` global is set to the exports of the Rust module
@@ -27,7 +27,7 @@
2727
}
2828
// here we tell bindgen the path to the wasm file so it can run
2929
// initialization and return to us a promise when it's done
30-
wasm_bindgen('./pkg/counter_bg.wasm')
30+
wasm_bindgen('./pkg/package_bg.wasm')
3131
.then(run)
3232
.catch(console.error);
3333
</script>

examples/counter/pkg/counter.d.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)