Remix.run Logo
ericyd 6 hours ago

The author closes by enumerating some of the things they like about Bun which are not included in pnpm. The list is basically: native TS support, a vite-style bundler and a vitest/jest style test runner.

Other than a bundler, Node already has all of these. Different test runner syntax maybe but otherwise TS "just works" out of the box and their built in test runner is totally capable. Not sure I see the need for such a lament over Bun.

jazzypants 6 hours ago | parent | next [-]

To be fair, Node didn't have any of these things until Deno & Bun challenged it. Deno didn't seem to move the needle by itself very much for whatever reason, but Bun's existence has had a tangible effect on the Node Technical Steering Committee. I would even argue that much of the current impetus has been driven by Jarred Sumner's savvy social media marketing. It got people talking, and Node is better because of it.

Additionally, Bun's push for covering as much of the Node API as possible has pushed Deno towards the same level of compatibility, and now most code is basically runtime agnostic. I'm not sure if I'll ever actually use Bun in production, but I'm glad it exists because the JavaScript ecosystem has been much improved simply due to its existence.

inbx0 3 hours ago | parent | next [-]

Reminds me of the back and forth competition between Node.js and io.js that we had to endure back in the day. Worked out for the best in the end.

ericyd 3 hours ago | parent | prev [-]

No disagreement, but this article was posted 2 days ago, the argument isn't relevant right now.

hootz 6 hours ago | parent | prev | next [-]

When did Node add native TypeScript? Can you run "node main.ts" directly without any dependencies?

jazzypants 6 hours ago | parent | next [-]

January of last year. Yes.

https://nodejs.org/en/blog/release/v23.6.0

hootz 6 hours ago | parent [-]

That is type stripping and is incompatible with syntax that requires transpilation, so it is not native TypeScript support.

jazzypants 6 hours ago | parent | next [-]

TypeScript is a wide umbrella. For instance, Experimental Decorators are shunned by many (including me), but they are still used by millions. If I don't use any syntax that requires transpilation, am I not still using TypeScript?

Now that we have `satisfies` and `as const`, there's really no reason to ever use an enum. In my opinion, TypeScript is best when it is simply used as Language Server, and it should never have had runtime implications in the first place.

alanning 6 hours ago | parent | prev | next [-]

Node v22.7.0 added support for TypeScript syntax that requires transformation:

`node --experimental-transform-types example.ts`

As for whether this matches your definition of "native support" or not...

Source: https://nodejs.org/en/blog/release/v22.7.0

ifwinterco 6 hours ago | parent | prev | next [-]

Isn't that mostly just enums?

Is there anything else that doesn't run as valid JS if you strip the types (and maybe some other extra keywords)out?

Genuine question, in my head there's not much, but TS has a few weird corners I maybe haven't used

silverwind 5 hours ago | parent | next [-]

https://www.typescriptlang.org/tsconfig/#erasableSyntaxOnly covers them all, I strongly recommend running with that option enabled to be future-proof.

n_e 5 hours ago | parent | prev [-]

enums and decorators mainly. There are also subtleties such as having the ts file extension in imports. Also imports aren't transpiled in cjs so you need to need es modules.

I'm using it in my projects with no issues.

silverwind 5 hours ago | parent | prev [-]

Modern Typescript does not need runtime features.

moritzwarhier 3 hours ago | parent [-]

Your comment might lack explanation, but indeed the TS team has mentioned multiple times that they don't want to add any more features that require transpilation (as opposed to "dumb" type stripping and being a strict superset of JS).

IIRC they "almost" recommend against using them (the last part, I haven't researched again now).

But the usage of many features has reached a sort of point of no return, so I hope Node will go the route of making the experimental transpilation the default for TS files at some point.

Goes to show how strong the appeal of syntax is, especially enums.

To people coming from languages with enum support, it just looks so much more organized to use them, compared to union types, despite all of the (many) drawbacks.

efortis 6 hours ago | parent | prev [-]

v22.18 promoted type stripping from experimental

pjmlp 6 hours ago | parent | prev [-]

Additionally, with Typescript compiler rewrite, it is even less relevant.