Add @fastify/tanstack renderer for TanStack Router SSR#421
Add @fastify/tanstack renderer for TanStack Router SSR#421jamcalli wants to merge 5 commits intofastify:mainfrom
Conversation
|
|
Hi @jamcalli -- biggest problem with this is that I don't have permission to create more packages under the |
|
That is a bit of a problem. I gave your implementation a once over. Your Start use case is useful for sure. My approach was to include just the TanStack Router as a renderer mirroring how @fastify/react and @fastify/vue are handled directly within the Fastify-Vite. How would you go about obtaining permissions? It seems like something that should be obtainable given the nature of shipping the plugins as individually installed packages. I'm sure there will be interest in including Svelte etc. somewhere down the pipeline. |
@onlywei |
|
@climba03003 If you're able to help, #345 is higher on my priority list than this one. I haven't fully decided whether it's better to just support Tanstack Router or fully support Tanstack Start yet. I think that's worth a discussion with @jamcalli here. |
I personally find TanStack Start a bit opinionated. The renderer approach handles route discovery, streaming, dehydrating router state, and preloading assets while allowing Fastify to handle everything else. It's more aligned with the existing renderer plugins. The full Start appears to hand most things off to Start's built handler, and Fastify becomes more of a host. I think the approaches are largely mutually exclusive. This was just something I was messing around with though, and I'm not trying to argue that it should be included. Ultimately that's up to you, but I thought it was worthwhile submitting to see if you'd want it upstream. |
Hi,
This adds a @fastify/tanstack renderer for TanStack Router SSR support.
I've been working on this in my own fork and it appears to be working well. I haven't included documentation updates yet as I wanted to check for upstream interest first. Totally understand if it's one more thing to maintain. I did include an example at examples/tanstack-vanilla-ts.
The PR also aligns the RendererOption/RendererFunctions types in renderer.ts with the actual runtime signatures. The existing types had drifted from options.ts and the runtime call sites. This was surfaced by building the first TypeScript renderer.
Cheers.
Checklist
npm run test && npm run benchmark --if-presentand the Code of conduct