Menu

Why TypeScript 7 Made Angular Rethink Its Compiler
📰

Why TypeScript 7 Made Angular Rethink Its Compiler

DEV Community: angular·Shlomi Levi·about 21 hours ago
#XXzQDlhP
#devtoangular#devto#dev#angular#typescript
Reading 0:00
15s threshold

For years, Angular's compiler has been built on TypeScript's compiler APIs. TypeScript 7 broke that foundation: its new Go-based implementation doesn't expose the JavaScript transformation API Angular depends on.

Angular's answer is a more fundamental change: decoupling Angular compilation from TypeScript's compiler pipeline.

The new compiler, ngp (Angular Preprocessor), uses Oxc and Rust for source analysis while keeping Angular's existing template compiler in TypeScript. Oxc doesn't compile templates, doesn't generate ɵcmp , and doesn't type-check template expressions.

So what exactly does it do?

I've spent a lot of time with ts-morph, the TypeScript compiler API, and AST transformations, so the Rust rewrite wasn't what caught my attention. What interested me was how Angular could stop depending on TypeScript's AST without rewriting its entire compiler.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.