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
tsc does not look for the nearest tsconfig.json for third-party dependencies, therefore it's a common pratice for libraries to transpile themselves to JS before being depended on.
Bun claims to support TypeScript out of the box, so you can have just package_manifest.main.endsWith(".ts[x]") or package_manifest.exports[i].endsWith(".ts[x]"), but this is problematic as I explaned above (due to tsconfig.json), unless Bun is doing the tsc work whenever we import the specific library. I'm wondering if this is the case?
Noting, as I understand Bun erases types from TS files it evaluates, so no problem with using Bun just for directly evaluating TS. But this pratice of using TS directly might lead to compiler errors later in other areas, such as web development.
Plus, this thing of transpiling to JS wouldn't be necessary if the ecosystem worked differently... Take Rust for example: it doesn't require you to do this.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
tsc
does not look for the nearesttsconfig.json
for third-party dependencies, therefore it's a common pratice for libraries to transpile themselves to JS before being depended on.Bun claims to support TypeScript out of the box, so you can have just
package_manifest.main.endsWith(".ts[x]")
orpackage_manifest.exports[i].endsWith(".ts[x]")
, but this is problematic as I explaned above (due totsconfig.json
), unless Bun is doing thetsc
work whenever we import the specific library. I'm wondering if this is the case?Noting, as I understand Bun erases types from TS files it evaluates, so no problem with using Bun just for directly evaluating TS. But this pratice of using TS directly might lead to compiler errors later in other areas, such as web development.
Plus, this thing of transpiling to JS wouldn't be necessary if the ecosystem worked differently... Take Rust for example: it doesn't require you to do this.
Beta Was this translation helpful? Give feedback.
All reactions