Skip to content

Add an IR view to the playground and feature the open beta in the README - #5

Merged
be-thomas merged 4 commits into
mainfrom
feat/playground-ir
Oct 26, 2026
Merged

be-thomas merged 4 commits into
mainfrom
feat/playground-ir

Conversation

@be-thomas

Copy link
Copy Markdown
Owner

Summary

  • Expose openiacIR(source) from the WebAssembly module: it parses with engine.ParseSource and marshals with engine.MarshalIR, so the browser shows exactly the JSON IR that openiac ir prints.
  • Add an IR toggle to the playground output pane. It is hidden by default; pressing it swaps the pane to read-only JSON, renames the file to ir.json, switches the editor language, and makes Copy/download follow the active view. Pressing it again, or choosing AWS CDK / Pulumi, returns to the generated TypeScript.
  • Point the README at the new domain openiac.codewithzeal.com, add a screenshot of the playground at the top with an open-beta call to action, and document the new export in the architecture notes.

Testing

  • node --check playground/app.js; gofmt -l ., go vet ./..., go test ./...
  • make wasm, make build, make conformance-status-check
  • WASM export exercised in Node: schema 0.2, expected resource IDs, parse errors surface as ok: false
  • Headless Chrome against a local server: pressing IR renders ir.json with "Generated the universal IR. · schema 0.2"; pressing it again restores index.ts with "Converted to AWS CDK."

Notes

The screenshot is captured from this branch's build, so the live Worker shows the IR button once the playground is deployed with make wasm && cd deploy/cloudflare && wrangler deploy.

Expose `openiacIR` from the WebAssembly module so the browser renders the same
JSON IR that `openiac ir` prints. The output pane gains an IR toggle that is
off by default: pressing it switches the pane to read-only JSON, retitles the
file to ir.json and makes copy and download follow the active view; pressing
it again, or picking a target, returns to the generated TypeScript.

Point the README at openiac.codewithzeal.com with a screenshot of the live
playground and an open-beta call to action, and document the new export in the
architecture notes.
The IR view was reachable only through a muted icon button that read like
the Copy and download buttons next to it. Give it the accent treatment
instead: a tinted pill carrying the { } glyph and a View IR / Hide IR
label, a soft glow while the TypeScript view is showing, and a solid
gradient with dark text while the IR is active.

The label collapses to the glyph below 640px so the pane header stays on
one line, and the glow is dropped under prefers-reduced-motion. The
README screenshot is regenerated with the new control.
The screenshot links to the live playground, but the only hint was a
caption that read like a label. Keep the image link, move the privacy
line into its own caption, and put a bold "Click here to get open beta
access" link under the image so the way in is visible without guessing.
Comment thread playground/app.js Resolved
Comment thread wasm/main.go Resolved
The IR response dropped the data-source count that Graph.Stats returns,
so the status line under-reported the document the pane was showing.
Report it, and render it in both views through one stats helper so the
numbers always describe the same graph.

Booting now refuses a WebAssembly bundle that lacks the openiacIR export
instead of letting the IR toggle relabel the pane while the editor still
holds TypeScript. The check runs as soon as the runtime is up, so a
stale cached main.wasm names the cause immediately.
@be-thomas
be-thomas merged commit 773cc1f into main Oct 26, 2026
1 check passed
@be-thomas
be-thomas deleted the feat/playground-ir branch October 26, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant