-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do you still need TypeScript?
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
title: Do you still need TypeScript? | ||
date: 2024-06-17 | ||
permalink: daily/2024/06/17/do-you-still-need-typescript | ||
tags: | ||
- software-development | ||
- typescript | ||
- javascript | ||
cta: ~ | ||
snippet: | | ||
Do you still need TypeScript? | ||
--- | ||
|
||
There have been many discussions and videos recently asking if people still need to use TypeScript. | ||
|
||
There have also been large open-source projects moving from TypeScript back to plain JavaScript. | ||
|
||
The popular approach is using JSDoc comments - similar to PHP docblocks - to replicate some of TypeScript's features, such as autocompletion in IDEs and text editors. | ||
|
||
The suggested benefits are cleaner code and no build step, making it easier to work with and contribute to the code. | ||
|
||
I like using types in PHP and using static analysis tools such as PHPStan so, naturally, I gravitated to TypeScript. | ||
|
||
I wrote a custom form with TypeScript and Vue.js that was an entrypoint to a Drupal Commerce application - populating data from Drupal using an API endpoint and determining and creating a cart with the correct items based on the customer's selections. | ||
|
||
Whilst doing so, I found TypeScript very beneficial and I'll probably continue to use it in the future. | ||
|
||
But, leveraging JSDoc more in situations where I can't use TypeScript, such as writing Tailwind plugins and Stimulus applications, is great to know and to get the best of both. |