Looking for a high-performance terminal table for Node.js CLIs?
Check out @visulima/tabular:
• 2–3x faster than cli-table3
• Unicode + ANSI color support
GitHub: github.com/visulima/vis...
Posts by Daniel
That's so funny, if you try to buy chatgpt on the Web app you need to pay 23€ per month, if you use the android app, it's only 21,99. Nice try
The --noEmit flag allows TypeScript to check types without generating JavaScript output. This makes TypeScript a pure static analyzer with no runtime impact, ideal for gradually adopting in large legacy codebases!
Even Node.js's new built-in TypeScript support can't strip enum code at runtime!
TypeScript enums have surprising gotchas that many experts avoid.
Unlike most TS features, enums generate runtime code and aren't erased during compilation. They can't be used as type constraints and cause bundle bloat.
TypeScript introduced private class fields before JavaScript did. Its initial private keyword was later replaced by JavaScript's standard # syntax for private fields.
For more examples, explore the new string package for Node.js. You'll find extended string types that you can use in your next project.github.com/visulima/visulima/blob/m...
Template literal types let you create powerful string manipulation at the type level:
You can make TypeScript's type system Turing complete with recursive conditional types.
This means the type system itself can compute any algorithm... though you probably shouldn't 😅
TypeScript has built-in utility types for manipulating other types, but many devs reinvent them.
Instead of writing your own, use these standard ones:
Which pattern helps you the most?
I've found discriminated unions (#2) to be an absolute game-changer for complex state management.
Follow for more TypeScript + React tips that boost your productivity and code quality! ✨
Use type guards to ensure type safety in render methods:
Make component refs type-safe:
Type React event handlers properly:
Use type extraction for component props to keep your code DRY:
Leverage React.FC when you need access to children, defaultProps and contextTypes types:
Use discriminated unions for component states:
Kick off with precise component prop typing:
7 TypeScript patterns that will dramatically improve your React codebase 🧠
After reviewing 20+ production React+TS codebases, these patterns consistently separate the pros from the beginners.
Save this thread for your next PR review! 🧵👇
What workflow do you have for building node / react / vue libraries?
Do you have some dev server in user or just using vite for developing and some other tool for bundling?
🎉 Exciting update! Packem now supports CSS handling! Plus, you can now run commands or scripts automatically on a successful build. Streamline your workflows even more with this powerful library bundler! #webdev #opensource #nodejs #typescript #Packem