TypeScript vs. Vanilla JavaScript: The Evolution of Developer Preferences

Atihar Hossen Mahir
3 min readOct 3, 2023

--

Recently I am seeing big corps are ditching Typescipt in the ever-evolving world of web development, t’s essential for developers to be open-minded and willing to adapt to new tools, even if they initially resist them. TypeScript, a superset of JavaScript with static typing, has witnessed a remarkable journey in recent years introduced by Microsoft. However, the winds of change have started to blow, as some prominent open-source projects, like Svelte, Drizzle, and Turbo, have decided to ditch TypeScript in favor of vanilla JavaScript. This shift has left many developers pondering whether TypeScript’s reign is truly over. Let’s dive into the history, reasons, and implications of this surprising development.

The Rise of TypeScript

Back in 2012, Microsoft introduced TypeScript, but it didn’t garner much attention at first. Fast forward a few years, and it found its place when Angular 2 adopted it. This move initially seemed radical, but TypeScript’s influence grew steadily. By the early 2020s, TypeScript had become ubiquitous, with many of its initial critics converted into fervent advocates.

Recent Reversals

However, just as TypeScript appeared to be reaching its zenith, a wave of prominent open-source projects decided to part ways with it. These projects are not entirely abandoning TypeScript but opting not to use it for new development. This trend has raised eyebrows in the developer community. How could developers return to vanilla JavaScript after experiencing the benefits of TypeScript, such as early bug detection and enhanced code quality?

typescript vs javascript
Photo by Arnold Francisca on Unsplash

DHH’s Perspective

One notable example is David Heinemeier Hansson (DHH), the creator of Ruby on Rails, who decided to remove TypeScript from Turbo Version 8. His primary reason was that TypeScript introduced what he referred to as “type gymnastics” into the codebase. While TypeScript’s compile step wasn’t the issue, the extra complexity it added to the codebase was a concern, particularly for libraries.

Practical Considerations

Another significant project that moved away from TypeScript is Svelte. Their reasoning differs from DHH’s, as it’s more practical. Svelte 5 (and likely Svelte 6) will no longer rely on TypeScript, and Svelte Kit is already written in plain vanilla JavaScript. Their main benefit is the elimination of the compile step, which greatly boosts productivity. They are still achieving most of TypeScript’s benefits by using JS Doc, a standard comment format that provides type annotations and documentation, generating types and enabling intellisense in the editor.

Future Possibilities

While some projects are moving away from TypeScript, it doesn’t necessarily spell the end of TypeScript’s popularity. When it comes to building complete applications, frameworks like Svelte Kit and Next.js still integrate TypeScript seamlessly. Attempting to achieve similar results with JS Doc can be challenging and may not be practical for all scenarios.

Looking Ahead

There is a glimmer of hope for a reconciliation between TypeScript enthusiasts and those who prefer pure JavaScript. A Stage 1 ECMAScript proposal is currently under consideration. If adopted, it would introduce optional type annotations natively into JavaScript, potentially making TypeScript less essential.

The recent decisions by significant open-source projects to reduce their reliance on TypeScript may seem surprising, but they highlight the importance of flexibility and pragmatism in web development. While TypeScript remains a valuable tool for many developers, it’s essential to choose the right technology for the job. The evolving landscape of web development will undoubtedly continue to challenge our preferences and encourage us to adapt to new tools and approaches.

#javascript #typescript #developer #web_development #svelte #nextjs

--

--

Atihar Hossen Mahir
Atihar Hossen Mahir

Written by Atihar Hossen Mahir

Founder, Tech Product Development Leader | Advanced AI-Based Automation Enthusiast

No responses yet