Hacker News new | ask | show | jobs
by jeffmcmahan 2204 days ago
Amen. I don't transpile to JS anymore. If the client is IE (no updates for 7 years?) and doesn't feel like installing FF, Chrome, Edge, or whatever, then it is what it is.

Modern static ESModule JS is quite good. I have several projects north of 30KSLOC written in modern JS. I'm not living in "undefined hell" because I use named-export ESModules, I check types all over, and I write quality tests. A little discipline goes a long way.

2 comments

Modules are my favorite part of js (and ts, mostly). One file = one module with all imports/exports explicit is so incredibly right. `git grep`ing to figure out which other file a random implicit import came from is a real PITA.
>I check types all over

Which is something you rarely need to spend time on if you're using TypeScript.

That's true. But with TS I have to declare types, import typings, maintain a build process to run the TS compiler, and so on. Moreover, static typing comes with added tediousness, and I personally feel that it's not worth the freight.