T
TanStack6d ago
generous-apricot

What compiler Tanstack Start uses under the hood?

Hey, based on my shallow research, it seems that it uses vite-plugin/react, which uses babel under the hood. Babel is very slow AFAIK. Why use that and not the react-swc plugin instead, if you don't have any special babel plugins in the pipeline, it seems. react-router v7 uses babel for sure as they have some of the internal plugins I think, which is super sad, but for Tanstack I haven't see direct use of the babel capabilities, so react-swc might be good enough to be just drop in replacement with a boost in performance? In case you still see great performance and better build performance than Next.js, then I'm fine with Babel, but I'm not sure it will be as good when Turbopack is fully GA for both dev and production builds. I'm surprised SWC isn't a default thing here.
18 Replies
fascinating-indigo
fascinating-indigo6d ago
GitHub
Start BETA - Tracking · TanStack router · Discussion #2863
Tracking any important changes for TanStack Start during the BETA period. If you are coming from the ALPHA of TanStack Start, you can see all the breaking changes that were made here - #2403
fascinating-indigo
fascinating-indigo6d ago
and soon you will HAVE to bring your own vite react plugin
generous-apricot
generous-apricotOP6d ago
Awesome. Thanks! Perfect. It's exactly what I've envisioned! I guess I'm gonna pick Tanstack Start for my next startup as a more future-proof option in terms of build perf than both Next and React-Router v7. Since you're here. Question. @Manuel Schiller how does Tanstack Start works on a new version release? I mean Is it backward compatible between releases in terms of API routes E.g. you have API route (i assume you have such a thing) and it didn't change
fascinating-indigo
fascinating-indigo6d ago
we are still in beta and have API breaks oh you mean your API breaks
generous-apricot
generous-apricotOP6d ago
Will next deployment will be backward compatible. Or better say. NEW CLIENT New client bundle will be backward compatble with these API routes Or it will require hard refresh
fascinating-indigo
fascinating-indigo6d ago
it depends. API routes (=we call them server routes) are stable i you dont change them
generous-apricot
generous-apricotOP6d ago
That's the problem of verison skew in Next
fascinating-indigo
fascinating-indigo6d ago
same for server functions
generous-apricot
generous-apricotOP6d ago
So if the API didn't change breakingly Then client will be absolutely fine calling this APIs
fascinating-indigo
fascinating-indigo6d ago
however if you change them, then sure your client would need to reload
generous-apricot
generous-apricotOP6d ago
In Next.js especially with server actions EVERY deployment isn't backward compatible With previous deployment No matter if API changes were breaking or not
fascinating-indigo
fascinating-indigo6d ago
oh interesting not with start
generous-apricot
generous-apricotOP6d ago
Yeah, same applies with RSC But that's more or less expected, but not really. E.g. hashes get recalculated and they're hardcoded into client code So when next deployment happens all these hashes become unique making your client side JS not compatible Hence full refresh is required. react-router is very good at all that, but uses Babel 😄 So for that reason I'm looking if Tanstack Start is actually handling these as well
fascinating-indigo
fascinating-indigo6d ago
guess you will like Start then 🙂
generous-apricot
generous-apricotOP6d ago
Will do my research on it later to double check all these things and see SSR functionality in small demo. But sounds super promising.
fascinating-indigo
fascinating-indigo5d ago
So in Next.js, if a user has the site open and you deploy a new version, the old client breaks and needs a hard refresh, even if the API didn’t change?
generous-apricot
generous-apricotOP5d ago
@AMIR yup that's right 🙂 Usually it happens on route change tho. So almost seamless (unless you have some client side state that will need to be restored) You can mitigate that by using Vercel 😄 But that's not an option for many (simply as it's freaking expensive)
fascinating-indigo
fascinating-indigo5d ago
How strange. Anyway, since I’m using TSS, I haven’t experienced the Next.js nightmare on several projects.🙂‍↔️

Did you find this page helpful?