svelte-rs-2 Svelte Themes

Svelte Rs 2

Rust Svelte Compiler

svelte-rs — Rust implementation of the Svelte compiler (WIP)

Demo

https://mrwaip.github.io/svelte-rs-2/

Architecture overview

https://excalidraw.com/#json=tPR4IJ3ZQmfRfF0xW1fif,Qw3c1g41YuyCLz1XmRcujw


Feature checklist

See ROADMAP.md for the full feature checklist.


Workflow

This project uses Claude Code with a set of specialized commands and agents.

Session Start

/status — project overview: active specs, ignored tests, next ROADMAP item, known debt

Feature Porting

  1. /audit <feature> — gap analysis, create a spec and tests
  2. /port specs/<file>.md — implement the next slice from the spec
  3. /qa — review for material quality issues
  4. /sync-docs — sync ROADMAP and CODEBASE_MAP

Test Triage

  1. /explain-test <name> (optional — understand what the test covers)
  2. /triage-test <name> — classify the work as local-fix, slice-gap, or spec-gap
  3. /qa (optional)

Diagnostic Parity

  1. /add-diagnostic-test <name> — create a focused diagnostic parity case under tasks/diagnostic_tests/
  2. /diagnose-diagnostics <component|case> — isolate a false positive, false negative, or span mismatch against npm svelte/compiler
  3. /port specs/<file>.md — implement the owning fix after the mismatch is reduced to one durable case

Tech Debt / Refactoring

  1. /improve <description> — diagnosis, fix, and tests
  2. /qa

Investigation

  • /diagnose <component> — run the repro through the pipeline, isolate the root cause, add focused tests, and record follow-up work in a spec or ROADMAP.md
  • /audit <feature> — gap analysis vs the reference compiler
  • /explain-test <name> — what the test does and why it fails
  • /bench — Rust vs JS performance

Maintenance

  • /sync-docs — synchronize documentation with the code
  • /add-test <name> — test-first: create a test before implementation
  • /add-diagnostic-test <name> — test-first: create a diagnostic parity case before implementation

Snapshot Generation

  • just generate — regenerate reference snapshots for both tasks/compiler_tests/ and tasks/diagnostic_tests/

Building the WASM package

wasm-pack build --target web ./crates/wasm_compiler -d ../../docs/compiler

Or just playground to build WASM and serve the playground locally.

Native Node.js bindings (NAPI)

A native addon for Node.js consumers lives in crates/napi_compiler and is published as svelte-rs2 from packages/.

  • just npm-smoke — debug build + local link + smoke test
  • just npm-build — release build + tarballs for platform packages

Quick check against reference compiler

just quick-check path/to/component.svelte — compile a single component and diff against svelte/compiler output.

Useful dev commands

  • just test-compiler — run all compiler integration tests
  • just test-case <name> / just test-case-verbose <name> — single test case
  • just test-diagnostics / just test-diagnostic-case <name> — diagnostic parity tests
  • just clippy-strict — clippy with -D warnings
  • just generate — regenerate reference snapshots
  • just dump-ast '<expr>' — dump OXC ESTree JSON for a JS expression

Top categories

Loading Svelte Themes