@@ -4,7 +4,7 @@ CodeMirror 6 language support and LSP server for JSONata, powered by gnata's par
44
55Two delivery modes from the same codebase:
66
7- - ** Browser** — TinyGo WASM module (182 KB) for CodeMirror diagnostics and autocomplete
7+ - ** Browser** — TinyGo WASM module (126 KB) for CodeMirror diagnostics and autocomplete
88- ** Server** — Native Go LSP server (stdio JSON-RPC) for VS Code, Neovim, etc.
99
1010## Quick Start
@@ -15,7 +15,7 @@ Two delivery modes from the same codebase:
1515import { EditorView , basicSetup } from " codemirror"
1616import { jsonataFull , initWasm } from " @gnata-sqlite/codemirror"
1717
18- // Load the WASM module (182 KB, 85 KB gzipped).
18+ // Load the WASM module (126 KB, 61 KB gzipped).
1919await initWasm (" /gnata-lsp.wasm" , " /lsp-wasm_exec.js" )
2020
2121new EditorView ({
@@ -58,7 +58,7 @@ require("lspconfig").jsonata.setup({})
5858 +---------------------------+
5959 | Lezer Grammar | WASM |
6060 | (sync, every | (async, |
61- | keystroke) | 182 KB) |
61+ | keystroke) | 126 KB) |
6262 | | |
6363 | Highlighting | Diags |
6464 | Brackets | Compl. |
@@ -224,16 +224,17 @@ Diagnostics are pushed as `textDocument/publishDiagnostics` notifications.
224224### WASM Module
225225
226226``` bash
227- GOOS=js GOARCH=wasm tinygo build \
227+ tinygo build \
228228 -o gnata-lsp.wasm -no-debug \
229- -gc=conservative \
230- ./editor/
229+ -gc=conservative -scheduler=none -panic=trap \
230+ -target wasm ./editor/
231+ wasm-opt -Oz --enable-bulk-memory gnata-lsp.wasm -o gnata-lsp.wasm
231232
232233# Copy TinyGo's WASM support file.
233234cp " $( tinygo env TINYGOROOT) /targets/wasm_exec.js" lsp-wasm_exec.js
234235```
235236
236- Output: ` gnata-lsp.wasm ` (182 KB raw, 85 KB gzipped)
237+ Output: ` gnata-lsp.wasm ` (126 KB raw, 61 KB gzipped)
237238
238239### Native LSP Server
239240
0 commit comments