Update prerequisites documentation

A few assorted improvements to the prerequisites documentation:

* Rust nightly/beta requirements are removed
* Wording indicating that `wasm-pack` requires `npm` has been clarified
* The dedicated Rust page was removed as it's largely just "install
  Rust" nowadays
* The heading of the NPM page in the sidebar now includes `(optional)`
  to clarify that it's not required.
master
Alex Crichton 6 years ago
parent 4a84b499d1
commit e944298e2a
  1. 3
      docs/src/SUMMARY.md
  2. 21
      docs/src/prerequisites/index.md
  3. 35
      docs/src/prerequisites/rust.md

@ -1,8 +1,7 @@
# Summary
- [Prerequisites](./prerequisites/index.md)
- [Rust](./prerequisites/rust.md)
- [npm](./prerequisites/npm.md)
- [npm (optional)](./prerequisites/npm.md)
- [Project Setup](./project-setup/index.md)
- [Using a Template](./project-setup/using-a-template.md)
- [Manual Setup](./project-setup/manual-setup.md)

@ -1,10 +1,19 @@
# Prerequisites
To run `wasm-pack` you'll need to have both Rust and npm installed and configured.
First you'll want to [install the `wasm-pack` CLI][wasm-pack], and `wasm-pack
-V` should print the version that you just installed.
- [Rust](/wasm-pack/book/prerequisites/rust.html)
- [npm](/wasm-pack/book/prerequisites/npm.html)
[wasm-pack]: https://rustwasm.github.io/wasm-pack/installer/
In the future, we intend to rewrite the npm registry client bits so that the need
for a Node runtime is eliminated. If you're excited about that work- you should
reach out to the maintainers and get involved!
Next, since `wasm-pack` is a build tool, you'll want to make sure you have
[Rust][rust] installed. Make sure `rustc -V` prints out at least 1.30.0.
[rust]: https://www.rust-lang.org/tools/install
Finally, if you're using `wasm-pack` to install to publish to NPM, you'll want
to [install and configure `npm`][npm]. In the future, we intend to rewrite the
npm registry client bits so that the need for a Node runtime is eliminated. If
you're excited about that work- you should reach out to the maintainers and get
involved!
[npm]: npm.html

@ -1,35 +0,0 @@
# Rust
`wasm-pack` is a Command Line Interface tool written in Rust, and distributed with `cargo`.
As a result, you'll need Rust and `cargo` to use `wasm-pack`.
### Installing Rust and Cargo
To install Rust, visit this [page](https://www.rust-lang.org/en-US/install.html), which will
walk you through installing Rust and `cargo` on your machine using a tool called `rustup`.
To confirm you have Rust and `cargo` installed, run:
```
rustc --version
cargo --version
```
### Rust Versions
`wasm-pack` depends on a library called `wasm-bindgen`. `wasm-bindgen` requires that you use
Rust 1.30.0 or higher. This version is currently only available on the `nightly` or `beta`
channels.
To get the correct version of Rust, you'll use `rustup` a Rust version manager that comes
bundled with Rust. Run this command to install the latest Rust on the `beta` channel:
```
rustup install beta
```
You can set your project directory to always use this version of Rust by running:
```
rustup override set beta
```
Loading…
Cancel
Save