From 7529bad8df9fb509fa790e710f94fb489f1acbae Mon Sep 17 00:00:00 2001 From: Arseniy Kucher Date: Thu, 15 Oct 2020 00:55:18 -0700 Subject: [PATCH] make a note about fn render() problem and suggesting a fix for it --- src/game-of-life/implementing.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/game-of-life/implementing.md b/src/game-of-life/implementing.md index 61597314..16771338 100644 --- a/src/game-of-life/implementing.md +++ b/src/game-of-life/implementing.md @@ -315,6 +315,14 @@ With that, the Rust half of our Game of Life implementation is complete! Recompile it to WebAssembly by running `wasm-pack build` within the `wasm-game-of-life` directory. +> Note: if `wasm-pack build` doesn't compile (due to [#886](https://github.com/rustwasm/wasm-pack/issues/886) issue), +> append your `Cargo.toml` with following: +> ```toml +> [package.metadata.wasm-pack.profile.release] +> wasm-opt = ["-Os", "--enable-mutable-globals"] +> ``` +> You can replace `-Os` flag with a [variety](https://rustwasm.github.io/book/reference/code-size.html#use-the-wasm-opt-tool) of optimization levels. + ## Rendering with JavaScript First, let's add a `
` element to `wasm-game-of-life/www/index.html` to