#01: Patterns, validations, charts, ...
Typescript meets Haskell, validating objects agains TS interfaces, charting reimagined and much more! I am very excited to announce the first issue of yours truly ByteBullet Newsletter.
TLDR; In this weeks issue:
TS-Pattern - pattern matching in TS
Typia - object validation against TS Interfaces
react-charts - charts library from TanStack
TypeScript 5.2 Beta
Typescript + Haskell = ♥️
I have stumbled upon a great library which helps with reducing the clutter that comes with messy switch statements and pattern matching. TS-Pattern is “The exhaustive Pattern Matching library for TypeScript with smart type inference.”
Typia
Take a Typescript interface and slap it against any object at runtime and tell me if they are equal. Forget yup, zod or any other validation libraries. There is a new kid around the block: Typia. It does exactly as said in the beginning and has integrations with Prisma (enforce max length of a string, email, etc…)
Charts, charts, charts…
Charts can be a bit of a pain point for a web developer. Thankfully libraries like Recharts exist. But this week I have tried react-charts from people at Tanstack. It allows you to quickly create powerful charts. Code has more descriptive abilities than words (at least in this case) so I recommend to take a look at this CodeBox example they have created.
TypeScript 5.2 Beta
Last week people at Microsoft announced the 5.2 beta of TypeScript. You can read more here. Quick summarization:
using
Declarations and Explicit Resource Management
See you next Saturday!
If you want to reach me, hit me up on twitter @ByteBulletDev