Skip to content

Commit

Permalink
Put wasm and bindgen files in ignored /pkg dir
Browse files Browse the repository at this point in the history
  • Loading branch information
jthemphill committed Sep 13, 2023
1 parent ac90713 commit c0b7228
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 44 deletions.
6 changes: 1 addition & 5 deletions examples/raytrace-parallel/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
raytrace_parallel.js
raytrace_parallel.d.ts
raytrace_parallel_bg.wasm
raytrace_parallel_bg.wasm.d.ts
snippets
snippets
2 changes: 1 addition & 1 deletion examples/raytrace-parallel/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"raytrace_parallel.wasm",
),
"--out-dir",
root_dir,
os.path.join(root_dir, "pkg"),
"--target",
"no-modules",
],
Expand Down
70 changes: 35 additions & 35 deletions examples/raytrace-parallel/index.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type"/>
<style>
#scene {
height: 100%;
width: 500px;
float: left;
}
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type"/>
<style>
#scene {
height: 100%;
width: 500px;
float: left;
}

#render, .concurrency, .timing {
padding: 20px;
margin: 20px;
float: left;
}
</style>
</head>
<body>
<textarea id='scene'>
#render, .concurrency, .timing {
padding: 20px;
margin: 20px;
float: left;
}
</style>
</head>
<body>
<textarea id='scene'>
{
"width": 800,
"height": 800,
Expand Down Expand Up @@ -201,25 +201,25 @@
}
</textarea>

<button disabled id='render'>Loading wasm...</button>
<div class='concurrency'>
<p id='concurrency-amt'>Concurrency: 1</p>
<br/>
<input disabled type="range" id="concurrency" min="0" max="1" />
</div>
<div id='timing'>
Render duration:
<p id='timing-val'></p>
</div>
<button disabled id='render'>Loading wasm...</button>
<div class='concurrency'>
<p id='concurrency-amt'>Concurrency: 1</p>
<br/>
<input disabled type="range" id="concurrency" min="0" max="1" />
</div>
<div id='timing'>
Render duration:
<p id='timing-val'></p>
</div>


<canvas id='canvas'></canvas>
<canvas id='canvas'></canvas>

<script>
document.getElementById('render').disabled = true;
document.getElementById('concurrency').disabled = true;
</script>
<script src='raytrace_parallel.js'></script>
<script src='index.js'></script>
</body>
<script>
document.getElementById('render').disabled = true;
document.getElementById('concurrency').disabled = true;
</script>
<script src='pkg/raytrace_parallel.js'></script>
<script src='index.js'></script>
</body>
</html>
2 changes: 1 addition & 1 deletion examples/raytrace-parallel/worker.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// synchronously, using the browser, import out shim JS scripts
importScripts('raytrace_parallel.js');
importScripts('pkg/raytrace_parallel.js');

// Wait for the main thread to send us the shared module/memory. Once we've got
// it, initialize it all with the `wasm_bindgen` global we imported via
Expand Down
1 change: 1 addition & 0 deletions examples/wasm-audio-worklet/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
snippets
2 changes: 1 addition & 1 deletion examples/wasm-audio-worklet/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"wasm_audio_worklet.wasm",
),
"--out-dir",
root_dir,
os.path.join(root_dir, "pkg"),
"--target",
"web",
"--split-linked-modules",
Expand Down
2 changes: 1 addition & 1 deletion examples/wasm-audio-worklet/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</head>
<body>
<script type="module">
import init, {web_main} from "./wasm_audio_worklet.js";
import init, {web_main} from "./pkg/wasm_audio_worklet.js";
async function run() {
await init();
web_main();
Expand Down

0 comments on commit c0b7228

Please sign in to comment.