From 6758f70ac2818031df9b8f350cb777accdac3ce5 Mon Sep 17 00:00:00 2001 From: Techatrix Date: Mon, 8 Dec 2025 05:06:24 +0100 Subject: [PATCH 1/4] update ZLS to 0.15.1 --- build.zig.zon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.zig.zon b/build.zig.zon index 579d11a..7fde44c 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -5,8 +5,8 @@ .minimum_zig_version = "0.15.1", .dependencies = .{ .zls = .{ - .url = "git+https://github.com/zigtools/zls?ref=0.15.0#ce6c8f02c78e622421cfc2405c67c5222819ec03", - .hash = "zls-0.15.0-rmm5fkjqIwDZpmDHyKwxa9K2gcI3FPaGVFPwjYWFBM5B", + .url = "git+https://github.com/zigtools/zls?ref=0.15.1#f91b2e1e305e5d5bd3725aea90f9f9bfb3dce055", + .hash = "zls-0.15.1-rmm5fgQ2JADjDh84Ja3pDBZ1io_kKdHS2YhQyvBYz66r", }, .zig = .{ .url = "git+https://github.com/zigtools/zig?ref=wasm32-wasi#3ee3d1aaf1db2e0501cd5372b68408be0c4c2133", From 0f343fce843138b6063a8a4e686110d22994a734 Mon Sep 17 00:00:00 2001 From: Techatrix Date: Mon, 8 Dec 2025 05:21:15 +0100 Subject: [PATCH 2/4] update Zig to 0.15.2 --- build.zig.zon | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.zig.zon b/build.zig.zon index 7fde44c..59181e0 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -2,15 +2,15 @@ .name = .playground, .version = "0.0.0", .fingerprint = 0xdc188848360fd988, // Changing this has security and trust implications. - .minimum_zig_version = "0.15.1", + .minimum_zig_version = "0.15.2", .dependencies = .{ .zls = .{ .url = "git+https://github.com/zigtools/zls?ref=0.15.1#f91b2e1e305e5d5bd3725aea90f9f9bfb3dce055", .hash = "zls-0.15.1-rmm5fgQ2JADjDh84Ja3pDBZ1io_kKdHS2YhQyvBYz66r", }, .zig = .{ - .url = "git+https://github.com/zigtools/zig?ref=wasm32-wasi#3ee3d1aaf1db2e0501cd5372b68408be0c4c2133", - .hash = "zig-0.0.0-Fp4XJA38IQ3PPwA7sizQuTm_Ru1bH1ok-Yo6LH5a-F-B", + .url = "git+https://github.com/zigtools/zig?ref=wasm32-wasi#e123e17142e0576498ba7f14971e24565c242bd4", + .hash = "zig-0.0.0-Fp4XJMPnIg0zUDsFeLUD3kzBiBYbT_YSvJZo0pVB3tnR", }, }, .paths = .{""}, From 7db2635e3f87d826c15735ddd806aa016c22e995 Mon Sep 17 00:00:00 2001 From: Techatrix Date: Mon, 8 Dec 2025 05:13:55 +0100 Subject: [PATCH 3/4] unpin mlugg/setup-zig --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 831f55c..88a678a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -22,7 +22,7 @@ jobs: with: node-version: 22 - - uses: mlugg/setup-zig@v2.0.5 + - uses: mlugg/setup-zig@v2 - name: Install binaryen run: | From b1a932f07ad8bac2d9152fc648e17e77c55d917f Mon Sep 17 00:00:00 2001 From: Techatrix Date: Mon, 8 Dec 2025 05:11:21 +0100 Subject: [PATCH 4/4] download static assets using import.meta.url --- src/utils.ts | 7 ++----- src/workers/zig.ts | 4 +--- src/workers/zls.ts | 4 +--- vite.config.js | 1 - 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 29348c5..f714c53 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,12 +1,9 @@ -// @ts-ignore -import zigTarGz from "../zig-out/zig.tar.gz?inline"; import { untar } from "@andrewbranch/untar.js"; import { Directory, File, ConsoleStdout, wasi as wasi_defs } from "@bjorn3/browser_wasi_shim"; export async function getLatestZigArchive() { - const ds = new DecompressionStream("gzip"); - const zigTarResponse = new Response((await fetch(zigTarGz)).body?.pipeThrough(ds)); - const entries = await untar(await zigTarResponse.arrayBuffer()); + const zigTarResponse = await fetch(new URL("../zig-out/zig.tar.gz", import.meta.url)); + const entries = untar(await zigTarResponse.arrayBuffer()); let root: TreeNode = new Map(); diff --git a/src/workers/zig.ts b/src/workers/zig.ts index f4905c4..58efb0f 100644 --- a/src/workers/zig.ts +++ b/src/workers/zig.ts @@ -1,7 +1,5 @@ import { WASI, PreopenDirectory, Fd, File, OpenFile, Inode } from "@bjorn3/browser_wasi_shim"; import { getLatestZigArchive, stderrOutput } from "../utils"; -// @ts-ignore -import zigWasm from "../../zig-out/bin/zig.wasm?url"; let currentlyRunning = false; async function run(source: string) { @@ -36,7 +34,7 @@ async function run(source: string) { ] satisfies Fd[]; let wasi = new WASI(args, env, fds, { debug: false }); - const { instance } = await WebAssembly.instantiateStreaming(fetch(zigWasm), { + const { instance } = await WebAssembly.instantiateStreaming(fetch(new URL("../../zig-out/bin/zig.wasm", import.meta.url)), { "wasi_snapshot_preview1": wasi.wasiImport, }); diff --git a/src/workers/zls.ts b/src/workers/zls.ts index 3d8a12f..7a6bcc5 100644 --- a/src/workers/zls.ts +++ b/src/workers/zls.ts @@ -1,7 +1,5 @@ import { WASI, PreopenDirectory, Fd, ConsoleStdout } from "@bjorn3/browser_wasi_shim"; import { getLatestZigArchive } from "../utils"; -// @ts-ignore -import zlsWasm from "../../zig-out/bin/zls.wasm?url"; class Stdio extends Fd { constructor() { @@ -58,7 +56,7 @@ onmessage = (event) => { ]; let wasi = new WASI(args, env, fds, { debug: false }); - const { instance: localInstance } = await WebAssembly.instantiateStreaming(fetch(zlsWasm), { + const { instance: localInstance } = await WebAssembly.instantiateStreaming(fetch(new URL("../../zig-out/bin/zls.wasm", import.meta.url)), { "wasi_snapshot_preview1": wasi.wasiImport, }); diff --git a/vite.config.js b/vite.config.js index cd9eb04..aca9f77 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,5 +1,4 @@ import { defineConfig } from "vite"; export default defineConfig({ - assetsInclude: ['**/*.tar.gz'], plugins: [], }); \ No newline at end of file