Skip to content

Commit

Permalink
docs: replace WASM with Wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan-Hanke authored and daxpedda committed Jul 3, 2023
1 parent 5158764 commit 7e576ec
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion examples/wasm-audio-worklet/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>WASM audio worklet</title>
<title>Wasm audio worklet</title>
</head>
<body>
<script type="module">
Expand Down
2 changes: 1 addition & 1 deletion examples/wasm-audio-worklet/src/oscillator.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// WASM audio processors can be implemented in Rust without knowing
// Wasm audio processors can be implemented in Rust without knowing
// about audio worklets.

use std::sync::atomic::{AtomicU8, Ordering};
Expand Down
2 changes: 1 addition & 1 deletion examples/wasm-in-web-worker/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<body>
<div id="wrapper">
<h1>Main Thread/WASM Web Worker Interaction</h1>
<h1>Main Thread/Wasm Web Worker Interaction</h1>

<input type="text" id="inputNumber">

Expand Down
4 changes: 2 additions & 2 deletions examples/wasm-in-web-worker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ async function run_wasm() {

console.log('index.js loaded');

// Run main WASM entry point
// This will create a worker from within our Rust code compiled to WASM
// Run main Wasm entry point
// This will create a worker from within our Rust code compiled to Wasm
startup();
}

Expand Down
2 changes: 1 addition & 1 deletion examples/wasm-in-web-worker/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub fn startup() {
// `Rc<RefCell>` following the interior mutability pattern. Here, it would
// not be needed but we include the wrapping anyway as example.
let worker_handle = Rc::new(RefCell::new(Worker::new("./worker.js").unwrap()));
console::log_1(&"Created a new worker from within WASM".into());
console::log_1(&"Created a new worker from within Wasm".into());

// Pass the worker to the function which sets up the `oninput` callback.
setup_input_oninput_callback(worker_handle);
Expand Down
2 changes: 1 addition & 1 deletion examples/wasm-in-web-worker/worker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// The worker has its own scope and no direct access to functions/objects of the
// global scope. We import the generated JS file to make `wasm_bindgen`
// available which we need to initialize our WASM code.
// available which we need to initialize our Wasm code.
importScripts('./pkg/wasm_in_web_worker.js');

console.log('Initializing worker')
Expand Down
4 changes: 2 additions & 2 deletions guide/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
- [web-sys: WebRTC DataChannel](./examples/webrtc_datachannel.md)
- [web-sys: `requestAnimationFrame`](./examples/request-animation-frame.md)
- [web-sys: A Simple Paint Program](./examples/paint.md)
- [web-sys: WASM in Web Worker](./examples/wasm-in-web-worker.md)
- [web-sys: Wasm in Web Worker](./examples/wasm-in-web-worker.md)
- [Parallel Raytracing](./examples/raytrace.md)
- [WASM Audio Worklet](./examples/wasm-audio-worklet.md)
- [Wasm Audio Worklet](./examples/wasm-audio-worklet.md)
- [web-sys: A TODO MVC App](./examples/todomvc.md)
- [Reference](./reference/index.md)
- [Deployment](./reference/deployment.md)
Expand Down
2 changes: 1 addition & 1 deletion guide/src/examples/wasm-audio-worklet.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# WASM audio worklet
# Wasm audio worklet

[View full source code][code] or [view the compiled example online][online]

Expand Down
10 changes: 5 additions & 5 deletions guide/src/examples/wasm-in-web-worker.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# WASM in Web Worker
# Wasm in Web Worker

[View full source code][code]

[code]: https://github.com/rustwasm/wasm-bindgen/tree/master/examples/wasm-in-web-worker

A simple example of parallel execution by spawning a web worker with `web_sys`,
loading WASM code in the web worker and interacting between the main thread and
loading Wasm code in the web worker and interacting between the main thread and
the worker.

## Building & compatibility
Expand Down Expand Up @@ -41,7 +41,7 @@ when the worker returns a message.

Includes the input element `#inputNumber` to type a number into and a HTML
element `#resultField` were the result of the evaluation even/odd is written to.
Since we require to build with `--target no-modules` to be able to load WASM
Since we require to build with `--target no-modules` to be able to load Wasm
code in in the worker across browsers, the `index.html` also includes loading
both `wasm_in_web_worker.js` and `index.js`.

Expand All @@ -51,7 +51,7 @@ both `wasm_in_web_worker.js` and `index.js`.

## `index.js`

Loads our WASM file asynchronously and calls the entry point `startup` of the
Loads our Wasm file asynchronously and calls the entry point `startup` of the
main thread which will create a worker.

```js
Expand All @@ -60,7 +60,7 @@ main thread which will create a worker.

## `worker.js`

Loads our WASM file by first importing `wasm_bindgen` via
Loads our Wasm file by first importing `wasm_bindgen` via
`importScripts('./pkg/wasm_in_web_worker.js')` and then awaiting the Promise
returned by `wasm_bindgen(...)`. Creates a new object to do the background
calculation and bind a method of the object to the `onmessage` callback of the
Expand Down

0 comments on commit 7e576ec

Please sign in to comment.