Repository navigation
Conversation
Script pages can now decode Plutus scripts in the browser: searchable, highlighted UPLC, the builtins used (click to find them), size, term count, parameters applied and a hash check. - julc is not built here: scripts/fetch-julc.mjs downloads the release pinned in julc.lock.json, checks its SHA-256 and unpacks plain files into static/julc/ (git-ignored). It runs before dev (optional) and build (required unless JULC_SKIP=1; JULC_ARCHIVE installs from a local copy), so Docker, Earthly and npm builds all include it. - $lib/julc/engine: lazy, shared worker client. Nothing loads until the user decodes (or opts in to always decoding); WasmGC and exnref are checked first, so older browsers get a message instead of a 5.5 MB download that can't run. - CodeView: virtualised, so 20k-line scripts stay fast; search with match navigation, wrap, copy, download. - Tests: untar safety and highlighting (vitest); tests/script-lab.spec.ts (needs SCRIPT_LAB_HASH and PW_CHANNEL=chrome, as Playwright's bundled Chromium lacks exnref). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Initial automated review · Aster Hi @satran004, thanks for the PR! 🙏 This is an automatic first check by an AI reviewer. It does not replace maintainer review and may be wrong. Reviewed commit: Issues found:
Not tested: Build, unit tests and browser flows were not run; GitHub reported no CI checks or status results for this commit. |
55 of 72 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #204 (Yaci Viewer redesign). Part of #207. This is PR 1 of the Script Lab series, which uses the julc WebAssembly engine to inspect, re-run and debug Plutus scripts in the browser.
What users get
A script page now has a Code panel with two tabs, UPLC and CBOR. "Decode script" runs julc in the browser and shows:
.uplc)Options:
?view=cborlinks straight to the raw CBOR.There is no decompiled-Java view on purpose: julc's decompiler output isn't idiomatic Java.
How julc is included (never built here)
julc.lock.jsonpins the release (v0.1.0-pre18,julc-wasmfull engine) and its SHA-256.scripts/fetch-julc.mjsruns beforedevandbuild:static/julc/(git-ignored), with no path traversal, links or.d.tsfiles.JULC_SKIP=1builds without Script Lab (the panel says it isn't installed).JULC_ARCHIVE=<file>installs from a local copy, still checked.npm run build. I checked the Docker build: it downloads the engine and serves it compressed with brotli.Runtime
PUBLIC_JULC_BASE_URLcan point at an engine hosted elsewhere. A cross-origin worker is handled with a tiny shim.Tests
npm run check: 0 errors, 0 warnings. vitest: 32 passing (new: tar safety, UPLC highlighting).tests/script-lab.spec.ts: decode, hash verified, builtins, search and next match, virtualisation, CBOR tab. Run withSCRIPT_LAB_HASH=<hash> PW_CHANNEL=chrome npx playwright test script-lab.SCRIPT_LAB_HASH, because devnets usually have no Plutus scripts.JULC_SKIP, missing archive (--optionalcontinues), and a wrong archive rejected on checksum.Size note
build/grows by about 36 MB, because adapter-node also writes.brand.gzcopies of the engine, and the npm package includes it. The browser only downloads the brotli copy.Next PRs in the series: re-running transaction scripts, the debugger, and fork-a-transaction. Upstream asks: bloxbean/julc#244.
🤖 Generated with Claude Code