opral / inlang-paraglide-js

Tree-shakable i18n library build on the inlang ecosystem.
https://inlang.com/m/gerre34r/library-inlang-paraglideJs
22 stars 0 forks source link

Typescript `isolatedDeclarations` and `allowJS` with paraglide. #160

Closed minht11 closed 1 week ago

minht11 commented 1 week ago

Typescript 5.5 add support for isolated declarations. This is to speedup tooling and so on. Unfortunately "isolatedDeclarations": true does not work with "allowJs": true which is required to use paraglide.

Isolated declarations promise huge speed up for typescript and other related tooling, so I hope there is way to use it while using paraglide. Possibly generating declaration files along side compiled messages?

LorisSigrist commented 1 week ago

IMO This is a typescript issue: microsoft/TypeScript#58262

Paraglide's output is fully typed using JSDoc. TypeScript has enough information to generate a declaration file in parallel the way it does for isolatedDeclarations, they just haven't implemented that yet. They likely will at some point.

I am hesitant to change Paraglide's output to accommodate a likely temporary restriction from a brand-new TS version.

samuelstroschein commented 1 week ago

I would also pushback. The overhead in paraglide's compiler to emit ts files or declaration files only is huge (i tried).

typescript should fix this on their end.