The High-Performance TypeScript Compiler for Land 🏞️
VS Code'sTypeScriptbuild usestscwithNode.jsoverhead on every incremental compile. Build times grow linearly with project size. Even alternatives likeesbuildstill run in aNode.jsprocess.
"VS Code's TypeScript build step. 2-3x faster."
Welcome to Rest, a high-performance TypeScript compiler built with Rust
and OXC, designed for 100% compatibility with VSCode's build process. Rest
is one of the Elements in the CodeEditorLand architecture, responsible for
compilation and build tooling. It replaces esbuild's TypeScript loader
with a Rust-powered compiler that produces VSCode-compatible output.
Rest is engineered to:
- Deliver High Performance: Compile
TypeScript2-3x faster thanesbuildusingOXC. - Ensure VSCode Compatibility: Produce byte-for-byte identical output to VSCode's gulp build.
- Provide Memory Safety: Leverage Rust's ownership model for deterministic performance without garbage collection.
- Support Modern Tooling: Built on OXC 0.48, the latest TypeScript infrastructure.
The Rest compiler was chosen over the existing esbuild pipeline for three
reasons that directly affect the VSCode build:
OXCis used byVSCodeinternally. This means Rest produces output that matchesVSCode's own build pipeline - not an approximation.emitDecoratorMetadatasupport.VSCode's codebase relies on decorator metadata emission.OXChandles this correctly;esbuildhas limited support.useDefineForClassFields = false.VSCoderequires the legacy class fields behavior forES5compatibility.OXC's configurable codegen handles this exactly;esbuild's is implicit.
- Full TypeScript 5.x Support: Complete compatibility with TypeScript 5.x syntax and features.
- Decorator Handling: Proper support for
emitDecoratorMetadataand decorator transformations. - Class Fields Control: Configurable
useDefineForClassFieldsbehavior (VSCode default: false). - Parallel Compilation: Optional
--Parallelflag for multi-core compilation. - Directory-Based Compilation: Process entire directory structures with preserved layout.
- Comprehensive Error Reporting: Detailed error messages with source location information.
- Compilation Metrics: Built-in tracking of compilation count, elapsed time, and error counts.
- Source Map Generation: Planned support for source maps (in progress).
| Principle | Description | Key Components Involved |
|---|---|---|
| Performance | Rust + OXC delivers 2-3x faster compilation than esbuild. | OXC Parser, Transformer, Codegen |
| Compatibility | OXC is used by VSCode internally, ensuring 1:1 output compatibility. | OXC 0.48, VSCode build process |
| Memory Safety | No garbage collection, deterministic performance through Rust ownership. | Rust lifetime management |
| Modern Tooling | Built on the latest OXC infrastructure for TypeScript compilation. | OXC 0.48+ |
To understand how Rest's internal components interact to provide
high-performance TypeScript compilation, see the following source files:
Source/Library.rs- Binary entry pointSource/Fn/OXC/Compiler.rs- Main compiler orchestrationSource/Fn/OXC/Parser.rs- OXC parser wrapperSource/Fn/OXC/Transformer.rs- AST transformation (decorators, class fields, JSX)Source/Fn/OXC/Codegen.rs- Code generation from transformed ASTSource/Struct/CompilerConfig.rs- Advanced configuration (decorators, class fields, target)
The source files explain the OXC-based compilation pipeline, decorator handling, and VSCode compatibility transformations.
| Component | Role & Key Responsibilities |
|---|---|
| Rest Compiler | High-performance TypeScript to JavaScript compilation. |
| RestPlugin | esbuild plugin that integrates Rest into the build pipeline. |
| Build System | Environment-driven compiler selection (esbuild or Rest). |
[dependencies]
Rest = { git = "https://github.com/CodeEditorLand/Rest.git", branch = "Current" }Or use via the Output element's Compiler=Rest environment variable.
The Rest compiler is invoked as a CLI binary:
# Compile a directory
rest --input ./Source --output ./Target
# With parallel compilation
rest --input ./Source --output ./Target --Parallel
# Check available options
rest --helpVia the Output element build pipeline:
# Use Rest compiler for TypeScript transpilation
export Compiler=Rest
npm run prepublishOnly
# Development mode with Rest
export NODE_ENV=development
export Compiler=Rest
npm run RunThis project is released into the public domain under the Creative Commons CC0
Universal license. You are free to use, modify, distribute, and build upon
this work for any purpose, without any restrictions. For the full legal text,
see the LICENSE file.
Stay updated with our progress! See
CHANGELOG.md for a
history of changes specific to Rest.
Rest is a core element of the Land ecosystem. This project is funded through NGI0 Commons Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet program. Learn more at the NLnet project page.
The project is operated by PlayForm, based in Sofia, Bulgaria.
PlayForm acts as the open-source steward for Code Editor Land under the NGI0 Commons Fund grant.
| Land | PlayForm | NLnet | NGI0 Commons Fund |
|---|---|---|---|
|
|
|
|
|
Project Maintainers: Source Open (Source/Open@Editor.Land) | GitHub Repository | Report an Issue | Security Policy