Skip to content

Commit d88a939

Browse files
committed
Use newer Javy and omit source code from wasm
Javy v1.2.0 is a couple of years old. The current version is v7.0.1. Besides being newer it also builds smaller WASM files (1/10 in size). Version 7.0.1 also has feature for omitting the JS source from the WASM file. When used it produces even smaller WASM files. ```console $ ./javy-x86_64-linux-v1.2.0 compile out.js -o plugin-1.2.0.wasm $ ./javy-x86_64-linux-v7.0.1 build out.js -o plugin-7.0.1.wasm $ ./javy-x86_64-linux-v7.0.1 build out.js --codegen source=omitted -o plugin-7.0.1-omit-source.wasm $ ls -lh *.wasm -rw-rw-r-- 1 arne arne 70M okt 21 07:28 plugin-1.2.0.wasm -rw-rw-r-- 1 arne arne 7,3M okt 21 07:28 plugin-7.0.1.wasm -rw-rw-r-- 1 arne arne 6,4M okt 21 07:28 plugin-7.0.1-omit-source.wasm ```
1 parent 395a0ba commit d88a939

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ jobs:
1313
with:
1414
sqlc-version: '1.24.0'
1515
- uses: actions/setup-node@v4
16-
- run: wget https://github.com/bytecodealliance/javy/releases/download/v1.2.0/javy-x86_64-linux-v1.2.0.gz
17-
- run: gzip -d javy-x86_64-linux-v1.2.0.gz
18-
- run: chmod +x javy-x86_64-linux-v1.2.0
16+
- run: wget https://github.com/bytecodealliance/javy/releases/download/v7.0.1/javy-x86_64-linux-v7.0.1.gz
17+
- run: gzip -d javy-x86_64-linux-v7.0.1.gz
18+
- run: chmod +x javy-x86_64-linux-v7.0.1
1919
- run: npm install
2020
- run: npx tsc --noEmit
2121
- run: npx esbuild --bundle src/app.ts --tree-shaking=true --format=esm --target=es2020 --outfile=out.js
22-
- run: ./javy-x86_64-linux-v1.2.0 compile out.js -o examples/plugin.wasm
22+
- run: ./javy-x86_64-linux-v7.0.1 compile out.js -o examples/plugin.wasm
2323
- run: sqlc -f sqlc.dev.yaml diff
2424
working-directory: examples

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
generate: examples/plugin.wasm examples/sqlc.dev.yaml
44
cd examples && sqlc-dev -f sqlc.dev.yaml generate
55

6-
# https://github.com/bytecodealliance/javy/releases/tag/v1.2.0
6+
# https://github.com/bytecodealliance/javy/releases/tag/v7.0.1
77
examples/plugin.wasm: out.js
8-
./javy compile out.js -o examples/plugin.wasm
8+
./javy build out.js --codegen source=omitted -o examples/plugin.wasm
99

1010
out.js: src/app.ts $(wildcard src/drivers/*.ts) src/gen/plugin/codegen_pb.ts
1111
npx tsc --noEmit

0 commit comments

Comments
 (0)