Skip to content
This repository has been archived by the owner on Jun 18, 2021. It is now read-only.

Commit

Permalink
Merge #280
Browse files Browse the repository at this point in the history
280: Add required wasm-bindgen patches to readme r=grovesNL a=rukai

Fixes #279

Co-authored-by: Rukai <rubickent@gmail.com>
  • Loading branch information
bors[bot] and rukai authored Apr 25, 2020
2 parents aa8f5d7 + c789573 commit c0b09be
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ test = true
#gfx-backend-dx11 = { version = "0.5.0", path = "../gfx/src/backend/dx11" }
#gfx-descriptor = { version = "0.1.0", path = "../gfx-extras/gfx-descriptor" }
#gfx-memory = { version = "0.1.0", path = "../gfx-extras/gfx-memory" }
# Make sure to remove these patches from the README.md when they are are no longer needed
wasm-bindgen = { git = "https://github.com/rustwasm/wasm-bindgen" }
wasm-bindgen-futures = { git = "https://github.com/rustwasm/wasm-bindgen" }
web-sys = { git = "https://github.com/rustwasm/wasm-bindgen" }
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ Create an `index.html` file into `target/generated` directory and add the follow
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="google" content="notranslate">
<title>hello-triangle</title>
</head>
<body>
<script type="module">
Expand All @@ -69,6 +67,15 @@ Create an `index.html` file into `target/generated` directory and add the follow

Now run a web server locally inside the `target/generated` directory to see the `hello-triangle` in the browser.

If you want to adapt the above to run your own crate on the web you will also need to add the following to your Cargo.toml:
```toml
[patch.crates-io]
wasm-bindgen = { git = "https://github.com/rustwasm/wasm-bindgen" }
wasm-bindgen-futures = { git = "https://github.com/rustwasm/wasm-bindgen" }
web-sys = { git = "https://github.com/rustwasm/wasm-bindgen" }
js-sys = { git = "https://github.com/rustwasm/wasm-bindgen" }
```

## Friends

Shout out to the following projects that work best with wgpu-rs:
Expand Down

0 comments on commit c0b09be

Please sign in to comment.