🚨 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! 🚀
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
Could be a life saver for someone. If you have other approaches to deal with such situations, please leave a comment.
https://youtu.be/ntM7utSjeVU?si=_DAL32cGo6nDN8e4
#git
https://youtu.be/ntM7utSjeVU?si=_DAL32cGo6nDN8e4
#git
YouTube
I was wrong about git stash...
I always used a git stash based workflow when I quickly need to switch branches. In newer versions of git (since 2015), the git worktree command lets you check out multiple branches at the same time.
Get my awesome interactive git cheatsheet as soon as it's…
Get my awesome interactive git cheatsheet as soon as it's…
🔥1
As part of signal migration and finally to get rid of angular lifecycle hooks let's read how viewChild, viewChildren, contentChild and contentChildren can be used with effect and computed instead of ngAfterViewInit and ngAfterContentInit.
#angular #signals
https://blog.angular-university.io/angular-viewchild-contentchild/?utm_source=newsletter&utm_medium=email&utm_campaign=the_new_angular_template_query_system_you_need_to_know&utm_term=2025-03-21
#angular #signals
https://blog.angular-university.io/angular-viewchild-contentchild/?utm_source=newsletter&utm_medium=email&utm_campaign=the_new_angular_template_query_system_you_need_to_know&utm_term=2025-03-21
Angular University
Angular viewChild,viewChildren, contentChild (Full Guide)
A super-detailed guide to the new Angular signal queries: viewChild(), viewChildren, contentChild() and contentChildren().
Don't miss to ready those articles of this new Angular Dev Team contributor.
For info - Matthieu invented Angular Hydration debugging tool.
https://riegler.fr/blog
For info - Matthieu invented Angular Hydration debugging tool.
https://riegler.fr/blog
riegler.fr
Matthieu Riegler
Home is where wifi connects automatically
Did you know that in angular version 19+ you can use
#name
instead of
private name
to make them true private?
I didn't know that properties with private field works only before compile time and it is open in production code for access.
Here is a good article about this https://riegler.fr/blog/2024-05-17-private-fields-downleveling
Make sure you are not using in earlier angular versions as it will result in weakMap creation.
#angular #ts #typescript #advanced #tips
#name
instead of
private name
to make them true private?
I didn't know that properties with private field works only before compile time and it is open in production code for access.
Here is a good article about this https://riegler.fr/blog/2024-05-17-private-fields-downleveling
Make sure you are not using in earlier angular versions as it will result in weakMap creation.
#angular #ts #typescript #advanced #tips
riegler.fr
Understand private properties downleveling in Angular
And more on browserslist and Esbuild integration into Angular
Lifecycle-Hook-Free Angular: Building Components with Modern APIs
https://www.youtube.com/live/5m0eqGxrLUo?t=23477s
Article: https://riegler.fr/blog/2024-12-31-lifecycle-hook-less
#angular #hooks #advanced
https://www.youtube.com/live/5m0eqGxrLUo?t=23477s
Article: https://riegler.fr/blog/2024-12-31-lifecycle-hook-less
#angular #hooks #advanced
YouTube
NgGlühwein 2024 | 14.12. Vienna
🎉 Get ready for a free Mini Conference to celebrate the end of 2024 with the Angular Vienna Community 🎉
What's on the agenda:
🗣️ International Top Speakers
🎓 Knowledge sharing
🎫 Raffles of cool prices
👥 Meet old and new friends from the community
🍻 Free…
What's on the agenda:
🗣️ International Top Speakers
🎓 Knowledge sharing
🎫 Raffles of cool prices
👥 Meet old and new friends from the community
🍻 Free…