Goodbye Typescript, hello native typing for Javascript ✨

Read Time:2 Minute, 36 Second

Typing. Love it or hate it, it has many advantages: better DX (through intellisense auto-completion), better code documentation, less time consuming errors. Its benefits greatly outweigh its cost, so why do some people still avoid it? One word: Typescript. You have to set it up and make sure your tooling is working correctly which can add a layer of frustration to any project.

So what if I told you that native typing might be coming to Javascript? Christmas is right around the corner and boy do I have a gift for you 🎅

The proposal 📄

TC39 is the comity in charge of Javascript’s specs – they help maintain and evolve the definition of JS. If you’re curious, I wrote a section about them in a previous article.
They recently moved the Type Annotations proposal to Stage 1 (out of 4), which means it’s time to widely speculate on the impact and implications of this feature !

As much as I love being dramatic, this will not sign the death of TS by any means, it will simply allow for cleaner and more reliable JS code for projects that don’t plan on using TS or that wish to use both in conjunction.

What will native JS typing look like if this proposal passes?

It would be very close to what we currently have with Typescript and Flow, namely:

Enter fullscreen mode Exit fullscreen mode

These annotations will not stop you from passing a string or any other variable type as parameter. They will be ignored at runtime and are just there as guidelines that can be used by 3rd party type checkers such as your IDE.

The argument for strict typing has its place in this discussion in my opinion. In its current proposal, these types are just type annotations, which is something we already have thanks to JSDoc. So the question remains: why?

What’s the point? 🤷

We’re in an odd situation: Javascript is one of the only languages that has us write in one language (Typescript) to then have it transpiled to another one (Javascript). These layers add complexity to any project, so the more tools we add to our default tool belt, the better.

The need for Typescript creates a form of monopoly on current available tooling, where each and everyone of them needs to evolve with TS in order to not be left behind. The State of the Octoverse 2022 shows the impressive popularity of Typescript in 2022, which means this need to evolve becomes almost mandatory for your linters, bundlers etc.

Having this feature already bundled with our dear Javascript will only make it a more complete package and help us slow down the obvious tooling bloat we’re currently facing.

What do you think? Would you see yourself using this feature if it releases? What are the risks that come to mind, especially if you’re an avid user of Typescript?

Feel free to follow me on Twitter (if it doesn’t implode by the time you finish this article), it’s always a pleasure connecting with some of you 😄


CyberSEO Pro - OpenAI GPT-3 autoblogging and content curation plugin for WordPress

Tag Cloud

Java Java Logical Programs OTP Generation in Java python Recursion youtube video ASCII Upper and Lower Case blockchain javascript graph learn to code software development Successful Software Engineers breadth first search Java Array Programs Java Programs Uncategorized android ios programming kotlin web-development django data sql cybersecurity database swiftui serverless aws swift rust react background-position gradients loader mask grid nth-child pseudo elements indieweb WordPress Print Array without brackets C++ factorial Java String Programs Final Keyword Static Variable Axie Infinity Cryptokitties NFT games tool inserting MISC Tips Codes python code python projects python3 system info python project Bigginers How to Do Integrations Payment Gateways PHP checkout page in php Implement stripe payment gateway in Step by step in PHP integrate stripe gatway in php mysql payment gateway integration in php step by step payment gateway integration in php step by step with source code payment gateway integration in website PHP Integrate Stripe Payment Gateway Tutorial PHP shopping cart checkout code shopping cart in php stripe php checkout PHP/MySQL/JSON best international payment gateway does google pay accept international payments how to accept international payments in india paytm payment gateway razorpay codeigniter github razorpay custom checkout github razorpay get payment details razorpay integration in codeigniter github razorpay international payments Razorpay payment gateway integration in CodeIgniter razorpay payment gateway integration in php code Razorpay payment gateway integration with PHP and CodeIgniter Razorpay payment gateway setup in CodeIgniter Library & Frameworks Tips & Tricks UI/UX & Front-end coding birds online html code for google sign in login with google account in PHP login with google account using javascript login with google account using javascript codeigniter login with google account using php login with google account using php source code
Chrome Extensions of the Month – November 2022 Previous post Chrome Extensions of the Month – November 2022
UI Framework for Flutter. What should be included in? Next post UI Framework for Flutter. What should be included in?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.