News for hackers. Stuff that matters.
Re:TC39 Proposal: Type Annotations by spion on Wednesday June 08, 2022 @04:36PM (#31673669)
I'm not sure this will help solve any of our problems.

Theoretically, there would be no more need for compilation tools after this change is implemented.

In practice, lambdas need to be bundled, frontends still need to be bundled and running typescript in node efficiently nowadays should be as easy as `node -r @swc-node/register path/to/file.ts`

So this will actually not ease the JavaScript tooling nightmare.

Re:TC39 Proposal: Type Annotations by laurencerowe on Wednesday June 08, 2022 @05:04PM (#31674145)
Not requiring bundling to be setup during development is a huge win for developer ergonomics. Though I prefer to write TypeScript I've avoided it in some small projects where I didn't want the hassle of setting up the transpiler / watcher / etc.

Production bundling can then be as simple as running `deno bundle index.js` or similar.

Re:TC39 Proposal: Type Annotations by seniorsassycat on Friday June 10, 2022 @12:47PM (#31696541)
that's solved easily enough with ts-node or swc
Re:TC39 Proposal: Type Annotations by laurencerowe on Friday June 10, 2022 @03:30PM (#31698450)
It's not when you're writing code for a browser.
Re:TC39 Proposal: Type Annotations by brundolf on Wednesday June 08, 2022 @04:53PM (#31673956)
Transpiling and bundling are two separate things. Removing the need for one of those would have benefits even if the other were still there

That said, I'm not convinced this would actually remove one of them:

- It would mean shipping more code which is a no-no

- It probably won't ever cover the whole of typescript's features, so many people will continue to use that, and will still have to transpile

I'm sure this will help... somebody, but it's going to be a very narrow set of workflows that benefit

Re:TC39 Proposal: Type Annotations by klodolph on Wednesday June 08, 2022 @05:42PM (#31674690)
This makes both irrelevant, since you can already run code without bundling.

Obviously it’s not something you’d do in a normal production environment. It’s nice to be able to run code without any compilation steps if you’re working on something small (e.g. some demo on my personal website) or something in a development environment.

I’ve done this. Served up JS with “import” statements everywhere. The devserver just served JS straight from the filesystem without modification. When I change the JS, the browser just needs to reload—there’s no build process, no waiting. The production environment ran it all through Closure. Closure also ran in the dev environment, but it ran asynchronously, in the background, telling you what the errors are.

No source maps to deal with. No delays. The browser gets exactly what I write.

Re:TC39 Proposal: Type Annotations by brundolf on Wednesday June 08, 2022 @06:12PM (#31675044)
Sure, it's just that very few companies are probably going to be doing this outside of very early prototypes/toy examples. Load time is just too important
Re:TC39 Proposal: Type Annotations by klodolph on Wednesday June 08, 2022 @07:25PM (#31675783)
So?

Prototypes / dev are important.

Re:TC39 Proposal: Type Annotations by mekster on Wednesday June 08, 2022 @09:56PM (#31676783)
Stewardship of JS may align more with TS and may be better for the future of JS than TS going its way.
Re:TC39 Proposal: Type Annotations by algerd on Thursday June 09, 2022 @01:00AM (#31677710)
It will reduce complexity of the existing tools.