Skip to content

Commit

Permalink
Add information about additional generated files.
Browse files Browse the repository at this point in the history
wasm_game_of_life_bg.js and wasm_game_of_life_bg.wasm.d.ts are now being
generated by `wasm-pack build`.

There is some additional information about these files in
rustwasm/wasm-pack#199 and
rustwasm/wasm-pack#1193 .
  • Loading branch information
Kim Wallmark committed Apr 8, 2023
1 parent 366042a commit 091f614
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/game-of-life/hello-world.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ and it should have these contents:
pkg/
├── package.json
├── README.md
├── wasm_game_of_life_bg.js
├── wasm_game_of_life_bg.wasm
├── wasm_game_of_life_bg.wasm.d.ts
├── wasm_game_of_life.d.ts
└── wasm_game_of_life.js
```
Expand Down Expand Up @@ -147,12 +149,18 @@ export function greet() {
}
```

### `wasm-game-of-life/pkg/wasm_game_of_life.d.ts`
### `wasm-game-of-life/pkg/wasm_game_of_life_bg.js`

The `.d.ts` file contains [TypeScript][] type declarations for the JavaScript
glue. If you are using TypeScript, you can have your calls into WebAssembly
functions type checked, and your IDE can provide autocompletions and
suggestions! If you aren't using TypeScript, you can safely ignore this file.
This `_bg.js` file contains shim code that allows the `_bg.wasm` code to be
required as a module in Node.js.

### `wasm-game-of-life/pkg/wasm_game_of_life.d.ts` and `wasm-game-of-life/pkg/wasm_game_of_life_bg.wasm.d.ts`

These `.d.ts` files contain [TypeScript][] type declarations for the JavaScript
glue and the wasm code. If you are using TypeScript, you can have your calls
into WebAssembly functions type checked, and your IDE can provide
autocompletions and suggestions! If you aren't using TypeScript, you can safely
ignore these files.

```typescript
export function greet(): void;
Expand Down

0 comments on commit 091f614

Please sign in to comment.