Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Angular Blog 7 min read Deep dive mediumAdept

An update on Angular’s TypeScript 7-powered Compiler

Because TypeScript 7 is compiled in Go and does not expose the ts.Transformer API cross-language, Angular is building a new compiler, the Angular Preprocessor (ngp), that decouples Angular compilation from TypeScript's compiler APIs. For each source file, ngp emits a .ng.ts file with decorators compiled for runtime and a .ngtypecheck.ts file translating template expressions for TypeScript type-checking, both with source maps and usually kept in memory. It uses a hybrid design: a multithreaded Rust analyzer built on oxc parses and analyzes code, then streams work units to the existing TypeScript template compiler backend, packaged via napi-rs as a native addon with a WASM fallback. Rust and oxc were chosen over Go because no public Go TypeScript parser/AST library exists. Performance gains are not yet benchmarked, and an experimental release is targeted for later this year.

Assumes: Angular components and decoratorsTypeScript compiler basicsAST transformations

Related posts

  • Node just added TypeScript support. What does that mean for Deno?

    Deno easyNovice

    Node 22.6 added TypeScript execution via type stripping (stable in 23.6), which replaces annotations with whitespace but does no type checking, does not handle JSX/TSX, and still relies on tsc and a manually managed tsconfig.json. Deno instead ships an integrated toolchain: SWC strips types, a bundled TypeScript compiler powers `deno check` and the LSP, and fmt, lint, doc and compile all understand TypeScript with zero-config defaults. Deno also supports TSX/JSX, TypeScript in the REPL and Jupyter, and publishing raw TypeScript to JSR without transpilation or separate .d.ts files.

  • A Gentle Intro to TypeScript

    Deno mediumAdept

    TypeScript catches the bugs that JavaScript's dynamic typing and implicit type coercion allow, such as add(1, "2") returning "12", by reporting them at compile time instead of at runtime. Annotating function parameters with `: number` is enough for the compiler to reject invalid calls and to infer return and variable types. The usual practice is to add just enough annotations and let inference handle the rest. Node projects need the `typescript` package and `tsc`, while Deno and Vite compile TypeScript transparently.

  • Land ahoy: leaving the Sea of Nodes

    V8 hardMaster

    V8 is replacing Sea of Nodes in its Turbofan optimizing compiler with Turboshaft, a traditional control-flow-graph IR. The JavaScript backend and the entire WebAssembly pipeline already run on it, and Maglev is taking over the JS frontend. After more than a decade with Sea of Nodes, the team found its theoretical benefits largely unrealized for JavaScript. Checks, loads and stores keep most nodes pinned to the effect or control chains, memory operations rarely float, and the graphs are hard for engineers to read, debug and lower. Explicit control and effect chains make lowerings error-prone, while a CFG stays closer to both the source code and the emitted assembly.

  • Deno 2.3: Improved deno compile, local npm packages, and more

    Deno mediumAdept

    Deno 2.3 lets deno compile bundle programs that use FFI and Node native add-ons, adds --include/--exclude control over embedded files, and exposes Deno.build.standalone to detect compiled binaries. Local npm packages can now be used through a "patch" entry in deno.json. deno fmt gains formatting of CSS, HTML and SQL in tagged templates plus 14 new options, and OpenTelemetry support adds span events, cross-service context propagation, node:http auto-instrumentation and V8 heap metrics. deno install is about 2x faster when npm dependencies are cached, thanks to in-memory npm metadata caching and lockfile v5, with a benchmark showing 2.5x on a Vite React template. The release also adds the JavaScript `using` keyword, coverage ignore comments and TypeScript 5.8 with V8 13.5.

  • Migrating from Apollo Tooling to GraphQL Codegen at Yelp

    Yelp Engineering mediumAdept

    Yelp replaced the deprecated apollo-tooling codegen with GraphQL Codegen across a 500+ package React/TypeScript monorepo without requiring developers to change imports or queries. Rather than adopting gql.tada or Codegen's native client preset, the team patched the typescript-operations plugin and near-operation-file preset to emit apollo-tooling-compatible output: per-operation file names, inlined enums and input types, plain `T | null` instead of Maybe/Exact wrappers, and field-only nested type names. The patches also fixed a concurrency problem where multiple processes regenerated shared fragments. The changes were upstreamed into GraphQL Codegen v6 in collaboration with its maintainer. The remaining few hundred type errors were fixed incrementally, with Claude's help, using a shrinking allowlist of packages still on the old tool.

The quest for software engineering knowledge.

Look:
Layout: