Skip to content

Commit 581cd90

Browse files
committed
test(compiler): add signal-based bundling benchmark for safe navigation optimization
Adds packages/core/test/bundling/safe_nav — an Angular Signals admin dashboard with 8 components and ~80 nullable signal bindings (user()?.name, order()?.id, computed()?.revenue, etc.). Serves as a reproducible before/after benchmark for the optimizeTemporaries and self-assignment-elimination compiler phases. Signal reads are function calls that bundlers cannot inline, so the savings from fewer let declarations appear in the final esbuild output. Measured savings on this benchmark: 1,147 bytes raw / 425 bytes gzip (0.76% gzip reduction).
1 parent c4d4105 commit 581cd90

2 files changed

Lines changed: 410 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
load("@rules_angular//src/optimization:index.bzl", "optimize_angular_app")
2+
3+
package(default_visibility = ["//visibility:public"])
4+
5+
optimize_angular_app(
6+
name = "bundles",
7+
srcs = [
8+
"main.ts",
9+
],
10+
env = {
11+
"NG_BUILD_MANGLE": "0",
12+
},
13+
deps = [
14+
"//:node_modules/rxjs",
15+
"//:node_modules/tslib",
16+
"//packages/core/test/bundling:node_modules/@angular/build",
17+
"//packages/core/test/bundling:node_modules/@angular/common",
18+
"//packages/core/test/bundling:node_modules/@angular/core",
19+
"//packages/core/test/bundling:node_modules/@angular/platform-browser",
20+
],
21+
)

0 commit comments

Comments
 (0)