Commit e37eb63
authored
Browser support + marginally smaller modules (#1)
* Shave ~20 bytes from math.js file
This is just a small micro-optimization using converge and inline.always
to remove a few bytes off of the final .wasm size. Sadly, we can't use
"shrinkLevel": 3 since that gives imprecise results.
* Fix the message for the 10^-5 test
This confused me for a couple minutes when testing out "shrinkLevel": 3.
* Use `fetch` and `WebAssembly.instantiateStreaming`` to support browsers
Browsers don't have Node.js's Buffer, nor do they have any reasonable
way to decode base64. Luckily, `WebAssembly.instantiateStreaming` allows
using the results of `fetch`, which in turn can accept base64 data URIs.1 parent 0e54be8 commit e37eb63
File tree
5 files changed
+5
-8
lines changed- assembly
- scripts
- test
5 files changed
+5
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
0 commit comments