docs: merge the Compact JavaScript guides into one verified assembly - #1181
docs: merge the Compact JavaScript guides into one verified assembly#1181oduameh wants to merge 2 commits into
Conversation
Fold use-compact-javascript-implementation.mdx into compact-javascript-runtime.mdx as a modular assembly. Every generated-code excerpt is pasted from a fresh Compact 0.31.1 compile of the example-bboard contract (fixing the stale 0.15.0 runtime version and descriptor numbering), and the unit-test examples are rewritten against the real compact-runtime 0.16.0 context API because the previous hand-built context objects cannot run. All three Verification test files execute (10 tests passing). Redirect added for the retired slug; navbar Compact-logo route list updated.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary
Errors per inputErrors in docs/guides/compact-javascript-runtime.mdx
Redirects per inputRedirects in docs/guides/compact-javascript-runtime.mdx |
|
Verification evidence for this slice. SME review (mechanical diff of every excerpt against a fresh Compact 0.31.1 compile of example-bboard, tsc pass on the witnesses snippet, runtime API probes): approve with corrections, all applied; the two corrections are the pure-circuit wording and the contract/ output path now in the PR description. Fact-check across the page's ~110 claims: 2 refuted claims corrected pre-ship, 0 shipped. QE gate: PASS on every gate after a from-scratch rebuild; the three published Vitest files are byte-identical to the executed workspace files (10/10 passing, offline), the retired slug has zero references in source and build output, and a first-match simulation over all 299 redirect rules confirms the new redirect is direct with no chain. Pre-existing broken links on unchanged pages (counter-tutorial link in compact/test-and-debug, a wrong-depth link in examples/dapps/bboard) are recorded in the QE report and untouched here. |
|
Closing for now: we are taking a broader look at the guides section to shape assemblies around user journeys before landing individual merges. Branch retained; the verified content and fixtures will feed the next iteration. |
Intent
Slice 1 of the guides consolidation: merge the two Compact JavaScript pages, which already declared themselves halves of one document, into a single modular assembly at the existing
/guides/compact-javascript-runtimeURL. One page deletion, one redirect, no other guide touched. Subsequent slices (funding, deploy/operate, wallet connect) will follow as separate PRs once this shape is agreed./guides/use-compact-javascript-implementation/guides/compact-javascript-runtime(direct, no chain; the retired page had zero inbound doc links)What changed
docs/guides/compact-javascript-runtime.mdxbecomes the assembly: three explanatory sections (compilation pipeline, generated module structure, the Contract class and circuits), a generated-export reference table, and three procedures (importing and implementing witnesses, calling circuits, unit testing), each ending in a Vitest verification that was actually executed.docs/guides/use-compact-javascript-implementation.mdxdeleted; its content lives in the procedures, and its "why this matters" section is condensed into the lead.src/theme/Navbar/Logo/index.tsx: the retired route is removed from the Compact-logo route list.vercel.json: the redirect above.Why the content changed, not just moved
Every generated-code excerpt is now pasted from a fresh compile of the example-bboard contract (Compact compiler 0.31.1, runtime 0.16.0), which surfaced real staleness in the old pages:
checkRuntimeVersion('0.15.0'); the compiler emits0.16.0, matching the support matrix. Executed evidence: mismatch throwsVersion mismatch: compiled code expects 0.15.0, runtime is 0.16.0.CircuitContext(originalState/transactionContext: {}); the generated wrappers validate forcurrentQueryContextand reject such objects, so those examples could never run. The procedures now use the realcreateConstructorContext/createCircuitContextAPI.Compiling 2 circuits:for a contract exporting three). Reworded.Verification
Flag for Compact codeowners (not fixable in this repo's docs PR)
docs/compact/test-and-debug.mdxcarries the same broken testing pattern this PR removes: hand-built contexts,result.newLedgerState/newContextresult fields that do not exist, and an assert message ("Board is occupied") that does not match the contract ("Attempted to post to an occupied board"). That file is owned by mn-codeowners-compact; happy to open an upstream issue.