An overload set can hand the branded argument a precise return type and the unbranded one a nullable type, so callers that already did the parse stop handling a failure that cannot happen to them.
Branding pays off for the Invalid Date hole, sanitization state, money, ids and validated values. It is noise inside a single module, on types that are already distinct, and on anything mutable.
TypeScript compares types by shape, so a user id and a post id are both just a string and swapping them compiles. A brand makes them distinct at compile time and leaves nothing behind at runtime.
A CommonJS file resolves an ESM-only package through the require condition, so its types come back missing. The resolution-mode import attribute overrides that for a single import.
A few simple steps to migrate your existing patch-package patches to pnpm patch. You can even batch...
Using clsx or classnames in React lately has become a trend with utility-first CSS frameworks like...
If you ever started learning React and saw it's syntax JSX, you maybe thought. "This looks like...
In this blog post I will show you 16 ways how to render something in Vue 🚀 So let's...
For a long time I heard people complaining that React & ReactDOM has a huge size, and everyone...
Let's say we have this createStore function: Ignore the implementation, we focus only on return...
this post is a precursor for upcoming JSX posts So we all heard that JSX is a specific JavaScript...
Frameworks like Next.js (React 💙), Nuxt.js (Vue 💚) and Universal (Angular ❤️) allow you to register...
Alias for removing local branches that are gone on remote # ~/.gitconfig file [alias] ...
This post may be relevant mostly to developers or who loves automation. The Post covers two topics,...
Everyone was happy when React Team announced the new stable Context API, and everyone ditched Redux....
Things are changing fast in WEB today, and react-router v6 is in beta already and around the corner....
Alias for removing Git remote and adding it back git config --global alias.readd '!f() {...
Mock Service Worker (MSW) is an API mocking library for browser and Node. —...
How to memoize your children to not trigger a re-render
Rules to take into consideration when merging a pull request
Follow Angular style guide https://angular.io/guide/styleguide tree -I 'node_modules|build' ...
React v16.6.0 introduced React.lazy that allows to code split without any external...
One implementation, several call signatures. How to write them for functions, methods, constructors and statics, and the three rules that decide which signature a call actually gets.
Add note for early return when using ref #1456 ...
Currently TypeScript lib.dom.d.ts does not implement Typed fetch...
Implement own `React.Fragment`
Problem trying to solve. Map every keyboard (input source / layout) back to EN-US. Why...
While learning react-router v4 I read some of their source code. And as we know they are using...