wasm-idle 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -5
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -0
- package/dist/playground/assetBridge.d.ts +6 -1
- package/dist/playground/assetBridge.js +77 -4
- package/dist/playground/assets.d.ts +9 -1
- package/dist/playground/assets.js +29 -5
- package/dist/playground/awk.js +1 -0
- package/dist/playground/bash.d.ts +1 -0
- package/dist/playground/bash.js +7 -1
- package/dist/playground/bqn.js +1 -0
- package/dist/playground/bqnPreflight.d.ts +2 -1
- package/dist/playground/bqnPreflight.js +1 -0
- package/dist/playground/c3.js +1 -0
- package/dist/playground/cachedClang.js +15 -8
- package/dist/playground/clang.d.ts +1 -0
- package/dist/playground/clang.js +8 -1
- package/dist/playground/clangAssetIntegrity.d.ts +6 -0
- package/dist/playground/clangAssetIntegrity.js +3 -2
- package/dist/playground/clojurescript.js +1 -0
- package/dist/playground/clojurescriptPreflight.d.ts +2 -1
- package/dist/playground/clojurescriptPreflight.js +1 -0
- package/dist/playground/elixir.js +4 -1
- package/dist/playground/forth.js +1 -0
- package/dist/playground/forthPreflight.d.ts +2 -1
- package/dist/playground/forthPreflight.js +1 -0
- package/dist/playground/fortran.js +7 -1
- package/dist/playground/haskell.js +4 -1
- package/dist/playground/haskellAssets.d.ts +2 -1
- package/dist/playground/haskellAssets.js +8 -8
- package/dist/playground/index.d.ts +1 -1
- package/dist/playground/index.js +2 -2
- package/dist/playground/j.js +1 -0
- package/dist/playground/jPreflight.d.ts +2 -1
- package/dist/playground/jPreflight.js +1 -0
- package/dist/playground/janet.js +1 -0
- package/dist/playground/java.js +20 -8
- package/dist/playground/julia.js +1 -0
- package/dist/playground/lfortranAssets.d.ts +2 -1
- package/dist/playground/lfortranAssets.js +1 -0
- package/dist/playground/lisp.js +4 -1
- package/dist/playground/lispAssets.d.ts +2 -1
- package/dist/playground/lispAssets.js +10 -0
- package/dist/playground/lldbManifest.d.ts +2 -2
- package/dist/playground/lldbManifest.js +17 -3
- package/dist/playground/lldbSession.d.ts +1 -0
- package/dist/playground/lldbSession.js +2 -1
- package/dist/playground/nim.js +1 -0
- package/dist/playground/ocaml.d.ts +1 -0
- package/dist/playground/ocaml.js +12 -1
- package/dist/playground/options.d.ts +2 -0
- package/dist/playground/pascal.js +1 -0
- package/dist/playground/perl.js +1 -0
- package/dist/playground/prolog.js +1 -0
- package/dist/playground/python.js +3 -1
- package/dist/playground/runtimeSession.d.ts +2 -1
- package/dist/playground/runtimeSession.js +2 -2
- package/dist/playground/rust.d.ts +1 -0
- package/dist/playground/rust.js +11 -1
- package/dist/playground/rustExecutableGraph.d.ts +1 -0
- package/dist/playground/rustExecutableGraph.js +1 -0
- package/dist/playground/staticRuntimePreflight.d.ts +2 -1
- package/dist/playground/staticRuntimePreflight.js +4 -2
- package/dist/playground/staticRuntimePreflightExecute.js +1 -0
- package/dist/playground/staticRuntimePreflightProtocol.d.ts +2 -1
- package/dist/playground/staticWorkerRuntime.d.ts +3 -1
- package/dist/playground/staticWorkerRuntime.js +44 -3
- package/dist/playground/tcl.js +1 -0
- package/dist/playground/tinygo.d.ts +2 -0
- package/dist/playground/tinygo.js +57 -3
- package/dist/playground/tinygoExecutableGraph.d.ts +4 -1
- package/dist/playground/tinygoExecutableGraph.js +59 -7
- package/dist/playground/typescript.js +4 -1
- package/dist/playground/wasmGoVersion.d.ts +1 -1
- package/dist/playground/wasmGoVersion.js +1 -1
- package/dist/playground/wasmOcamlVersion.d.ts +2 -2
- package/dist/playground/wasmOcamlVersion.js +1 -1
- package/dist/playground/wasmRustVersion.d.ts +90 -24
- package/dist/playground/wasmRustVersion.js +98 -23
- package/dist/playground/wasmTinyGoVersion.d.ts +40 -29
- package/dist/playground/wasmTinyGoVersion.js +43 -31
- package/dist/playground/worker/clang.js +1 -5
- package/dist/playground/worker/elixir.js +10 -8
- package/dist/playground/worker/fortran.js +4 -7
- package/dist/playground/worker/haskell.js +2 -0
- package/dist/playground/worker/lisp.js +2 -0
- package/dist/playground/worker/ocaml.js +13 -1
- package/dist/playground/worker/runtimeAssetFetch.d.ts +11 -1
- package/dist/playground/worker/runtimeAssetFetch.js +64 -1
- package/dist/playground/worker/rust.js +9 -2
- package/dist/playground/worker/staticRuntimePreflight.js +2 -0
- package/dist/playground/worker/typescript.js +4 -1
- package/dist/playground/worker/zig.js +7 -4
- package/dist/playground/zig.js +4 -1
- package/package.json +10 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConsoleStdout, Directory, Fd, File, OpenFile, PreopenDirectory, WASI, wasi } from '@bjorn3/browser_wasi_shim';
|
|
2
2
|
import { decompressGzip, untar } from '@wasm-idle/llvm-core';
|
|
3
|
-
import { verifyRuntimeAssetIntegrity } from '@wasm-idle/core';
|
|
3
|
+
import { configureRuntimeAssetCache, verifyRuntimeAssetIntegrity } from '@wasm-idle/core';
|
|
4
4
|
import { waitForBufferedStdin } from '../stdinBuffer';
|
|
5
5
|
import { snapshotZigExecutionAssetReceipts } from '../zigAssets';
|
|
6
6
|
import { fetchRuntimeAssetBytes, resolveRuntimeAssetUrl } from './runtimeAssetFetch';
|
|
@@ -138,10 +138,12 @@ function buildWorkspaceRoot(code, activePath, workspaceFiles) {
|
|
|
138
138
|
addFileToDirectory(root, entryPath, encoder.encode(code));
|
|
139
139
|
return { root, entryPath };
|
|
140
140
|
}
|
|
141
|
-
async function fetchBytes(url, asset, maxAssetBytes, progressStart, progressEnd) {
|
|
141
|
+
async function fetchBytes(url, asset, maxAssetBytes, progressStart, progressEnd, expected) {
|
|
142
142
|
const data = await fetchRuntimeAssetBytes({
|
|
143
143
|
url,
|
|
144
144
|
label: asset,
|
|
145
|
+
expected,
|
|
146
|
+
integrityContext: { asset, runtimeId: 'ZIG' },
|
|
145
147
|
maxAssetBytes,
|
|
146
148
|
onProgress: ({ loaded, total }) => {
|
|
147
149
|
if (total && total > 0) {
|
|
@@ -398,8 +400,8 @@ async function loadAssets(nextCompilerUrl, nextStdlibUrl, nextIntegrity, maxAsse
|
|
|
398
400
|
const pending = (async () => {
|
|
399
401
|
postProgress(5);
|
|
400
402
|
const [compilerBytes, stdlibBytes] = await Promise.all([
|
|
401
|
-
fetchBytes(nextCompilerUrl, 'zig_small.wasm', receipts['zig_small.wasm'].bytes, 5, 45),
|
|
402
|
-
fetchBytes(nextStdlibUrl, 'std.tar.gz', Math.max(receipts['std.tar.gz'].bytes, receipts['std.tar.gz'].uncompressedBytes || 0), 45, 70)
|
|
403
|
+
fetchBytes(nextCompilerUrl, 'zig_small.wasm', receipts['zig_small.wasm'].bytes, 5, 45, receipts['zig_small.wasm']),
|
|
404
|
+
fetchBytes(nextStdlibUrl, 'std.tar.gz', Math.max(receipts['std.tar.gz'].bytes, receipts['std.tar.gz'].uncompressedBytes || 0), 45, 70, receipts['std.tar.gz'])
|
|
403
405
|
]);
|
|
404
406
|
await verifyRuntimeAssetIntegrity({
|
|
405
407
|
asset: 'zig_small.wasm',
|
|
@@ -526,6 +528,7 @@ self.onmessage = async (event) => {
|
|
|
526
528
|
const { load, compilerUrl: nextCompilerUrl, stdlibUrl: nextStdlibUrl, integrity: nextIntegrity, maxAssetBytes: nextMaxAssetBytes, buffer, code, prepare, args = [], compileArgs = [], stdin, activePath = 'main.zig', workspaceFiles = [], targetTriple = 'wasm64-wasi', log } = event.data;
|
|
527
529
|
try {
|
|
528
530
|
if (load) {
|
|
531
|
+
configureRuntimeAssetCache(event.data.persistentCache ?? {});
|
|
529
532
|
if (log) {
|
|
530
533
|
console.log(`[wasm-idle:zig-worker] load compilerUrl=${nextCompilerUrl} stdlibUrl=${nextStdlibUrl}`);
|
|
531
534
|
}
|
package/dist/playground/zig.js
CHANGED
|
@@ -2,7 +2,7 @@ import { resolveSandboxExecutionArgs } from './options';
|
|
|
2
2
|
import { resolveZigCompilerUrl, resolveZigStdlibUrl } from './assets';
|
|
3
3
|
import { snapshotZigExecutionAssetReceipts } from './zigAssets';
|
|
4
4
|
import { WASM_ZIG_ASSET_RECEIPTS } from './wasmZigVersion';
|
|
5
|
-
import { BusyError, CancelledError, DEFAULT_WORKSPACE_LIMITS, DiagnosticLimitError, OutputLimitError, RuntimeConfigurationError, TimeoutError, resolveExecutionLimits, validateExecutionWorkspace } from '@wasm-idle/core';
|
|
5
|
+
import { BusyError, CancelledError, DEFAULT_WORKSPACE_LIMITS, DiagnosticLimitError, OutputLimitError, RuntimeConfigurationError, TimeoutError, resolveExecutionLimits, resolveRuntimeAssetCacheOptions, validateExecutionWorkspace } from '@wasm-idle/core';
|
|
6
6
|
import { flushBufferedEof, flushQueuedStdin, resetBufferedStdin } from './stdinBuffer';
|
|
7
7
|
import { createWasmIdleSharedBuffer } from './sharedBuffer';
|
|
8
8
|
import { WorkerSession } from './workerSession';
|
|
@@ -370,6 +370,9 @@ class Zig {
|
|
|
370
370
|
worker.onmessage = handler;
|
|
371
371
|
worker.postMessage({
|
|
372
372
|
load: true,
|
|
373
|
+
persistentCache: resolveRuntimeAssetCacheOptions(typeof runtimeAssets === 'object'
|
|
374
|
+
? runtimeAssets?.persistentCache
|
|
375
|
+
: undefined, options.persistentCache),
|
|
373
376
|
compilerUrl: nextCompilerUrl,
|
|
374
377
|
stdlibUrl: nextStdlibUrl,
|
|
375
378
|
integrity: nextIntegrity,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wasm-idle",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "A simple web app to run code in the browser",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -61,15 +61,15 @@
|
|
|
61
61
|
"vitest": "^4.1.4",
|
|
62
62
|
"waforth": "0.20.1",
|
|
63
63
|
"webr": "0.6.0",
|
|
64
|
-
"@wasm-idle/
|
|
65
|
-
"@wasm-idle/
|
|
66
|
-
"@wasm-idle/
|
|
64
|
+
"@wasm-idle/debug": "1.0.8",
|
|
65
|
+
"@wasm-idle/lsp": "1.0.8",
|
|
66
|
+
"@wasm-idle/terminal": "1.0.8"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"@bjorn3/browser_wasi_shim": "^0.4.2",
|
|
70
70
|
"fflate": "0.8.3",
|
|
71
|
-
"@wasm-idle/core": "1.0.
|
|
72
|
-
"@wasm-idle/llvm-core": "1.0.
|
|
71
|
+
"@wasm-idle/core": "1.0.8",
|
|
72
|
+
"@wasm-idle/llvm-core": "1.0.8"
|
|
73
73
|
},
|
|
74
74
|
"files": [
|
|
75
75
|
"dist",
|
|
@@ -190,8 +190,11 @@
|
|
|
190
190
|
"sync:webr": "node scripts/sync-runtime.mjs webr",
|
|
191
191
|
"compress:static-runtimes": "node scripts/compress-static-runtime-assets.mjs static",
|
|
192
192
|
"compress:build-runtimes": "node scripts/compress-static-runtime-assets.mjs build",
|
|
193
|
+
"compact:build-runtimes": "node scripts/compact-runtime-aliases.mjs build",
|
|
193
194
|
"layer:static-runtimes": "node scripts/build-layered-runtime-assets.mjs static",
|
|
194
195
|
"asset:sizes": "node scripts/static-asset-sizes.mjs report",
|
|
196
|
+
"assets:lock": "node scripts/generate-runtime-asset-lock.mjs",
|
|
197
|
+
"check:assets-lock": "node scripts/generate-runtime-asset-lock.mjs --check",
|
|
195
198
|
"check:asset-sizes": "node scripts/static-asset-sizes.mjs check",
|
|
196
199
|
"build:page-runtimes": "node scripts/prepare-page-runtimes.mjs",
|
|
197
200
|
"verify:wasm-typescript-freshness": "pnpm --dir runtimes/wasm-typescript build && node scripts/sync-wasm-typescript.mjs --verify",
|
|
@@ -201,7 +204,7 @@
|
|
|
201
204
|
"support:matrix": "node scripts/support-matrix.mjs write",
|
|
202
205
|
"check:support-matrix": "node scripts/support-matrix.mjs check",
|
|
203
206
|
"sync:page-runtimes": "pnpm run sync:pyodide && pnpm run sync:webr && pnpm run sync:wasm-of-js-of-ocaml && pnpm run sync:wasm-typescript && pnpm run sync:wasm-octave && pnpm run sync:wasm-prolog && pnpm run sync:wasm-gleam && pnpm run sync:wasm-perl && pnpm run sync:wasm-tcl && pnpm run sync:wasm-awk && pnpm run sync:wasm-pascal && pnpm run sync:wasm-forth && pnpm run sync:wasm-j && pnpm run sync:wasm-bqn && pnpm run sync:wasm-janet && pnpm run sync:wasm-julia && pnpm run sync:wasm-nim && pnpm run sync:wasm-ruby && pnpm run sync:wasm-bash && pnpm run sync:wasm-clojurescript",
|
|
204
|
-
"page:build": "pnpm run verify:page-c3 && pnpm run verify:page-lfortran && pnpm run prepare:test-assets -- clang && pnpm run build:page-runtimes && pnpm run sync:page-runtimes && pnpm run build:static-runtime-modules && pnpm run prepare:wasm-debug-release && pnpm run layer:static-runtimes && pnpm run compress:static-runtimes && pnpm run build && pnpm run compress:build-runtimes && pnpm run verify:page-c3 build && pnpm run verify:page-lfortran build",
|
|
207
|
+
"page:build": "pnpm run verify:page-c3 && pnpm run verify:page-lfortran && pnpm run prepare:test-assets -- clang && pnpm run build:page-runtimes && pnpm run sync:page-runtimes && pnpm run build:static-runtime-modules && pnpm run prepare:wasm-debug-release && pnpm run layer:static-runtimes && pnpm run compress:static-runtimes && pnpm run assets:lock && pnpm run check:assets-lock && pnpm run build && pnpm run compress:build-runtimes && pnpm run verify:page-c3 build && pnpm run verify:page-lfortran build",
|
|
205
208
|
"package:root": "svelte-kit sync && node scripts/clean-package-output.mjs && svelte-package --tsconfig ./tsconfig.package.json && publint",
|
|
206
209
|
"package": "pnpm run build:publish-deps && pnpm run package:root",
|
|
207
210
|
"verify:package": "node scripts/verify-package.mjs",
|