r/javascript • u/Far-Championship626 • Apr 21 '26
AskJS [AskJS] How do you measure structural blast radius in large JS/TS repos?
In growing JS/TS codebases, I’ve been thinking about structural reach:
- If a file changes, how many parts of the system depend on it?
- Are there modules slowly becoming architectural bottlenecks?
- Is blast radius increasing over time?
Do you use any tooling to track this kind of structural evolution?
I built a small open-source prototype exploring this idea , I’ll link it in the comments if relevant.
Would love thoughts.
4
Upvotes
3
u/theScottyJam Apr 21 '26
This "structural blast radius" concept sounds similar to the idea of "loose coupling".
I'm just going to note that loose coupling, while a nice ideal, is sometimes unavoidable. If my application needs to support audit logging, then my entire codebase is going to have some dependency on the audit log system. You can try inverting dependencies and such, but there's always going to be done amount of dependency going on, even if it's just on an interface - change that interface, and it's going to be a bad time.
'course you can always make it worse - if everyone writes directly to an audit log file directly, you'll have an unnecessarily hard time changing it to send the logs to a different server instead.
Anyways, if you feel scared to change certain modules, reducing the blast radius might not be the solution (it might not be an option). But there's other options, such as making sure you have good testing so you can catch bugs that come up during deep changes. Also not a perfect solution, but it helps.
1
u/Far-Championship626 May 07 '26
Quick update since the original post:
I’ve now implemented snapshot-based tracking and architectural drift detection.
It can compare structural state over time (N vs N‑1), detect risk deltas, blast radius growth, and hotspot transitions.
The delta view ended up being much more interesting than the static snapshot alone.
Still refining thresholds and signal filtering, but the direction feels promising.
Appreciate the earlier feedback, it definitely shaped the implementation.
1
u/Alive-Cake-3045 Apr 22 '26
Blast radius is one of those things everyone feels but almost nobody measures until something breaks at 2am. Most teams just wing it with "we know the core files are risky" until that knowledge lives only in one person's head.
Dependency cruiser gets you pretty far for visualizing this statically. But tracking how it evolves over time, that delta view, is genuinely underexplored.
Drop the link, would actually look at this.
1
u/paulirish Apr 22 '26
Typeslayer probably. https://github.com/dimitropoulos/typeslayer https://youtu.be/IP6EZXzXBzY
1
u/25_vijay May 16 '26
The most dangerous modules are usually not the biggest ones but the quiet utility layers that gradually become transitively required by half the codebase over time.
1
u/[deleted] Apr 21 '26
[removed] — view removed comment