3 ms·
> Because of the issue that in TypeScript you can't import ".ts" file but you can import ".js" file That seems really annoying and is something I would expect
by kbenson 5y ago
> Because of the issue that in TypeScript you can't import ".ts" file but you can import ".js" file
That seems really annoying and is something I would expect to work. From the linked issue, does the problem go away if you make sure to always just import without the extension, and does it work both directions (deno TS->TS on JS and TS on JS->deno TS)?
- davnicwil 5y agoNo, deno mandates the extension. The no extension shortcut as well as the index file shortcut have not been included in deno as a learning from node, which in my view is probably a wise move - keep it super simple by just specifying the exact filename.
- eins1234 5y agoExactly this. Deno is designed to align with web module semantics, and omitting the extension is only really feasible when resolving modules on disk where roundtrip times are short and looking for multiple extensions in parallel is cheap. Deno, as well as the web, supports module resolution across the internet, where this resolution strategy would become prohibitively expensive.
- kybernetikos 5y agoDeno's position is much more sensible than the typescript teams position, but not working with the rest of the TS ecosystem is a huge price to pay. I hope that either Deno implements some 'legacy' way of working that is compatible with the way the official typescript team do it, or the typescript team realize the error of their ways. I'm not sure if that's likely to happen short of a fork though.