3 ms·
I'll happily use TypeScript for all my UI components, libraries and server code, most of the time with Bun thanks to its OOB support for TypeScript. But for We
by mythz 2y ago
I'll happily use TypeScript for all my UI components, libraries and server code, most of the time with Bun thanks to its OOB support for TypeScript.
But for Web UIs I'll drop down to a #NoBuild "Simple, Modern JavaScript" [1] i.e. using JS Modules + JSDoc Type Annotations to avoid needing any npm modules/build steps/etc. I still benefit from a library's TypeScript definitions/VS Code intelli-sense/static analysis/etc but completely avoid any build/bundling complexity for the cost of a slightly more verbose syntax in JSDoc type hints.
I'd happily move to using ECMA Type Annotations proposal [2] if it ever got accepted, but alas TC39 moves slowly...
[1] https://servicestack.net/posts/javascript https://servicestack.net/posts/javascript
[2] https://github.com/tc39/proposal-type-annotations https://github.com/tc39/proposal-type-annotations
- mrighele 2y agoI use Bun too, and I found that in many cases `bun build` is a small enough sacrifice to be able to use Typescript... after a certain size maintaining pure Javascript code becomes too difficult for me