Hello, I remember one of the old version support import .ts file by default, so import statement doesn't have to specify the full file name.
can you please add that option back? and give a flag or something to control this behavior
thanks!
What do you mean by "default"?
Deno will always require imports include their file extension (if the file has a file extension).
Correct, it is an explicit design decision. Having magic extension resolution causes lots of issues, ones the community is still suffering today. We should be explicit about the resources we are loading.
sorry, I already have a library developed using typescript, I use vscode's tool to import ts files,
the import lines generated automatically vscode does not have '.ts' file extension.
so to use deno with my lib, i have to manually add '.ts' to all those import lines, which is a lot.
@lab4quant Yeah, we are aware that this hinders adoption. At the moment we're not optimizing for adoption - we're trying to get the design of the core system correct. So the safest thing for us to do (to avoid making irreversible mistakes) is to stick to the spirit of the ES standards as closely as possible: I don't think they would introduce URLs which do not resolve to actual files.
It may be in the future we will switch focus to adaption and attempt to fix this somehow. But not now.
Thanks for raising the issue tho - it's good to hear the feedback.
Most helpful comment
@lab4quant Yeah, we are aware that this hinders adoption. At the moment we're not optimizing for adoption - we're trying to get the design of the core system correct. So the safest thing for us to do (to avoid making irreversible mistakes) is to stick to the spirit of the ES standards as closely as possible: I don't think they would introduce URLs which do not resolve to actual files.
It may be in the future we will switch focus to adaption and attempt to fix this somehow. But not now.
Thanks for raising the issue tho - it's good to hear the feedback.