Tweak introductory and deployment documentation.

This commit rejiggers some documentation of `wasm-bindgen` in a few
significant ways:

* The main landing page now has text and links to the Game of Life
  tutorial and `wasm-pack`.
* The "whirlwind tour" was deleted as it wasn't really serving any
  purpose that the Game of Life plus the later references weren't already
  serving.
* The "no modules" example was renamed to "without a bundler"
* A dedicated section on "Deployment" was added which replaces the
  previous "No ES Modules" page. This is hopefully more descriptive and
  also prominently mentions the various options for deployment.
This commit is contained in:
Alex Crichton
2019-02-21 11:49:08 -08:00
parent 74a39ce618
commit b71f3374c5
18 changed files with 189 additions and 532 deletions

View File

@ -1,15 +1,19 @@
# Introduction
`wasm-bindgen` facilitates high-level interactions between wasm modules and
JavaScript.
This book is about `wasm-bindgen`, a Rust library and CLI tool that facilitate
high-level interactions between wasm modules and JavaScript. The `wasm-bindgen`
tool and crate are only one part of the [Rust and WebAssembly
ecosystem][rustwasm]. If you're not familiar already with `wasm-bindgen` it's
recommended to start by reading the [Game of Life tutorial][gol]. If you're
curious about `wasm-pack`, you can find that [documentation here][wasm-pack].
This project is sort of half polyfill for features like the [host bindings
proposal][host] and half features for empowering high-level interactions between
JS and wasm-compiled code (currently mostly from Rust). More specifically this
project allows JS/wasm to communicate with strings, JS objects, classes, etc, as
opposed to purely integers and floats. Using `wasm-bindgen` for example you can
define a JS class in Rust or take a string from JS or return one. The
functionality is growing as well!
The `wasm-bindgen` tool is sort of half polyfill for features like the [host
bindings proposal][host] and half features for empowering high-level
interactions between JS and wasm-compiled code (currently mostly from Rust).
More specifically this project allows JS/wasm to communicate with strings, JS
objects, classes, etc, as opposed to purely integers and floats. Using
`wasm-bindgen` for example you can define a JS class in Rust or take a string
from JS or return one. The functionality is growing as well!
Currently this tool is Rust-focused but the underlying foundation is
language-independent, and it's hoping that over time as this tool stabilizes
@ -22,10 +26,12 @@ Notable features of this project includes:
* Exporting Rust functionality to JS such as classes, functions, etc.
* Working with rich types like strings, numbers, classes, closures, and objects
rather than simply `u32` and floats.
* Automatically generating TypeScript bindings for Rust code being consumed by
JS.
This project is still relatively new but feedback is of course always
welcome! If you're curious about the design plus even more information about
what this crate can do, check out the [design doc].
With the addition of [`wasm-pack`] you can run the gamut from running Rust on
the web locally, publishing it as part of a larger application, or even
publishing Rust-compiled-to-WebAssembly on NPM!
[host]: https://github.com/WebAssembly/host-bindings
[design doc]: https://rustwasm.github.io/wasm-bindgen/contributing/design/index.html
@ -33,3 +39,6 @@ what this crate can do, check out the [design doc].
[console-log]: https://github.com/rustwasm/wasm-bindgen/tree/master/examples/console_log
[perf-ex]: https://github.com/rustwasm/wasm-bindgen/tree/master/examples/performance
[hello-online]: https://webassembly.studio/?f=gzubao6tg3
[rustwasm]: https://rustwasm.github.io/
[gol]: https://rustwasm.github.io/book/
[wasm-pack]: https://rustwasm.github.io/wasm-pack/book/