You are viewing a single thread.
View all comments
4 points

I haven’t dealt with a larger JS/Node Project in a while, but I like this approach to using TS features in JS.

permalink
report
reply
9 points

so he does all of this because he dislikes transpiling because supposedly it makes debugging etc harder? does he know about sourcemaps?

he also says he doesnt like type information in his code, so he adda them as comments. the type information is still there, how is this an improvement?

permalink
report
parent
reply
2 points

The issue with transpiling is that the code that’s running in production is not necessarily the one that’s been tested. A source map doesn’t fix that.

permalink
report
parent
reply
6 points

I loathe this line of reasoning. It’s like saying “unless you wrote assembly, compiling your code could change what it does.”

Guess what, the CPU reorders/ellides assembly, too! You can’t trust anything!

permalink
report
parent
reply
2 points

Unless someone is using some language extensions, transpiling from TS to an ECMAScript module using the ESNext target merely drops the type annotations.

If not running the exact same code being developed is an issue, it’s an easy fix.

permalink
report
parent
reply
1 point
*

Ugh? Why shouldn’t it be the same code?

permalink
report
parent
reply
4 points

I do this daily and believe me when I say that I’d trade my kidney for the ability to use TS natively. This looks good on paper but jsdoc notation has lots of flaws and you literally can’t do some things with it. Also, it doesn’t check if the function actually does the thing you described so it needs manual review every time it’s changed.

permalink
report
parent
reply
4 points

That approach was mentioned in the video.

permalink
report
parent
reply

Programming

!programming@programming.dev

Create post

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person’s post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you’re posting long videos try to add in some form of tldr for those who don’t want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



Community stats

  • 2.5K

    Monthly active users

  • 1.8K

    Posts

  • 28K

    Comments