Closed calebeaires closed 3 weeks ago
It's on the TODO — while the core will remain StandardJS, we'll provide types for everything.
Will update this ticket when it's covered. Thank you!
Is there any update on this? Both Fastify and Vite publish types, so I'd love to have them here as well.
Can we start with something now and improve it or are there other milestones before it can begin? I might be able to help out depending on what you need (if anything).
@jfsiii I'd very much welcome help from TypeScript experts willing to stitch up these missing bits. I'm focused on other areas of as I'm already dog-fooding it, but don't really use TypeScript in my own projects.
@galvez, hi! hope this issue is active!
@galvez would you accept a PR that converts this entire repo to native TypeScript (without any logical changes)?
Any update?
@dimitropoulos please can you start a PR?
I am pretty willing to make such a PR, but I want to get an affirmative "go-ahead" from whoever would actually review/approve it before I start. I've been burned before with spending time converting a codebase to TypeScript just to later find that it's not a welcome change, so I always like to ask first.
Ok
FYI @galvez
Not sure if this is the right thread, but I saw https://github.com/fastify/fastify-vite/pull/118 incorporated into the v5 release, but the types don't get bundled as the package json
still excludes them. Was this an oversight or intentional?
Edit: I just noticed that this also includes the new utils export.
Virtual modules aren't supposed to work in TS projects right?
You can eject all of them, refactor into TypeScript and then just make sure index.html
and index.js
are loading the TypeScript versions. This will be available out of the box in the next minor release, just want to make sure I have worked out all the kinks. If you do that and want to contribute your working setup as part of packages/fastify-react/virtual
, that would speed up the process!
Any update / timeline on typescript support? @galvez looks like v6.0 will have typescript support for Jan 2024. Is that still on track? Thank you for all that you do.
We already have some stuff in dev
waiting for a release, lots of new types etc.
Both @fastify/vue
and @fastify/react
will have TypeScript versions of its virtual packages in the next minor release.
I should find some time to prep over the week!
We already have some stuff in
dev
waiting for a release, lots of new types etc.Both
@fastify/vue
and@fastify/react
will have TypeScript versions of its virtual packages in the next minor release.I should find some time to prep over the week!
Sounds good! I will take a look.
Anything new here?
I'd also be pleased to know when it's going to be released.
With this plugin, I can't figure out when I'm supposed to use tsc
to compile my server code. The docs just say to use node server.js
to run it, but I have server.ts
. Does anyone have an example of some working package.json
scripts using this plugin while writing the both the browser code and the server code in TypeScript?
Any news?
It was difficult for me to figure out how to use @fastify/vite with TypeScript. Especially how to organize the code, the two separate tsconfig.json files, and when to call tsc vs vite build. Through a lot of trial and error I have arrived at this solution.
Please browse through and read the code to see what I did. I hope it is helpful to you:
https://github.com/onlywei/fastify-vite-typescript-boilerplate
c.c. @mattkrins @admenmod @piotrgrundas @calebeaires
Closing this issue as we now have a working TypeScript example for reference.
Future versions of @fastify/vite
will be written in TypeScript itself further improving support.
This project is amazing. Would be great to have an example using typescript at both side: server and Vue 3