Open sbking opened 1 month ago
We can likely offer an option emitWithTsExtension
Can you test if changing the file endings to .ts
works seamlessly in your project? Due to the JSDoc annotations, I expect TypeScript to work out of the box. If that's the case, then we don't have to use the typescript compiler which we tried to avoid to keep the complexity low
Unfortunately no, looks like JSDoc type annotations are only supported in JS files.
That said, I think my actual problem was that I was missing Remix's unstable_optimizeDeps
flag and I think allowJs
is now working fine. I think I would still prefer an option to generate .ts files to align with the rest of my codebase, but for now it's less of an issue.
Can confirm. TypeScript complains with "ts 80004: Please convert JSDoc to TypeScript types".
Ergh bummer. It seems like we need to run the typescript compiler with emitDeclarations only to parse the JSDoc and emit d.ts files https://www.typescriptlang.org/docs/handbook/declaration-files/dts-from-js.html.
Good news: We won't need an option because we can emit both .js
and .d.ts
files. JS projects shouldn't be affected.
Paraglide keeps being written in JSDoc
JS projects use JSDoc (.js files)
TS projects use declaration files (.d.ts)
@sbking are you open for a PR against the lix-integration
branch that has paraglide js 2.0? Then we can include this in the paraglide js 2.0 release
EDIT: If parallel .js (jsdoc)
and .d.ts
files works, then we can also get rid of the entire allowJs
step in the setup. That's great!
I can not enable
allowJs
for my application because other build tooling (Remix + Vite) does not work well whenallowJs
is enabled. Is there any way to make Paraglide generate .ts files instead?