wasm_game_of_life/README.md

46 lines
917 B
Markdown
Raw Permalink Normal View History

## About
2020-06-10 19:50:37 +02:00
Tweak of the great Wasm tutorial here :
2020-06-10 20:16:36 +02:00
[tutorials](https://rustwasm.github.io/docs/book/game-of-life/implementing.html)
2020-06-10 19:50:37 +02:00
## Links
2020-06-10 20:16:36 +02:00
* [`wasm-pack`](https://rustwasm.github.io/docs/wasm-pack/tutorials/index.html)
* [`wasm-bindgen`](https://github.com/rustwasm/wasm-bindgen) for communicating
between WebAssembly and JavaScript.
* [`console_error_panic_hook`](https://github.com/rustwasm/console_error_panic_hook)
for logging panic messages to the developer console.
* [`wee_alloc`](https://github.com/rustwasm/wee_alloc), an allocator optimized
for small code size.
2020-06-10 19:50:37 +02:00
## Note for myself
Crée l'arborescence www
~~~
$ wasm-pack build
$ npm init wasm-app www
$ cd www/
$ npm install
~~~
Puis :
~~~
$ vim www/package.json
--
"dependencies": {
"wasm-game-of-life": "file:../pkg", // Add this line!
--
~~~
Puis :
~~~
$ vim www/index.js
--
import * as wasm from "wasm-game-of-life";
(…)
--
~~~