Angular Stream
55 subscribers
21 photos
271 links
Angular news, events, videos etc.
If you want to recommend a post please write @hobbyts911
Download Telegram
Madge is a developer tool for generating a visual graph of your module dependencies, finding circular dependencies, and giving you other useful info

— madge npm docs

One of my favorite and honestly one of the best tools when determining the health of the Angular codebase is called madge which allows us to visualize dependency graph of the project with a single command!

npx madge src/main.ts --ts-config tsconfig.json --image ./deps.webp

(* make sure to adjust paths based on your exact workspace structure)

It will crawl through all files .ts files (and the files they import, …) and produce an easy to understand chart with which are very easy to read

does it look organized, left to right
🔥 does it look like it was made by a bunch of drunk spiders

and we can use them to

determine codebase health
find areas to improve
communicate with non-technical colleagues
The last point can come extremely handy when justifying often much needed refactoring / technical dept clearing efforts which can benefit the organization by increasing overall shipping velocity, but are often hard to justify and communicate properly!

Ref: https://angularexperts.io/blog/top-10-angular-architecture-mistakes?utm_source=linkedin&UTM_MEDIUM=SELF&UTM_CONTENT=POST&UTM_CONTENT_TYPE=BLOG&UTM_CAMPAIGN=TOP-10-ARCH-MISTAKES
🚨 Stop Splitting URLs in #JavaScript the Wrong Way! 🚨

We’ve all been there: You need to work with a URL string, and your first instinct is to use String.split(). Maybe you ended up juggling multiple temporary variables, awkwardly handling query parameters with extra splits and joins, and producing buggy, hard-to-maintain code. 😖 There must be a better way, right? 🤔

Enter the Native URL Constructor

The URL constructor in JavaScript is a game changer! It parses a URL for you and gives you back a structured, easy-to-use object that contains everything you need.

👀 Why Use URL?

Clean and Intuitive: Easy to understand and maintain.

Built-In Validation: Automatically validates and formats your URLs.

Feature-Rich: Handles all parts of the URL (host, protocol, path, query, fragment).

Performance Boost: Native support means less overhead compared to custom string operations.

No more manual string manipulation. Just clean, readable, and bug-free code! 🚀
🔥1