Skip to content

Commit 815bf0d

Browse files
committed
feat(@angular/build): migrate advanced optimization Babel plugins to oxc-parser + magic-string
This change ports the remaining Babel plugins used for Angular build optimizations to a single unified, ultra-fast `oxc-transform` pass using `oxc-parser` and `magic-string`. Optimization passes migrated: - TypeScript Enum wrapping - Class static members elision and wrapping - Angular metadata elision (setClassMetadata, etc.) - Top-level pure function call and constructor annotation For regular optimized builds, this bypasses Babel entirely. For builds with code coverage or linking, it runs Babel first and then processes the output through the new fast path.
1 parent eaedbd8 commit 815bf0d

10 files changed

Lines changed: 2918 additions & 180 deletions

packages/angular/build/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ ts_project(
8585
":node_modules/@babel/helper-annotate-as-pure",
8686
":node_modules/@babel/helper-split-export-declaration",
8787
":node_modules/@inquirer/confirm",
88+
":node_modules/@oxc-project/types",
8889
":node_modules/@vitejs/plugin-basic-ssl",
8990
":node_modules/beasties",
9091
":node_modules/browserslist",
@@ -97,6 +98,7 @@ ts_project(
9798
":node_modules/magic-string",
9899
":node_modules/mrmime",
99100
":node_modules/ng-packagr",
101+
":node_modules/oxc-parser",
100102
":node_modules/parse5-html-rewriting-stream",
101103
":node_modules/picomatch",
102104
":node_modules/piscina",

packages/angular/build/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"listr2": "10.2.2",
3434
"magic-string": "0.30.21",
3535
"mrmime": "2.0.1",
36+
"oxc-parser": "0.140.0",
3637
"parse5-html-rewriting-stream": "8.0.1",
3738
"picomatch": "4.0.5",
3839
"piscina": "5.2.0",
@@ -50,6 +51,7 @@
5051
"devDependencies": {
5152
"@angular-devkit/core": "workspace:*",
5253
"@angular/ssr": "workspace:*",
54+
"@oxc-project/types": "0.140.0",
5355
"istanbul-lib-instrument": "6.0.3",
5456
"jsdom": "29.1.1",
5557
"less": "4.6.7",

0 commit comments

Comments
 (0)