Skip to content

Commit e71871e

Browse files
committed
Begin removing wasm-pack from guide
1 parent a87ce69 commit e71871e

File tree

6 files changed

+28
-57
lines changed

6 files changed

+28
-57
lines changed

CHANGELOG.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -915,8 +915,7 @@ Released 2019-04-10.
915915

916916
### Added
917917

918-
* Initial support for transitive NPM dependencies has been added, although
919-
support has not fully landed in `wasm-pack` yet so it's not 100% integrated.
918+
* Initial support for transitive NPM dependencies has been added.
920919
[#1305](https://github.com/rustwasm/wasm-bindgen/pull/1305)
921920

922921
* The `constructor` property of `Object` is now bound in `js-sys`.

benchmarks/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ $ cp ./benchmarks /some/other/directory
2020
Next, `cd` into that directory and execute:
2121

2222
```
23-
$ wasm-pack build --target web
23+
$ cargo build --release --target wasm32-unknown-unknown
24+
$ wasm-bindgen --target web ./target/wasm32-unknown-unknown/release/crate.wasm
2425
```
2526

2627
Next, use your favorite static file server to host the current directory. For

crates/shared/src/lib.rs

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#![doc(html_root_url = "https://docs.rs/wasm-bindgen-shared/0.2")]
22

3+
#[cfg(test)]
4+
mod schema_hash_approval;
5+
36
// This gets changed whenever our schema changes.
47
// At this time versions of wasm-bindgen and wasm-bindgen-cli are required to have the exact same
58
// SCHEMA_VERSION in order to work together.
@@ -192,25 +195,3 @@ pub fn version() -> String {
192195
}
193196
return v;
194197
}
195-
196-
#[cfg(test)]
197-
mod tests {
198-
use super::*;
199-
200-
// Whenever this file changes, the SCHEMA_FILE_HASH environment variable will change and the
201-
// schema_version test below will fail.
202-
// Proceed as follows:
203-
//
204-
// If the schema in this library has changed then:
205-
// 1. Change this APPROVED_SCHEMA_FILE_HASH to the new hash.
206-
//
207-
// If the schema in this library has changed then:
208-
// 1. Bump the version in `crates/shared/Cargo.toml`
209-
// 2. Change the `SCHEMA_VERSION` in this library to this new Cargo.toml version
210-
const APPROVED_SCHEMA_FILE_HASH: &'static str = "12345";
211-
212-
#[test]
213-
fn schema_version() {
214-
assert_eq!(env!("SCHEMA_FILE_HASH"), APPROVED_SCHEMA_FILE_HASH)
215-
}
216-
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Whenever the lib.rs changes, the SCHEMA_FILE_HASH environment variable will change and the
2+
// schema_version test below will fail.
3+
// Proceed as follows:
4+
//
5+
// If the schema in this library has changed then:
6+
// 1. Change this APPROVED_SCHEMA_FILE_HASH to the new hash.
7+
//
8+
// If the schema in this library has changed then:
9+
// 1. Bump the version in `crates/shared/Cargo.toml`
10+
// 2. Change the `SCHEMA_VERSION` in this library to this new Cargo.toml version
11+
const APPROVED_SCHEMA_FILE_HASH: &'static str = "12458387802132375736";
12+
13+
#[test]
14+
fn schema_version() {
15+
assert_eq!(env!("SCHEMA_FILE_HASH"), APPROVED_SCHEMA_FILE_HASH)
16+
}

guide/src/reference/cli.md

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,11 @@ The `wasm-bindgen` command line tool has a number of options available to it to
44
tweak the JavaScript that is generated. The most up-to-date set of flags can
55
always be listed via `wasm-bindgen --help`.
66

7-
> Note: usually, one should use a [`wasm-pack`-based workflow][wasm-pack] rather
8-
> than running the `wasm-bindgen` command line tool by hand.
9-
10-
[wasm-pack]: https://github.com/rustwasm/wasm-pack
11-
127
## Installation
138

14-
The recommend way to install the `wasm-bindgen` command line tool is with the
15-
`wasm-pack` installer described
16-
[here](https://rustwasm.github.io/wasm-pack/installer/). After installing
17-
`wasm-pack`, you are ready to build project invoking `wasm-pack build`.
18-
This command installs a compatible version of the `wasm-bindgen` command-line
19-
tool. The version of `wasm-bindgen` installed by `wasm-pack` is not available
20-
to be used directly via command line.
21-
22-
It is not recommended to install `wasm-bindgen-cli` as its internal schema
23-
format must be the exact same as that of the version of `wasm-bindgen` that
24-
is specified in the project's Cargo.lock file.
25-
Using `wasm-pack` for building simplifies the build process
26-
as `wasm-pack` ensures that the proper version of `wasm-bindgen` command-line
27-
tool is used. That means that `wasm-pack` may install many different versions
28-
of `wasm-bindgen`, but during the build `wasm-pack` will always make sure to
29-
use the correct one.
30-
31-
Note: if, for any reason, you decide to use wasm-bindgen directly (this is
32-
not recommended!) you will have to manually take care of making sure to
33-
use compatible versions of the wasm-bindgen command-line tool (wasm-bindgen-cli)
34-
and the wasm-bingden in your Cargo.lock.
9+
```
10+
cargo install -f wasm-bindgen-cli
11+
```
3512

3613
## Usage
3714

guide/src/reference/deployment.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ as documentation for the various known options, and as always PRs are welcome
66
to update this if it's out of date!
77

88
The methods of deployment and integration here are primarily tied to the
9-
`--target` flag. Note that the `--target` flag of `wasm-pack` and `wasm-bindgen`
10-
should behave the same way in this respect. The values possible here are:
9+
`--target` flag.
1110

1211
| Value | Summary |
1312
|-----------------|------------------------------------------------------------|
@@ -55,8 +54,7 @@ If you're not using a bundler but you're still running code in a web browser,
5554
`--target web` flag. You can check out a [full example][nomex] in the
5655
documentation, but the highlights of this output are:
5756

58-
* When compiling you'll pass `--target web` to `wasm-pack` (or `wasm-bindgen`
59-
directly).
57+
* When compiling you'll pass `--target web` to `wasm-bindgen`
6058
* The output can natively be included on a web page, and doesn't require any
6159
further postprocessing. The output is included as an ES module.
6260
* The `--target web` mode is not able to use NPM dependencies.
@@ -79,8 +77,7 @@ information about `--target no-modules`.
7977
**`--target nodejs`**
8078

8179
If you're deploying WebAssembly into Node.js (perhaps as an alternative to a
82-
native module), then you'll want to pass the `--target nodejs` flag to
83-
`wasm-pack` or `wasm-bindgen`.
80+
native module), then you'll want to pass the `--target nodejs` flag to `wasm-bindgen`.
8481

8582
Like the "without a bundler" strategy, this method of deployment does not
8683
require any further postprocessing. The generated JS shims can be `require`'d

0 commit comments

Comments
 (0)