Skip to content

Commit 886c390

Browse files
committed
clarify wasm
1 parent 2fe8ac6 commit 886c390

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

website/content/docs/guides/editor-setup.mdx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,14 @@ new EditorView({
2323

2424
## Full support (diagnostics + autocomplete + hover)
2525

26-
Requires WASM files — build or download from a release.
26+
Requires WASM files served from your app. The easiest way is to grab them from the `@gnata-sqlite/react` package:
27+
28+
```bash
29+
npm install @gnata-sqlite/react
30+
npx @gnata-sqlite/react setup ./public
31+
```
32+
33+
This copies `gnata-lsp.wasm` and `lsp-wasm_exec.js` into your public directory. Then:
2734

2835
```typescript
2936
import { EditorView, basicSetup } from "codemirror"
@@ -37,11 +44,7 @@ new EditorView({
3744
})
3845
```
3946

40-
## Build the WASM files
41-
42-
```bash
43-
make wasm
44-
```
47+
Alternatively, build from source with `make wasm` (requires [TinyGo](https://tinygo.org/getting-started/install/)).
4548

4649
## Tooltip styling
4750

website/content/docs/tutorials/editor-playground.mdx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ The WASM module is 380 KB (145 KB gzipped).
1818

1919
- **Node.js 18+** and a package manager
2020
- A frontend project that can import ES modules
21-
- For full features: `gnata-lsp.wasm` and `lsp-wasm_exec.js` (covered in Step 3)
2221

2322
## Step 1 — Install
2423

@@ -46,12 +45,11 @@ Type `Account.Order.Product.Price` — tokens highlight immediately.
4645

4746
## Step 3 — Full setup with WASM LSP
4847

49-
Place the WASM files where the app can serve them (e.g. `public/` in Vite):
48+
The WASM files are bundled with `@gnata-sqlite/react`. Copy them into your public directory:
5049

51-
```
52-
public/
53-
gnata-lsp.wasm
54-
lsp-wasm_exec.js
50+
```bash
51+
npm install @gnata-sqlite/react
52+
npx @gnata-sqlite/react setup ./public
5553
```
5654

5755
Use `jsonataFull` instead of `jsonata`:
@@ -106,15 +104,15 @@ new EditorView({
106104

107105
Type `Account.` → suggests `Name`, `Order`. Type `Account.Order.Product.` → suggests `Price`, `Quantity`.
108106

109-
## Step 5 — Build WASM from source
107+
## Step 5 — Build WASM from source (optional)
110108

111-
Requires [TinyGo](https://tinygo.org/getting-started/install/). See [Why TinyGo?](/docs/explanation/tinygo-wasm) for background.
109+
If you need to build from source instead of using the bundled files, install [TinyGo](https://tinygo.org/getting-started/install/) and run:
112110

113111
```bash
114112
make wasm
115113
```
116114

117-
Produces `gnata-lsp.wasm` (~380 KB, 145 KB gzipped) and `lsp-wasm_exec.js`. Copy both to the static assets directory.
115+
See [Why TinyGo?](/docs/explanation/tinygo-wasm) for background on the build pipeline.
118116

119117
## Try it live
120118

0 commit comments

Comments
 (0)