🛠 Angular 19 improves how components with empty styles are handled. When a component’s styles or CSS files are empty, Angular sets encapsulation to None, preventing unnecessary attributes like “_ngcontent-ng-c885857805” from being added to HTML elements.
This update benefits projects using utility-first CSS frameworks like Tailwind CSS, where unused CSS files were sometimes not removed.
🎯 Key Benefits:
- Less runtime overhead work for scoping styles
- Lighter HTML documents in SSR response because of fewer attributes
- Applies to styleUrl, styleUrls and styles
⚠️ Note: This optimization is applied only in production builds.
#angular #angularlove #angulartips #frontend
This update benefits projects using utility-first CSS frameworks like Tailwind CSS, where unused CSS files were sometimes not removed.
🎯 Key Benefits:
- Less runtime overhead work for scoping styles
- Lighter HTML documents in SSR response because of fewer attributes
- Applies to styleUrl, styleUrls and styles
⚠️ Note: This optimization is applied only in production builds.
#angular #angularlove #angulartips #frontend
🗺 Server Route Config
ℹ️ What is it?
Server Route Config allows dynamic route definitions to be loaded from a server at runtime. This is particularly useful for applications where routes depend on external factors like user roles, permissions, or configuration files.
⁉️ Why it matters:
🚀 Dynamic Routing
Routes can adapt to changing application needs without requiring hardcoding or a rebuild.
🤌 Simplified Configuration
Centralized server-side route definitions reduce redundancy and simplify management.
🪪 Improved Security
By controlling routes on the server, you minimize the risk of exposing unauthorized pages to the client.
💡 Use Cases:
Multi-tenant applications where routes vary by tenant.
Feature flags that enable or disable specific routes based on user roles.
ℹ️ What is it?
Server Route Config allows dynamic route definitions to be loaded from a server at runtime. This is particularly useful for applications where routes depend on external factors like user roles, permissions, or configuration files.
⁉️ Why it matters:
🚀 Dynamic Routing
Routes can adapt to changing application needs without requiring hardcoding or a rebuild.
🤌 Simplified Configuration
Centralized server-side route definitions reduce redundancy and simplify management.
🪪 Improved Security
By controlling routes on the server, you minimize the risk of exposing unauthorized pages to the client.
💡 Use Cases:
Multi-tenant applications where routes vary by tenant.
Feature flags that enable or disable specific routes based on user roles.
The Missing Ingredient for Angular Template Code Coverage and Future-Proof Testing
https://marmicode.io/blog/angular-template-code-coverage-and-future-proof-testing
https://marmicode.io/blog/angular-template-code-coverage-and-future-proof-testing
🔥2
It's a MOOOOOOOOONNNDDDDAAAAAYYYY!!! Wake UP PPL!
https://www.youtube.com/watch?v=swXWUfufu2w&ab_channel=Deno
https://www.youtube.com/watch?v=swXWUfufu2w&ab_channel=Deno
YouTube
Programming Should Be Simple
Deno is an all-in-one batteries included JavaScript and TypeScript toolchain.
Learn Deno in our new bite-sized tutorial series: https://deno.co/learn-deno
Website: https://deno.com
GitHub: https://github.com/denoland
Discord: https://discord.gg/deno
Twitter:…
Learn Deno in our new bite-sized tutorial series: https://deno.co/learn-deno
Website: https://deno.com
GitHub: https://github.com/denoland
Discord: https://discord.gg/deno
Twitter:…
There is npm package "is-number"... yep... isNumber.. Nobody can do better as this dependency...
But what you say about this: https://www.youtube.com/shorts/oy0QD-40ppg
But what you say about this: https://www.youtube.com/shorts/oy0QD-40ppg
YouTube
gen z programmers are insane???? 😅… #coding
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.
Wow... Finally new Stable Diffusion AI finished job correctly =)
Forwarded from Free image creator | StableDiffusion
neuralpony.png
1.2 MB
Stable Diffusion 3.5 (turbo): 1024x768 px
🔥1
🏎 How to boost the development in Angular 19?
#Angular v19🔥 introduces Hot Module Replacement (#HMR) for styles by default, and experimental support for template HMR behind a flag.
Previously, changes to styles or templates triggered a full rebuild and page refresh. With HMR, only the modified style or template is compiled and sent to the browser, updating your app without refreshing the page or losing state. This results in faster development cycles and uninterrupted workflow.
HMR for styles is enabled by default in v19 by running ng serve command.
#ng19
#Angular v19🔥 introduces Hot Module Replacement (#HMR) for styles by default, and experimental support for template HMR behind a flag.
Previously, changes to styles or templates triggered a full rebuild and page refresh. With HMR, only the modified style or template is compiled and sent to the browser, updating your app without refreshing the page or losing state. This results in faster development cycles and uninterrupted workflow.
HMR for styles is enabled by default in v19 by running ng serve command.
#ng19
🔥3
🚀 Angular Template Syntax Upgrade: Multiple Values for @𝐜𝐚𝐬𝐞
Angular's template syntax might get a boost soon! 🎉
A PR is open in Angular, allowing multiple guards within a single @𝐜𝐚𝐬𝐞 statement using the syntax @𝐜𝐚𝐬𝐞(𝐚; 𝐛; 𝐜) 👇
Pls don't implement this for @𝐢𝐟 😁
PR: https://github.com/angular/angular/pull/58600
#ng19
Angular's template syntax might get a boost soon! 🎉
A PR is open in Angular, allowing multiple guards within a single @𝐜𝐚𝐬𝐞 statement using the syntax @𝐜𝐚𝐬𝐞(𝐚; 𝐛; 𝐜) 👇
Pls don't implement this for @𝐢𝐟 😁
PR: https://github.com/angular/angular/pull/58600
#ng19
👍1
Reduce boilerplate and simplify #Angular unit tests with #Spectator ✅
Spectator is a fantastic library for simplifying your unit tests. One of its main benefits is that it automatically allows you to mock services, classes, and components ➕
There is no need to set-up and configure a #TestBed with Spectator ➕
Additionally, you can wrap your services with SpyObject<YourService>, and Spectator will automatically add spyOn functions to all your mocked methods; no need to manually do it yourself; simply asset in your tests ➕
It also makes mocking return values much cleaner; no more jest.fn() that clutters your test, but a much more intuitive and declarative API to mock return value ➕
Spectator has much more to offer; you can check out their docs here: https://github.com/ngneat/spectator
Spectator is a fantastic library for simplifying your unit tests. One of its main benefits is that it automatically allows you to mock services, classes, and components ➕
There is no need to set-up and configure a #TestBed with Spectator ➕
Additionally, you can wrap your services with SpyObject<YourService>, and Spectator will automatically add spyOn functions to all your mocked methods; no need to manually do it yourself; simply asset in your tests ➕
It also makes mocking return values much cleaner; no more jest.fn() that clutters your test, but a much more intuitive and declarative API to mock return value ➕
Spectator has much more to offer; you can check out their docs here: https://github.com/ngneat/spectator
What is the new Route-level render mode introduced in #Angular v19 🤔
If you're using server-side rendering (SSR), by default, Angular will render all parametrized routes on the server and pre-render (also known as "static site generation" or SSG) all routes without parameters. This helps to serve your un-parametrized routes even faster⚡️
But sometimes, you might not want to pre-render the page and always want to render it on the server. Some reasons might be:
🔹 The page content changes based on the user (e.g., user dashboards, personalized recommendations, or profile pages).
🔹 The page displays data that updates frequently and needs to show the most current state, such as stock prices, live sports scores, or news headlines.
🔹 Pages can change based on actions taken in an admin panel (think of products in an e-commerce website; you can change the price, images, etc)
If you're using server-side rendering (SSR), by default, Angular will render all parametrized routes on the server and pre-render (also known as "static site generation" or SSG) all routes without parameters. This helps to serve your un-parametrized routes even faster⚡️
But sometimes, you might not want to pre-render the page and always want to render it on the server. Some reasons might be:
🔹 The page content changes based on the user (e.g., user dashboards, personalized recommendations, or profile pages).
🔹 The page displays data that updates frequently and needs to show the most current state, such as stock prices, live sports scores, or news headlines.
🔹 Pages can change based on actions taken in an admin panel (think of products in an e-commerce website; you can change the price, images, etc)
✨ Dynamically Display a Required Asterisk with #css Only! ✨
There's no need to manually insert an asterisk for required fields in your form. With a touch of CSS magic, it can be done automatically! 😎
This method allows the required asterisk to show up dynamically, saving you both time and effort in your markup. 💪
Codepen: https://codepen.io/syansari02/pen/azovjdV
There's no need to manually insert an asterisk for required fields in your form. With a touch of CSS magic, it can be done automatically! 😎
This method allows the required asterisk to show up dynamically, saving you both time and effort in your markup. 💪
Codepen: https://codepen.io/syansari02/pen/azovjdV