JS API
Hey, I'm interested in using Tanstack Start to build a framework. I would need it to have a JS API though. Basically like Vinxi. I don't think this is possible but wanted to check. I know Vinxi is fading away as a project and soon Tanstack Start will be just over Nitro and Vite directly.
2 Replies
sensitive-blue•6mo ago
what exactly do you need here?
unwilling-turquoiseOP•6mo ago
Here's an example. A CLI that will accept the location of a GraphQL SDL file, or, a URL to an introspection endpoint. Then, the resolved GraphQL Schema needs to exposed as an asset to the a generated app. With Vite, we would use virtual for that. And there is an API for (e.g. we pass an inline config etc.). Furthermore, I would want a bunch of routes for reference docs to be accessible baed on the schema, e.g. /reference/Query/foo etc.
I understand that Vite itself won't help with SSG (static site generation), but TanStack Start would.
I'm wondering if the approach I should take is have my CLI generate application code that fits into the TanStack Start structure. Its a bit more ugly since stringly generated code doesn't have type safety etc. but I guess it would work especially at first.