Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
93aa586
Remove stale wasm-qmd-parser crate and wasm-pack references
cderv Apr 13, 2026
a019c2a
Replace dtolnay/rust-toolchain action with rustup in all workflows
cderv Apr 13, 2026
f72002c
Add WASM testing and cleanup design spec
cderv Apr 3, 2026
f43c640
Address design review findings
cderv Apr 3, 2026
ac95e18
Use cargo xtask dev-setup for wasm-bindgen-cli version pinning
cderv Apr 3, 2026
f4f272d
Address second design review findings
cderv Apr 3, 2026
b9aa547
Add C toolchain prerequisite for WASM tests
cderv Apr 3, 2026
81676e9
Clarify WASM tests are Linux CI only, skip on Windows
cderv Apr 3, 2026
0281992
Remove stale wasm-qmd-parser crate and wasm-pack references
cderv Apr 7, 2026
9f248f7
Replace cfg test proxy with real WASM tests
cderv Apr 7, 2026
7780ee9
Document WASM testing convention and architecture
cderv Apr 7, 2026
9af9192
Add WASM test CI job and migrate wasm-bindgen-cli to dev-setup
cderv Apr 7, 2026
c1f943d
Address review findings: feature gate and docs accuracy
cderv Apr 7, 2026
d8ef5c9
Document why WASM tests need -fno-builtin
cderv Apr 9, 2026
11baa1e
Fix WASM sysroot path: use absolute paths for -isystem
cderv Apr 9, 2026
8346a5e
Skip dofile script-dir test on native, document finding
cderv Apr 9, 2026
b9de1a2
Gate wasm-incompatible dev-dependencies on not(wasm32)
cderv Apr 9, 2026
867232a
Update plan and design docs with CI fix findings
cderv Apr 9, 2026
31bc1b6
Revert ts-test-suite wasm-bindgen-cli install to match main
cderv Apr 9, 2026
2c9c2e6
Document wasm-bindgen-cli install revert in design spec
cderv Apr 9, 2026
eb95f3b
Fix WASM test CI: remove prebuilt target, gate bin targets
cderv Apr 10, 2026
587e6c8
Remove prebuilt wasm32 target before WASM tests
cderv Apr 10, 2026
c0e3443
Fix WASM test CI: use RUSTUP_TOOLCHAIN to bypass rust-toolchain.toml
cderv Apr 13, 2026
178db22
Fix WASM test compilation: async filters and panic_abort
cderv Apr 13, 2026
f54c18b
Fix WASM test: use FilterOutput struct fields instead of tuple destru…
cderv Apr 13, 2026
1424815
Update wasm.md: document RUSTUP_TOOLCHAIN approach for sysroot conflict
cderv Apr 13, 2026
91c958e
Update design spec and plan with CI fixes and wasm-c-shim
cderv Apr 13, 2026
01df02e
Extract C stdlib shims into shared wasm-c-shim crate
cderv Apr 13, 2026
068d36a
Fix wasm-c-shim edition: use 2021 for unsafe FFI shim code
cderv Apr 13, 2026
aad4210
Feature-gate wasm JS bridge to unblock pampa wasm tests
gordonwoodhull Apr 17, 2026
22ea6e4
Set panic=unwind + exception-handling for workspace wasm32 builds
gordonwoodhull Apr 17, 2026
e55f34f
Move LuaThrow marker into wasm-c-shim during rebase
gordonwoodhull Apr 17, 2026
240fee8
Update design spec and plan with CI fix findings
gordonwoodhull Apr 17, 2026
901f9f7
Document WASM testing convention and architecture
gordonwoodhull Apr 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,17 @@
# See crates/xtask/src/main.rs for available commands
xtask = "run --package xtask --"
dev-setup = "xtask dev-setup"

[target.wasm32-unknown-unknown]
runner = "wasm-bindgen-test-runner"
# Mirror the rustflags used by wasm-quarto-hub-client/.cargo/config.toml so any
# wasm32 build invoked from the workspace root (e.g. the pampa wasm_lua test)
# gets the same panic strategy and ABI. Without panic=unwind plus the
# exception-handling target feature, wasm-c-shim's catch_unwind-based
# replacement for Lua's setjmp/longjmp can't catch panics, and any Lua throw
# during mlua initialization aborts the wasm module.
rustflags = [
"-C", "target-feature=+bulk-memory,+exception-handling",
"-C", "panic=unwind",
"-Zwasm-c-abi=spec",
]
11 changes: 11 additions & 0 deletions .claude/rules/wasm.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,14 @@ Correct pattern:
#[cfg(not(target_arch = "wasm32"))]
// Native code (full Lua stdlib via Lua::new())
```

## Verify WASM tests when editing WASM code

When modifying any of these files, update `crates/pampa/tests/wasm_lua.rs`:
- `crates/pampa/src/lua/filter.rs` (cfg(target_arch = "wasm32") blocks)
- `crates/pampa/src/lua/shortcode.rs` (cfg(target_arch = "wasm32") blocks)
- `crates/pampa/src/lua/io_wasm.rs`
- `crates/pampa/src/lua/os_wasm.rs`

WASM tests can't run locally on Windows — they run in Linux CI.
See `dev-docs/wasm.md` for the local run command (Linux/macOS).
58 changes: 0 additions & 58 deletions .github/workflows/build-wasm.yml

This file was deleted.

11 changes: 3 additions & 8 deletions .github/workflows/hub-client-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,9 @@ jobs:
[ "$time" != "@0" ] && touch -d "$time" "$file" 2>/dev/null || true
done

# Rust toolchain for WASM build
- name: Set up Rust nightly
uses: dtolnay/rust-toolchain@nightly
with:
targets: wasm32-unknown-unknown
# Install toolchain from rust-toolchain.toml (nightly + components + targets)
- name: Set up Rust
run: rustup show active-toolchain

- name: Set up Clang
uses: egor-tensin/setup-clang@v2
Expand All @@ -48,9 +46,6 @@ jobs:
with:
cache-on-failure: true

- name: Install wasm-pack
run: cargo install wasm-pack

# tree-sitter for grammar builds
- name: Set up tree-sitter CLI
run: |
Expand Down
49 changes: 42 additions & 7 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,9 @@ jobs:
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@main

# Consistent Rust setup for both platforms
- name: Set up Rust nightly
uses: dtolnay/rust-toolchain@nightly

- name: Output rust version
shell: bash
run: rustup --version
# Install toolchain from rust-toolchain.toml (nightly + components + targets)
- name: Set up Rust
run: rustup show active-toolchain

# Cache Rust AFTER toolchain is set up
- name: Cache Rust dependencies
Expand Down Expand Up @@ -133,3 +129,42 @@ jobs:
run: cargo nextest run
env:
RUSTFLAGS: "-D warnings"

wasm-tests:
name: WASM Tests
runs-on: ubuntu-latest
# Override rust-toolchain.toml so the rustup proxy doesn't auto-install the
# prebuilt wasm32-unknown-unknown target. We need -Zbuild-std to rebuild
# core from source, and the prebuilt sysroot causes E0152 (duplicate lang
# item). The production WASM build avoids this because wasm-quarto-hub-client
# is excluded from the workspace and gets an isolated target/ directory.
env:
RUSTUP_TOOLCHAIN: nightly
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Install Rust nightly with rust-src
run: rustup toolchain install nightly --component rust-src --profile minimal

- name: Set up Clang
uses: egor-tensin/setup-clang@v1
with:
version: latest
platform: x64

- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
shared-key: rust-wasm-tests

- name: Install wasm-bindgen-cli
run: cargo xtask dev-setup

- name: Run WASM tests
run: |
CC_wasm32_unknown_unknown=clang \
CFLAGS_wasm32_unknown_unknown="-isystem ${{ github.workspace }}/crates/wasm-quarto-hub-client/wasm-sysroot -fno-builtin" \
cargo test -p pampa --test wasm_lua --target wasm32-unknown-unknown \
--no-default-features --features lua-filter -Zbuild-std=std,panic_unwind,panic_abort
10 changes: 3 additions & 7 deletions .github/workflows/ts-test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,9 @@ jobs:
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@main

# Consistent Rust setup for both platforms
- name: Set up Rust nightly
uses: dtolnay/rust-toolchain@nightly

- name: Output rust version
shell: bash
run: rustup --version
# Install toolchain from rust-toolchain.toml (nightly + components + targets)
- name: Set up Rust
run: rustup show active-toolchain

# # Cache Rust AFTER toolchain is set up
# - name: Cache Rust dependencies
Expand Down
6 changes: 3 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,11 @@ When fixing ANY bug:
- `quarto-treesitter-ast`: generic tree-sitter AST traversal utilities

**WASM:**
- `wasm-qmd-parser`: WASM module with entry points from `pampa` (see [crates/wasm-qmd-parser/CLAUDE.md](crates/wasm-qmd-parser/CLAUDE.md) for build instructions)
- `wasm-quarto-hub-client`: WASM client for hub-client (see [crates/wasm-quarto-hub-client/README.md](crates/wasm-quarto-hub-client/README.md) for build instructions)

### `hub-client/` - Quarto Hub web client

A React/TypeScript web application for collaborative editing of Quarto projects. Uses Automerge for real-time sync and the WASM build of `wasm-qmd-parser` for live preview rendering.
A React/TypeScript web application for collaborative editing of Quarto projects. Uses Automerge for real-time sync and the WASM build of `wasm-quarto-hub-client` for live preview rendering.

**Key directories:**
- `src/components/` - React components (Editor, FileSidebar, tabs, etc.)
Expand Down Expand Up @@ -266,7 +266,7 @@ All VFS file paths use the `/project/` prefix. When resolving file paths in WASM

- `pampa` is the core Quarto engine crate
- `quarto-core` handles higher-level orchestration
- `wasm-quarto-hub-client` is the WASM client (NOT wasm-qmd-parser)
- `wasm-quarto-hub-client` is the WASM client for hub-client
- Always check `git diff` for uncommitted changes before starting work on a continuation session

## hub-client Commit Instructions
Expand Down
67 changes: 67 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ members = [
]
default-members = ["crates/*", "crates/experiments/reconcile-viewer"]
# Excluded crates require special build toolchains or targets:
# - WASM crates: build with wasm-pack or --target wasm32-unknown-unknown
# - WASM crates: require --target wasm32-unknown-unknown and -Zbuild-std (see dev-docs/wasm.md)
# - pampa/fuzz: requires nightly Rust + libfuzzer-sys (Linux/macOS only), run via `cargo fuzz`
# crates/experiments is a container directory, not a crate, so we exclude it from crates/* matching.
exclude = ["crates/wasm-quarto-hub-client", "crates/wasm-qmd-parser", "crates/experiments", "crates/pampa/fuzz"]
exclude = ["crates/wasm-quarto-hub-client", "crates/experiments", "crates/pampa/fuzz"]
resolver = "2"

[workspace.package]
Expand Down Expand Up @@ -83,9 +83,6 @@ path = "./crates/tree-sitter-qmd"
[workspace.dependencies.tree-sitter-sexpr]
path = "./crates/tree-sitter-sexpr"

[workspace.dependencies.wasm-qmd-parser]
path = "./crates/wasm-qmd-parser"

[workspace.dependencies.pampa]
path = "./crates/pampa"
default-features = false
Expand Down Expand Up @@ -250,6 +247,6 @@ lua-src = { path = "crates/lua-src-wasm" }
# Profiles must be set at the workspace level
[profile.dev]
# Tell `rustc` to optimize for small code size to
# work around "too many locals" error from wasm-pack
# work around "too many locals" error in WASM builds
# https://github.com/wasm-bindgen/wasm-bindgen/issues/3451#issuecomment-1562982835
opt-level = "s"
Loading
Loading