I Built an APM for Angular That Runs Entirely in Your Browser
Every Angular Developer Asks This "Why is my page taking 8 seconds to load?" "Which component is re-rendering 30 times?" "Is this API call redundant?" "Why did this click freeze the UI?" Angular DevTools shows you c
Every Angular Developer Asks This
"Why is my page taking 8 seconds to load?"
"Which component is re-rendering 30 times?"
"Is this API call redundant?"
"Why did this click freeze the UI?"
Angular DevTools shows you components. ngLens shows you the WHY.
What is ngLens?
ngLens is a Chrome DevTools extension that acts as an Execution Intelligence Platform for Angular. Think APM β but it runs entirely in your browser, requires zero configuration, and never sends data anywhere.
- Works with Angular 14β22
- Performance overhead: < 3% CPU
- Setup: Install β Open DevTools β Done
How It's Different
Angular DevTools gives you a component tree. ngLens gives you:
| Feature | Angular DevTools | ngLens |
|---|---|---|
| Component tree | β | β |
| WHY it rendered | β | β |
| Waterfall timeline | β | β |
| API β Store β Component chain | β | β |
| Memory leak detection | β | β |
| Impact scoring | β | β |
| Targeted fix per component | β | β |
| Signal tracking (computed, input) | β | β |
| Duplicate API detection | β | β |
| Jank detection (frame drops) | β | β |
Your App's Health at a Glance
Open ngLens, and in seconds you see:
- Risk score (0β100) per component
- Top issue with root cause
- Suggested fix with expected gain
- Memory risks flagged immediately
- Environment detection (production/dev mode)
No digging through flame graphs. No guessing.
Execution Explorer β See WHEN Things Happened
A horizontal waterfall timeline β like Chrome's Network tab, but for your Angular app's internal execution flow.
See exactly:
- When each component rendered relative to others
- Which API call is the bottleneck (highlighted automatically)
- How long each operation actually took
- The critical path through your app's execution
In the example above, POST /api/orders/search takes 4.67s β that's 55% of total time. You'd know exactly where to optimize.
Render Inspector β Component Cascade + Data Flow
See which components rendered, how many times, and trace the data flow:
- Component Cascade β Ranked by render count and time cost
- Data Flow β Which API/store action triggered each render
- Hotspot indicator β The worst offender highlighted immediately
- Action-level breakdown β Click, Change, Input events separated
Causal Chains β Which API Affected Which Component
This is the feature that saves hours of debugging:
GET /api/users β 200 β [AUTH] SET_USER β 3 components
POST /api/orders/search β 200 β [ORDERS] SET_LIST β 5 components
GET /api/notifications β 200 β [NOTIFY] UPDATE β (duplicate flagged!)
[FILTERS] SET_ACTIVE β [FILTERS] SET_RESULTS +2
ngLens automatically:
- Links API calls to store actions to component renders
- Flags duplicate APIs
- Counts impacted components per action
Detect Leaks. Get Actionable Fixes.
Memory Leaks detected:
-
UserService.notifications$β Subscribed in DashboardComponent, never unsubscribed after destroy β Fix:takeUntilDestroyed() -
setInterval in PollingServiceβ Created every 5s, never cleared β Fix:clearInterval in ngOnDestroy()
Recommendations prioritized by impact:
- π΄ HIGH β Add OnPush to DataGridComponent (saves ~300ms per interaction)
- π‘ MED β Add trackBy to OrderListComponent (50 items re-created every update)
- π’ LOW β Zone pollution: WebSocket in ChatService β Move to
runOutsideAngular()
Full Signal Reactivity Tracking
ngLens captures the full signal chain across Angular versions:
- Angular β€ 16 β RxJS subjects, HTTP, timers, Router
-
Angular 17+ β
computed()recomputation,input()signals -
Angular 19+ β
linkedSignal(),resource(),httpResource() -
Angular 22 β Signal Forms,
@Service(), all stable signal APIs
Example traced chain:
UserService.currentUser.set({name: "John"})
β DashboardComponent.greeting (computed) β "Hello, John"
β DashboardComponent rendered
Hotspots + Compare Runs
Save a baseline β Make your fix β Capture again β See the improvement instantly.
| Metric | Before | After | Change |
|---|---|---|---|
| Render count | 156 | 42 | -73% |
| Avg render cost | 4.2ms | 1.8ms | -57% |
| Render frequency | 4.2x | 1.1x | -74% |
| Memory risks | 2 | 0 | Fixed |
Privacy & Security
This was non-negotiable from day one:
- β All analysis runs locally in your browser
- β Source code and results never leave your machine
- β
Minimal permissions β only
activeTab,scripting,tabs,storage - β Strict Content Security Policy
- β Optional analytics require explicit opt-in
- β MIT License β fully open source and auditable
Get Started
Install from Chrome Web Store:
π Install ngLens
Or build from source:
git clone https://github.com/patch-work-book/nglens.git
cd nglens
npm install
npm run build
# Load dist/ as unpacked extension in chrome://extensions
ngLens
Find Angular performance problems and learn how to fix them.
ngLens is a Chrome Extension that analyzes Angular applications at runtime, identifies performance issues, and teaches you how to fix them β whether you're a junior developer learning Angular or a senior architect optimizing at scale.
Features (V1)
- Angular Compatibility β Runtime tracking supports Angular 17-21; Angular 21 has a dedicated smoke check
- Angular Detection β Automatically detects Angular apps in both development and production mode
-
Change Detection Analysis β Flags Default change detection, missing
OnPush, and*ngForwithouttrackBy - Unnecessary Re-render Detection β Identifies excessive DOM mutation frequency, render bottlenecks, and template anti-patterns
- Memory Cleanup Risk Detection β Flags possible surviving subscriptions, unmanaged timers, and DOM listeners
-
RxJS Subscription Cleanup Detector β Detects subscriptions without observed cleanup and recommends
takeUntil,takeUntilDestroyed, orasyncpipe usage - Bundle/Lazy-loading Guidance β Highlights initial load risk areas and lazyβ¦
What's Next
- V2: CD profiler, Zone.js profiler, FPS monitor, interaction latency
- V3: Architecture smells, regression detection, Signals migration assistant
Angular DevTools shows you components. ngLens shows you the why.
Give it 30 seconds. That's all it needs.
Found a bug or have feedback? Open an issue β I read every one.
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.








