🔥 New model() function in Angular 🔥
Two-way bindings have previously been cumbersome and error-prone. Before, you had to create an input and an output and make sure that the output has "Change" as a suffix. This is not obvious at all and is error prone.
With the signal-based input revolution, we got a new function called model(), which is a signals-based input and an output.
This reduces boilerplate code and is reactive by default!
Two-way bindings have previously been cumbersome and error-prone. Before, you had to create an input and an output and make sure that the output has "Change" as a suffix. This is not obvious at all and is error prone.
With the signal-based input revolution, we got a new function called model(), which is a signals-based input and an output.
This reduces boilerplate code and is reactive by default!
Handling files with ease using the new Angular file loader options 🗃
In Angular 17.1, the team introduced new loader options that streamline file handling. Here's what you need to know:
📁 Text Loader (text): Convert file content into strings, perfect for those text file transformations.
🔢 Binary Loader (binary): Transform binary files into Uint8Array, essential for handling intricate binary data.
🖼 File Loader (file): This option keeps files separate and allows users to easily access their runtime locations. It is especially handy for managing assets efficiently.
🔲 Empty Loader (empty): Exclude files from your bundle, keeping your project lean and mean.
Configuring these loaders is a breeze! Let me walk you through it. Say you want to inline SVG content directly into your application. Here's what you need to add in your angular.json:
In Angular 17.1, the team introduced new loader options that streamline file handling. Here's what you need to know:
📁 Text Loader (text): Convert file content into strings, perfect for those text file transformations.
🔢 Binary Loader (binary): Transform binary files into Uint8Array, essential for handling intricate binary data.
🖼 File Loader (file): This option keeps files separate and allows users to easily access their runtime locations. It is especially handy for managing assets efficiently.
🔲 Empty Loader (empty): Exclude files from your bundle, keeping your project lean and mean.
Configuring these loaders is a breeze! Let me walk you through it. Say you want to inline SVG content directly into your application. Here's what you need to add in your angular.json:
{
"options": {
"loader": {
".noscript": "text"
}
}
}⬆️ Voila! This setup seamlessly inlines SVG files as strings, eliminating the hassle of external file requests for your graphics. Imagine the boost in performance and user experience!
To ensure TypeScript plays nice, especially with custom loaders like for SVG files, include a type definition file in your project. Simply add a file (e.g., src/types.d.ts).
To ensure TypeScript plays nice, especially with custom loaders like for SVG files, include a type definition file in your project. Simply add a file (e.g., src/types.d.ts).
🧙🏻♂️ A Gentle Introduction to Generics in Typenoscript.
https://dev.to/this-is-learning/a-gentle-introduction-to-generics-in-typenoscript-3ap3
One of the more advanced topics in Typenoscript is Generics and understanding and adding them to your Typenoscript coding toolbox can be very powerful. As we continue with our journey of learning Typenoscript and building amazing projects, we want to have more and more tools that we can use to make our job easier, without making compromises when possible.
https://dev.to/this-is-learning/a-gentle-introduction-to-generics-in-typenoscript-3ap3
🧙🏻♂️Backdoor in upstream xz/liblzma leading to ssh server compromise (CVE-2024-3094)
- https://www.openwall.com/lists/oss-security/2024/03/29/4
- https://news.ycombinator.com/item?id=39866092
- https://www.openwall.com/lists/oss-security/2024/03/29/4
- https://news.ycombinator.com/item?id=39866092
Angular Munich pinned «https://angular.love/en/2023/11/28/angular-styles-masterclass-2/»
🛑 Avoid using detectChanges() 🛑
"But what if no event will schedule a CD cycle?"
Congrats.
This is the ONLY case you need it for.
In the Template use reactive variables.
- Observables
- Signals
Let them do the work for you.
Have a non-reactive variable?
- markForCheck() should be enough in most cases
#angular
"But what if no event will schedule a CD cycle?"
Congrats.
This is the ONLY case you need it for.
In the Template use reactive variables.
- Observables
- Signals
Let them do the work for you.
Have a non-reactive variable?
- markForCheck() should be enough in most cases
#angular
🔥 FAST 🔥 file crawling and globbing!
#perfmatters #webperf #utils #nodejs
(Really fast even if u are used to fast-glob or fs-walk)
https://github.com/thecodrr/fdir
#perfmatters #webperf #utils #nodejs
(Really fast even if u are used to fast-glob or fs-walk)
https://github.com/thecodrr/fdir
GitHub
GitHub - thecodrr/fdir: ⚡ The fastest directory crawler & globbing library for NodeJS. Crawls 1m files in < 1s
⚡ The fastest directory crawler & globbing library for NodeJS. Crawls 1m files in < 1s - thecodrr/fdir
🧙🏻♂️ 5 harsh truths about workplaces no one will tell you!
1. They call you family, but they don’t mean it
Family members are irreplaceable.
But as soon as an employee leaves a company, they issue a new JD to replace them.
So no, don’t fall for the “family” tag.
2. They don’t want you to become a leader
They need people to boss over and get work done from.
If you become a leader, who will do their work?
3. Remote work is not a perk.
It means 24*7 work.
If you work remotely, it’s important you create your work boundaries and remember that work is not your whole life. It’s only a part of it.
4. Most bosses are micro-managers not leaders
Managers will manage you, leaders will help you grow.
Very few companies have great leaders - and you are very fortunate if you work under one of them.
5. They think money can buy everything
Flapping a big pay-check isn’t going to solve bigger problems like - toxic workplace, poor managers, bad culture, terrible work-life balance etc.
(c) sahaschopra
1. They call you family, but they don’t mean it
Family members are irreplaceable.
But as soon as an employee leaves a company, they issue a new JD to replace them.
So no, don’t fall for the “family” tag.
2. They don’t want you to become a leader
They need people to boss over and get work done from.
If you become a leader, who will do their work?
3. Remote work is not a perk.
It means 24*7 work.
If you work remotely, it’s important you create your work boundaries and remember that work is not your whole life. It’s only a part of it.
4. Most bosses are micro-managers not leaders
Managers will manage you, leaders will help you grow.
Very few companies have great leaders - and you are very fortunate if you work under one of them.
5. They think money can buy everything
Flapping a big pay-check isn’t going to solve bigger problems like - toxic workplace, poor managers, bad culture, terrible work-life balance etc.
(c) sahaschopra
It's all too easy to get confused about Extract/Exclude vs Pick/Omit.
Here's a little cheatsheet.
(c) mapocock
#typenoscript #ts
Here's a little cheatsheet.
(c) mapocock
#typenoscript #ts
👆🏻 10 Сustom Utility Types for TypeScript Projects
#utils #typenoscript #ts
https://dev.to/antonzo/10-sustom-utility-types-for-typenoscript-projects-48pe
#utils #typenoscript #ts
https://dev.to/antonzo/10-sustom-utility-types-for-typenoscript-projects-48pe
DEV Community
1-10 Сustom Utility Types for TypeScript Projects
In the dynamic landscape of TypeScript development, utility types stand as base tools for crafting...