$ make
```
-That will generate the fiddle application under
-[ext/fiddle](/dir/ext/wasm/fiddle), as `fiddle.html`. That application
-cannot, due to XMLHttpRequest security limitations, run if the HTML
-file is opened directly in the browser (i.e. if it is opened using a
-`file://` URL), so it needs to be served via an HTTP server. For
-example, using [althttpd][]:
+That will generate the a number of files required for a handful of
+test and demo applications which can be accessed via
+`index.html`. WASM content cannot, due to XMLHttpRequest security
+limitations, be loaded if the containing HTML file is opened directly
+in the browser (i.e. if it is opened using a `file://` URL), so it
+needs to be served via an HTTP server. For example, using
+[althttpd][]:
```
-$ cd ext/wasm/fiddle
-$ althttpd -page fiddle.html
+$ cd ext/wasm
+$ althttpd --enable-sab --max-age 1 --page index.html
```
-That will open the system's browser and run the fiddle app's page.
+That will open the system's browser and run the index page, from which
+all of the test and demo applications can be accessed.
Note that when serving this app via [althttpd][], it must be a version
-from 2022-05-17 or newer so that it recognizes the `.wasm` file
-extension and responds with the mimetype `application/wasm`, as the
-WASM loader is pedantic about that detail.
+from 2022-09-26 or newer so that it recognizes the `--enable-sab`
+flag, which causes althttpd to emit two HTTP response headers which
+are required to enable JavaScript's `SharedArrayBuffer` and `Atomics`
+APIs. Those APIs are required in order to enable the OPFS-related
+features in the apps which use them.
# Testing on a remote machine that is accessed via SSH
*NB: The following are developer notes, last validated on 2022-08-18*
* Remote: Install git, emsdk, and althttpd
- * Use a [version of althttpd](https://sqlite.org/althttpd/timeline?r=enable-atomics)
- that adds HTTP reply header lines to enable SharedArrayBuffers. These header
- lines are required:
-```
- Cross-Origin-Opener-Policy: same-origin
- Cross-Origin-Embedder-Policy: require-corp
-```
+ * Use a [version of althttpd][althttpd] from
+ September 26, 2022 or newer.
* Remote: Install the SQLite source tree. CD to ext/wasm
* Remote: "`make`" to build WASM
- * Remote: althttpd --port 8080 --popup
- * Local: ssh -L 8180:localhost:8080 remote
- * Local: Point your web-browser at http://localhost:8180/testing1.html
+ * Remote: `althttpd --enable-sab --port 8080 --popup`
+ * Local: `ssh -L 8180:localhost:8080 remote`
+ * Local: Point your web-browser at http://localhost:8180/index.html
In order to enable [SharedArrayBuffers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer),
the web-browser requires that the two extra Cross-Origin lines be present
using SSH.
-
-# Known Quirks and Limitations
-
-Some "impedence mismatch" between C and WASM/JavaScript is to be
-expected.
-
-## No I/O
-
-sqlite3 shell commands which require file I/O or pipes are disabled in
-the WASM build.
-
-## `exit()` Triggered from C
-
-When C code calls `exit()`, as happens (for example) when running an
-"unsafe" command when safe mode is active, WASM's connection to the
-sqlite3 shell environment has no sensible choice but to shut down
-because `exit()` leaves it in a state we can no longer recover
-from. The JavaScript-side application attempts to recognize this and
-warn the user that restarting the application is necessary. Currently
-the only way to restart it is to reload the page. Restructuring the
-shell code such that it could be "rebooted" without restarting the
-JS app would require some invasive changes which are not currently
-on any TODO list but have not been entirely ruled out long-term.
-
-
[emscripten]: https://emscripten.org
[althttpd]: https://sqlite.org/althttpd
-C More\sstyling\sof\smodule-symbols.html.
-D 2022-10-29T10:14:56.834
+C Update\sext/wasm/README.md\sfor\srecent\sdevelopments.
+D 2022-10-29T12:31:50.367
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
F ext/wasm/EXPORTED_FUNCTIONS.fiddle.in 27450c8b8c70875a260aca55435ec927068b34cef801a96205adb81bdcefc65c
F ext/wasm/GNUmakefile 94b55d2dea0eb16f82a2691bceeed265273c7fbb61a6063abfbc1efdf70aeb9c
F ext/wasm/README-dist.txt 2d670b426fc7c613b90a7d2f2b05b433088fe65181abead970980f0a4a75ea20
-F ext/wasm/README.md 1e5b28158b74ab3ffc9d54fcbc020f0bbeb82c2ff8bbd904214c86c70e8a3066
+F ext/wasm/README.md ef39861aa21632fdbca0bdd469f78f0096f6449a720f3f39642594af503030e9
F ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-api 9120c2f8f51fa85f46dcf4dcb6b12f4a807d428f6089b99cdb08d8ddfcfd88b2
F ext/wasm/api/EXPORTED_RUNTIME_METHODS.sqlite3-api 1ec3c73e7d66e95529c3c64ac3de2470b0e9e7fbf7a5b41261c367cf4f1b7287
F ext/wasm/api/README.md 1350088aee90e959ad9a94fab1bb6bcb5e99d4d27f976db389050f54f2640c78
F ext/wasm/index.html ce6a68a75532b47e3c0adb83381a06d15de8c0ac0331fb7bf31d33f8e7c77dc4
F ext/wasm/jaccwabyt/jaccwabyt.js 0d7f32817456a0f3937fcfd934afeb32154ca33580ab264dab6c285e6dbbd215
F ext/wasm/jaccwabyt/jaccwabyt.md 9aa6951b529a8b29f578ec8f0355713c39584c92cf1708f63ba0cf917cb5b68e
-F ext/wasm/module-symbols.html ee4061a4a68e789a4a9403bc7e745f027d4789a8577e94f9d9d7a4ab9b616ed8
+F ext/wasm/module-symbols.html eca884ef4380612145ee550213be57478ee2b9cd9a9c2b27530cc23359c99682
F ext/wasm/scratchpad-wasmfs-main.html 20cf6f1a8f368e70d01e8c17200e3eaa90f1c8e1029186d836d14b83845fbe06
F ext/wasm/scratchpad-wasmfs-main.js 4c140457f4d6da9d646a49addd91edb6e9ad1643c6c48e3258b5bce24725dc18
F ext/wasm/speedtest1-wasmfs.html bc28eb29b69a73864b8d7aae428448f8b7e1de81d8bfb9bba99541322054dbd0
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 362ec11ec09f441b745cbd8ac8366b6bc998aba6e2b70782a88f189a3ffa9923
-R b91e2c9b4a071a7a86b2de4a121116c1
+P a36f42a8364b745c410a6f837d005a193f6a93134cac087ac18bee2897cad730
+R 7905691af970d052de1153df66321807
U stephan
-Z 1ad6c02cb88f8b4d1e237d5aecb20d32
+Z f92abe7cb111b048f2eaf4abd561cacb
# Remove this line to create a well-formed Fossil manifest.