DEV Community

Discussion on: Using Typescript without compilation

Collapse
 
brense profile image
Info Comment hidden by post author - thread only visible in this permalink
Rense Bakker

We all already use typescript without compilation... Pretty much every modern dev env out there has support for serving typescript code without compiling it first... It's called transpilation: vitejs.dev/guide/features.html#typ... you only build/compile your typescript code when you deploy it to production and that compilation step is maybe 5% of the total build time. bundling and minifying takes much longer.

Collapse
 
thepassle profile image
Pascal Schilp

Not everbody uses vite. Also this still leads to some of the downsides I mention in my post, have you actually read it?

Collapse
 
brense profile image
Rense Bakker

Everything that uses SWC or Babel transpiles your Typescript rather than compile it. Vite is just one example of a build tool that uses SWC. I honestly can't think of any dev tooling that actually compiles your Typescript during development. I just wanted to clarify that speaking about compilation as being a downside of Typescript is a non-issue.

Thread Thread
 
thepassle profile image
Pascal Schilp

Except its not, the reasons for which are outlined in the post. Also not everyone uses vite or swc.

Thread Thread
 
brense profile image
Rense Bakker

Everytime anybody gives an example, you jump on it with the same repetitive argument that not everybody uses it... Do you have actual statistics for how many people do NOT use babel AND NOT use SWC?

Thread Thread
 
thepassle profile image
Pascal Schilp

Because frankly I'm tired of explaining, when people clearly aren't reading the post :-)

This will be my final comment: There are tools, like for example Esbuild (which vite uses internally) that strip the ts types from your .ts source code on the fly during development time. There are also other ways/tools to transform TS to make it feel like .ts runs natively in the browser/node environments. Which indeed some people find to be a nice developer experience, I'm not disputing this, I'm not saying that this is wrong. If you enjoy this kind of development workflow; good for you! However, this way of working still does not address some of the points I outlined in the article, which is why I keep referring back to it.

Thread Thread
 
brense profile image
Rense Bakker

Ok so you found a complicated way of working with Typescript, that makes it slow in development, which is why nobody uses that way in the first place and now you want to find a solution for that problem that doesnt exist?

Thread Thread
 
thepassle profile image
Pascal Schilp

its literally not complicated :')

Thread Thread
 
brense profile image
Rense Bakker

Yes your solution is less complicated than the complicated way in which you suggest people use typescript except... nobody is using typescript like that in the first place... I've been telling you this the whole time, you're solving a non-existing problem.

Thread Thread
 
thepassle profile image
Pascal Schilp

This is such a non-argument. As mentioned in the blogpost, which I doubt you've read, because you keep missing points that are addressed in the post itself, I very happily use this approach at work.

I'm gonna leave this discussion at this, I have some JSDoc comments to write :)

Thread Thread
 
brense profile image
Comment marked as low quality/non-constructive by the community. View Code of Conduct
Info Comment hidden by post author - thread only visible in this permalink
Rense Bakker

You go on and on about your approach. I have not made one comment about your approach, the only thing I have been telling you this whole time is this: nobody is compiling typescript during development. Maybe you should read the title of your own article...

Some comments have been hidden by the post's author - find out more