You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is a bit tricky. NodeJS v20 seems to want the file extension name using NodeJS conventions of *.js for *.ts modules. However, Deno is used & it expects *.ts extension names for *.ts modules.
If both NodeJS & Deno are going be supported, it may make sense to convert the *.ts source into *.js + *.d.ts. There are some other advantages to using *.js + *.d.ts. Mainly around optimizing the performance + payload size. Such as:
No need for a tsc build
Simplify the overall build
Source files are directly used in the npm package
more straightforward stack traces
private *.js function signatures with a different ts representation
private *.js functions
Of course the disadvantage would be not using Typescript. JSDoc Types can mitigate the lack of types in the js implementation. While JSDocs are decent at representing types, they are not a replacement. And are missing some features, particularly around generics.
btakita
added a commit
to btakita/ad4m
that referenced
this issue
Jun 12, 2024
Running the first step of the Build section causes some errors when using nodejs v20. nodejs v18 successfully builds.
The text was updated successfully, but these errors were encountered: