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.
Prototypes / dev are important.
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