-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate TypeScript files instead of JS files? #238
Comments
We can likely offer an option Can you test if changing the file endings to |
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 |
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
@sbking are you open for a PR against the EDIT: If parallel |
Typescript language server is screwed up when modifying source files referencing inlang generated js files. It's terrible, every nextjs user should know this issue before selecting the library. |
@jeiea, can you elaborate on the issue is you are running into? what do you mean with the ts language server is screwed up when modifying source files? |
@jeiea can you check if this also happens if you keep the |
It looks good, but again, I'm not sure. I can't create a 16000 line d.ts file. |
@jeiea okay, i assume it will work. I'm adding this issue to v2.0 |
d.ts files don't seem to support auto import, is that okay? |
You mean having auto-complete that leads to an "auto import"?
|
Yes. I meant that. |
got it. i'd say we should make the d.ts compiler experimental then. people can report what mode they prefer. also, your problem, and this issue, might be solved by #264 ? if paraglide does not compile into src, the tooling problems should go away |
I didn't test against the PR, i can't sure dts has problem or not now because I could make mistake when make it. I don't think virtual modules is completely better solution, because current inlang compilation can be slow (my another issue), and I'm avoiding it by not running that compillation. I can't sure virtual module allows that. |
Makes sense. Keeping both issues then. Users can opt for virtual modules or only emitting declarations files as they seem fit. |
@skbing #273 should solve this issue |
Paraglide JS 2.0 will have an |
Argh... the experimental emitTs directly flag leads to too much overhead.
I considered emitting only TS but that would negatively impact the majority of projects:
Current thinking is:
Thoughts? |
I have been using |
|
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?The text was updated successfully, but these errors were encountered: