Encore's TypeScript parser, written in Rust and built on SWC, was compiled to WebAssembly so it can run in the browser. The key challenge was replacing filesystem dependencies (directory traversal, tsconfig.json reading, SQL migration parsing) with in-memory equivalents, achieved via Cargo feature flags that gate all native OS interactions behind a `native` feature. The SDK is baked directly into the WASM binary at build time. The result is a playground at tsparser.encore.dev where users can reproduce parser bugs by pasting code snippets and sharing links, running the exact same parser binary used in the CLI and CI.
Table of contents
What the parser readsCompiling it to WASMLeaving the native parts behindFaking the filesystemA playground for parse errorsOne parser in every place it runs108K Impressions1 Comment