ITNEXT

ITNEXT is a platform for IT developers & software engineers to share knowledge, connect, collaborate, learn and experience next-gen technologies.

Follow publication

Member-only story

TypeScript 4.9 Is A Game Changer

Tom Smykowski
ITNEXT
Published in
3 min readSep 27, 2022

--

The newest 4.9 TypeScript version is just around the corner, and new features are mind-blowing. You will learn about them from this article.

Types Hodor

The new keyword satisfies is a way to make sure your variable fits into a definition of a type. Comparing to casting, satisfies won’t cast the variable to a specific type.

It is useful in so many scenarios, it will surely become a default way of validating type. For example:

Better type narrowing

Sometimes TypeScript went nuts when we have tried to narrow data for example from an API. Now it is easier because “in” operator recognizes better what we are trying to achieve:

Improved NaN interview experience

Trivia about NaN became so popular, TypeScript developers decided to throw some swords from eager interviewers. As we all know, we shouldn’t compare anything with NaN because NaN is not a number, and really — it is nothing specific at all. Now TypeScript will show an error if you will try to compare to NaN by accident.

The mind-blowing thing about this feature is that TypeScript will actually propose a proper way to fix it! A real game changer:

Ultra-fast file change detection

TypeScript's developers were working for years on a performance improvement that will kick everyone lower backs. Compared to polling that basically checks files once and then, file watching is a game changer. The system will notify TypeScript if a file in a project changed. No need to burst that CPU anymore! With TypeScript 4.9 the file watching mechanism is mature enough to become the default way of watching for changes. It will improve build time!

Are you excited with new TypeScript features? I can’t wait to install it, and try all of these goodies myself. TypeScript is amazing!

If you want to learn TypeScript check out my fantasy cards I have created. You can order them with free worldwide shipping!

more info

Would you like to be up-to-date with software engineering? Already over 1,500 people subscribe to Tom Smykowski’s articles. Now you can join them too. For just $5 a month, you will get access to not only his but also ALL ARTICLES on Medium and let Tom Smykowski write more interesting stories! Become a member now!

--

--

Published in ITNEXT

ITNEXT is a platform for IT developers & software engineers to share knowledge, connect, collaborate, learn and experience next-gen technologies.

Written by Tom Smykowski

Hi! My name is Tom Smykowski, and I’m a Staff Frontend Engineer. Grab a free scalable Angular app checklist: https://tomasz-smykowski.com/scalable-angular

Responses (2)

Write a response