Typescript best practices for client-side apps written in React

1. Avoid using React.PropTypes to define component’s props if you don’t have a specific use-case Fully leveraging TypeScript’s capabilities to make your code cleaner and simplistic is the first rule when using it in combination with React. Components' accepted props should be defined either via interfaces or type aliases. If your next question is “Which one should be used when?”, the answer is that they can be used interchangeably, as they are very similar, but there should exist consistency across your codebase....

May 4, 2023 · 8 min · Lucian Costin (Lukas) Ailenei

Get rid of redundant CSS selectors by making use of :is() and :where() pseudo-class functions

Both :is() and :where() CSS pseudo-class functions take a <forgiving-selector-list> as their argument, and select any element that can be selected by one of the selectors in that list. :is(<forgiving-selector-list>) { /* ... */ } :where(<forgiving-selector-list>) { /* ... */ } Using them can come with visible improvements related to the amount of code written by reducing repetition, making things simple, less verbose, and less error-prone. What is a forgiving-selector-list? You’ve probably seen in practice that the general behavior of a selector list is that if any selector in the list fails to parse, the entire selector list becomes invalid....

February 15, 2023 · 5 min · Lucian Costin (Lukas) Ailenei

Into technical debt: some words to relieve your anxiety.

Even if you’re an early career software engineer, you’ve most probably heard about the term “technical debt”, especially if you work on codebases that now have a couple of years of work behind, or not necessarily. Peers are using it in various contexts, but pretty often to blame difficulties in what concerns performance issues or delivery time of specific features on projects that have a large codebase, even to sell subjective preferences in terms of structural changes or what technology to choose for a specific purpose as it sounds scary and can be used to persuade not-so-technical people....

February 12, 2023 · 7 min · Lucian Costin (Lukas) Ailenei

Raising a glass of Hugo for my new tech blog !

So what will you find in here ? Creating a place where to express my thoughts and share cool stuff about anything software development related sat as an item on my to-do list for a long time now. It was about time to invest in that - I feel like I have encountered and experienced so many things I can tell people about and I constantly find cool stuff that worths to be spread....

January 6, 2023 · 1 min · Lucian Costin (Lukas) Ailenei