-
-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
48f9424
commit 59fe22e
Showing
3 changed files
with
24 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,24 @@ | ||
# `trustfall_wasm_web` — browser-based demo of using `trustfall_wasm` | ||
# `trustfall_wasm_www` — browser-based demo of using `trustfall_wasm` | ||
|
||
A demo web site using the `trustfall_wasm` package with webpack. | ||
It initializes the WASM module, sets up a query adapter, runs a query, | ||
and prints the results to `console.log()`. | ||
|
||
See the schema and query adapter used in this demo in the included `index.js` | ||
[file](https://github.com/obi1kenobi/trustfall/tree/main/trustfall_wasm/www/index.js) | ||
|
||
## Building and running `trustfall_wasm_www` | ||
|
||
Prerequisites: | ||
- a recent Rust environment: [installation instructions](https://www.rust-lang.org/tools/install) | ||
- the `wasm-pack` tool: [installation instructions](https://rustwasm.github.io/wasm-pack/installer/) | ||
- Node v16+ or newer: [installation instructions](https://nodejs.org/en/download/) | ||
|
||
First, build `trustfall_wasm` by following the steps in the `trustfall_wasm` | ||
[README.md](https://github.com/obi1kenobi/trustfall/tree/main/trustfall_wasm/README.md). | ||
When this process is complete, you should have a `trustfall_wasm/pkg/` directory in the repo | ||
containing the `trustfall_wasm` WASM module and supporting files. | ||
|
||
Then, run `npm install` to install the dependencies for building and running the web server. | ||
Finally, run `npm start` to start the webpack dev server and open a browser tab with | ||
the `trustfall_wasm_www` demo website. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters