Skip to content

feat: integrate playground into workspace - #160

Merged
hongjr03 merged 3 commits into
masterfrom
feat/embed-vizsla-playground
May 26, 2026
Merged

feat: integrate playground into workspace#160
hongjr03 merged 3 commits into
masterfrom
feat/embed-vizsla-playground

Conversation

@hongjr03

Copy link
Copy Markdown
Member

Summary

This change brings the playground into the Vizsla repository as first-class workspace code instead of maintaining a separate patched consumer. The Rust WASM entry point now lives under crates/vizsla-lsp-wasm, the frontend lives under playground, and the docs site imports the playground package directly instead of committing generated docs/public/vizsla-lab assets.

Playground Architecture

flowchart LR
    subgraph Browser[Browser runtime]
        Component["<vizsla-lab> web component"]
        Monaco["Monaco editor + scenarios"]
        Client["Browser LSP client"]
        Worker["vizsla-lsp.worker"]
    end

    subgraph Wasm[WASM package]
        Adapter["JS FFI adapter"]
        Ffi["C ABI exports"]
        Server["vizsla::browser::BrowserServer"]
    end

    subgraph Core[Core Vizsla crate]
        State["GlobalState + main-loop event drain"]
        Vfs["browser VFS notification bridge"]
        Analysis["existing config, resolver, diagnostics"]
    end

    Component --> Monaco
    Monaco --> Client
    Client <--> Worker
    Worker <--> Adapter
    Adapter <--> Ffi
    Ffi <--> Server
    Server <--> State
    State <--> Vfs
    State --> Analysis
Loading

The important boundary is that the WASM crate is now a thin FFI layer. It no longer path-includes private source files from the main crate; browser-specific LSP handling is exposed through vizsla::browser::BrowserServer, so the playground uses the same analysis code through a real crate API.

Other Changes

  • Move Emscripten setup into CI through a pinned local composite action, while local npm run build:wasm consumes an already activated SDK.
  • Remove the old standalone playground patch/vendor/version-lock machinery.
  • Wire the docs build to copy only generated WASM assets needed at build time.
  • Keep VS Code grammar and language configuration sourced from the repository instead of duplicated playground assets.

Validation

  • rustup run nightly cargo fmt --all -- --check
  • rustup run nightly cargo check -p vizsla-lsp-wasm
  • rustup run nightly cargo clippy -p vizsla -p vizsla-lsp-wasm --all-targets -- -D warnings
  • npm ci in playground
  • npm run build:wasm in playground
  • npm run build:embed in playground
  • npm run build in playground
  • npm ci in docs
  • npm run build in docs

@github-actions

Copy link
Copy Markdown

Docs preview: https://vide.pascal-lab.net/preview/pr-160/

@hongjr03
hongjr03 merged commit 26bf8f8 into master May 26, 2026
9 checks passed
@hongjr03
hongjr03 deleted the feat/embed-vizsla-playground branch May 26, 2026 15:42
hongjr03 added a commit to hongjr03/vide that referenced this pull request Aug 19, 2026
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