Earlier quoted context omitted.
TypeScript feels "boring" enough at this point that being a few years behind isn't gonna be an issue in most cases. For teams who want to stay on the absolute latest release of TypeScript but want to be more conservative with their Node version, external compilation will remain necessary; but for someone like me, where TypeScript has been "good enough" for many years that I'm not excited by new TypeScript releases, t…
typescript is still evolving in dramatic ways. The 5.0 release has some really good improvements
Node.js adds experimental support for TypeScript
281–290 of 570 posts
Re: Node.js adds experimental support for TypeScript
#282Earlier quoted context omitted.
But in the meantime you suffer for it. How many days have you spent on webpack config? Or the package.json type property? Or yarn/pnpm/etc particulars? I have spent too many. Bun is quite nice.
Is Bun's bundler on par with webpack for features? You can't escape webpack* if you're targeting frontend. *Or vite, or whatever equivalent.
Re: Node.js adds experimental support for TypeScript
#283Earlier quoted context omitted.
> we all just wanted java with JIT, more feature rich type system Java has JIT. How is TypeSript type system feature-richer than the Java one?
Java and Typescript have fundamentally different type systems, that lead to drastically different ways to approach types. Utility types, like Partial , are basically impossible to represent in Java except with almost-duplicated classes.
Exactly.
> Partial
Looking at that it's just what a default POJO (with nullable properties) already is, so I'd see no need to represent that in Java.
Looks cool though and I like Typescript; my issue with it is that it needs transpiling to run. If it was a first-class citizen in an environment I would use it for my pet projects.
Re: Node.js adds experimental support for TypeScript
#284Re: Node.js adds experimental support for TypeScript
#285Earlier quoted context omitted.
This is a persistent meme that has no basis in reality. A TypeScript engine is a JavaScript engine, since everything that can be done in JS can be done in TS. It's plausible, maybe, that there could be some additional optimisations on TS code where the engine is sufficiently happy with all types in a subset of the program. But that would be on top of all existing JS engine features, unless you want your engine's perf…
That's a pretty obtuse interpretation of the comment. Browsers natively being able to run Typescript code / .ts files instead of requiring transpiling to plain Javascript would be a large boon to the TS ecosystem by making basically everything easier. Even if it's just stripping the TS and running the plain JS it would already be helpful, but it running the typechecking beforehand would be wonderful.
And I was replying based on what I've seen other people saying whenever the subject comes up; apologies if I misread.
Browsers doing type checking is a pretty fraught idea IMO, at least with Typescript and not some other statically typed language entirely.
Re: Node.js adds experimental support for TypeScript
#286Earlier quoted context omitted.
Isn't Bun too raw? It's built with Zig, which hasn't even hit 1.0.
Probably had to stay in the oven a bit longer... Jokes apart, Zig is moving forward a lot which is why it's not 1.0 yet, but it doesn't mean you can't write safe and performant applications right now. Zig is also a rather simple and straightforward language (like C) and has powerful compile-time code generation (like C macros, but without the awful preprocessor).
Re: Node.js adds experimental support for TypeScript
#287One thing to note is that it is impossible to strip types from TypeScript without a grammar of TypeScript. Stripping types is not a token-level operation, and the TypeScript grammar is changing all the time. Consider for example: `foo ( x )`. In TypeScript 1.5 this parsed as (foo (x)) because bar&baz wasn’t a valid type expression yet. When the type intersection operator was added, the parse changed to foo (x) which…
Re: Node.js adds experimental support for TypeScript
#288Earlier quoted context omitted.
“During the transpilation process, no type checking is performed, and types are discarded.” this node feature is primarily around disregarding typescript in favor of the underlying javascript it represents. that reminds me of this fun article: https://www.richard-towers.com/2023/03/11/typescripting-the-...
Yes, the feature is about being able to run typescript scripts. It’s not a type checker, it is similar to ts-node, deno, bun, etc. Typescript has been designed for that specific purpose.
this is still a “runs some typescript” and “not runs every typescript file”
“ At least initially in this PR no trasformation is performed, meaning that using Enum, namespaces etc... will not be possible.”
this type of nuance is the core of why typescript is a headache for any organization with more than a single codebase— javascript is portable, typescript is in theory, but not in observed practice.
Re: Node.js adds experimental support for TypeScript
#289I would rather raw dog JavaScript than write Typescript. Typescript is an abomination.
Re: Node.js adds experimental support for TypeScript
#290Earlier quoted context omitted.
https://www.typescriptlang.org/docs/handbook/2/types-from-ty... https://www.typescriptlang.org/docs/handbook/2/template-lite... alone puts TS over anything that Java has.
> alone puts TS over anything that Java has. Virtual Threads alone challenge this assumption. Syntax bloat is not a feature.