In short
Podcast Episode Notes: TanStack and the Future of Frontend with Tanner Linsley
Episode Overview Podcast Title: Software Engineering Daily Episode Title: TanStack and the Future of Frontend Description: Discussion about TanStack, an open-source collection of high-performance libraries for JavaScript and TypeScript, including insights from Tanner Linsley, the creator of TanStack.
---
Key Topics Discussed
Introduction to TanStack
- Definition: An open-source collection of high-performance libraries focused on state management, data fetching, and table utilities.
- Notable Libraries:
- TanStack Query: Previously known as React Query.
- TanStack Table: Initially created as React Table.
- TanStack Router: Designed for routing in applications.
Background of Tanner Linsley
- Transitioned to full-time open-source work on TanStack after running a startup called Nozzle.
- Previous experience included working with Angular and Ionic.
Core Features of TanStack Libraries
- Declarative APIs: Enables easier and clearer coding practices.
- Optimized Performance: Focused on efficient data handling and rendering.
- Developer-Friendly: Tools designed to improve developer experience.
Discussion on TanStack Start
- Overview: TanStack Start is a full-stack framework similar to Next.js and Remix.
- Architecture:
- Emphasizes server-first mentality with server-side rendering (SSR) and hydration.
- Allows for Single Page Application (SPA) behavior after the initial load.
- Routing: Based heavily on TanStack Router with a focus on isomorphic rendering, where most components render on both client and server.
Server Functions
- Definition: Functions that can run on the server during SSR or make RPC calls from the client.
- Features:
- `createServerFunction`: A primitive to create server functions with built-in type safety and validation.
- Support for middleware, making it easier to manage authentication and observability.
- Validation can be defined using standard schema-compliant validators (e.g., Zod).
Type Safety in TanStack Router
- Type-Safe Routing: Allows developers to benefit from TypeScript's type safety without needing extensive type annotations.
- Comparison with Other Libraries:
- Unlike other libraries that require explicit type definitions, TanStack Router infers types automatically, making it easier for developers.
Future of TanStack
- Solid.js Integration: Announcement of TanStack Solid Router and plans for a Solid variant of TanStack Start.
- Nitro and Vite: Transitioning to Nitro for server-side functionality to enhance deployment flexibility.
- Enhanced Server Components: Upcoming ability to use server functions that return React code.
AI in Development
- Tanner's Use of AI Tools: Uses ChatGPT for personal and professional tasks, highlighting the shift from traditional search engines to AI as a tool for coding assistance.
- Learning and Speed: AI assists in speeding up development and learning new APIs or patterns.
---
Key Takeaways
- TanStack is a Comprehensive Toolset: It provides a robust solution for modern frontend development with a focus on performance and usability.
- Developer Experience is Central: Emphasizing ease of use and type safety ensures that developers can focus on building applications rather than wrestling with complexities.
- Future Developments are Promising: Ongoing enhancements and multi-framework support indicate TanStack's commitment to evolving with the needs of the community.
- AI as an Ally: Embracing AI tools can significantly increase productivity and facilitate learning, although it may not yet understand the nuances of every new framework.
---
Conclusion The episode offers valuable insights into the evolution of the TanStack libraries and their potential impact on frontend development. Tanner Linsley’s vision for TanStack highlights the importance of community-driven open-source projects and the company’s focus on developer experience and performance.
For more information, visit the [Software Engineering Daily website](https://softwareengineeringdaily.com).
Written by AI. May contain mistakes. Listen to the episode to check what was said.
Transcript
Automatic transcript. May contain errors.0:00TanStack is an open source collection of high performance libraries for JavaScript and TypeScript applications primarily focused on state management, data fetching, and table utilities. It includes popular libraries like TanStack Query, TanStack Table, and TanStack Router. These libraries emphasize declarative APIs, optimized performance, and developer-friendly features, and they are increasingly popular for modern front-end development. Tanner Lindsley is the creator of TanStack, and he joins the podcast with Nick Neesey to talk about the project, SSG, type safety, the TanStack Start Fullstack React framework, and much more.
0:40Nick Neesey is a conference organizer, speaker, and developer focused on tools across the web ecosystem. He has organized and emceed several conferences and has led Nebraska JS for more than a decade. Nick currently works as a developer experience engineer at WorkOS.
1:10Tanner Lindsley, welcome to Software Engineering Daily. How's it going? It's going great. How are you? I'm doing fantastic. Why don't you tell us a little bit about yourself? I make software, primarily open source software now. As of about almost a year ago, it marks when I went full-time on Tanstack. So it's going really well. Before that, I was running a startup with some friends called Nozzle. I spent 10 years there solving difficult front-end problems, which explains why a lot of the tools I have today exist. Yeah, that totally makes sense. Before that, I was like an Angular, Ionic junkie who was making money off of WordPress.
2:02so I actually it's funny I actually learned how to write javascript kind of through angular 1.x it was a weird experience and then afterwards I was like oh I need to learn javascript so that's kind of where I got my start into js but now yeah I wake up in the morning and I eat, sleep, and breathe TanStack open source and make sure that it's helping people. Nice. Well, anecdotally, I can say that it is because it has helped me a ton and many, many others. My first introduction to the TanStack would have been through React query, now TanStack query. Where did that lie? Was that one of your first projects?
2:46Was it the first project in the TanStack? No, the first project actually was TanStack table. Back then it was called React Table. That was one of the very first ones that I wrote that is still around today. Yeah. So I wrote React Table way back. We needed it at Nozzle. I have a video from React Summit in like 2020 something. I can't remember. But I talked about React Table. That's a good one if you want to go check that out. But from there, after that, I wrote React Static, which I don't maintain anymore. It's unmaintained, I think. But this was back when SSG was really, really hot. And at the time, it was Gatsby and Next.js were really up and coming, and they were doing really cool things.
3:36And I put my hat in the ring, and I started building React Static, which was like this framework, essentially, before server frameworks really took off and it was good. It was fast. So back then everybody was like, how fast can you build your static site? And for a while I was killing Gatsby and Next because I was doing, I think I was one of the first ones to do multi-threaded builds for SSG. So like if you had multiple cores, you you just zoom. And I got pretty good at React static stuff. And then we realized that like, I wasn't using React static at Nozzle very much. We didn't use it. It was just kind of fun.
4:21So I was like, you know, maybe I shouldn't put all my time into this. And then Gatsby raised like $30 million and Next.js raised, I don't know what their first round or two was, but like the next round they raised was like several tens of millions of dollars. And they're like, yeah, and we're going to be dumping everything we have into Gatsby and Next. And I was just like, oh my gosh, well, I don't really have the time or the money to compete with this right now. So I decided to throw in the towel. I gave React Static to a company, a group of people that, you know we're gonna keep maintaining it and then after a while I just switched my SSG to next and then after a while I just stopped doing SSG not really I mean we kept using it through next but then everything started become more hybrid and then it just became like a lot of caching a lot of CDN caching type stuff so it's all server driven now I'm starting to get back into SSG a little bit.
5:26So TanStack Start is going to have already has some like static site generation features to it that are pretty cool, in my opinion. It's kind of like bringing back React Static for me, because it was a lot of fun. Nice. Well, yeah, let's let's dive into that and talk about TanStack Start. So it is more of like a full framework on the level of, would you say, like Next and Remix and kind of like at that level? Absolutely. Yeah. So it's a full stack framework, which just means it has a server first. I mean, it has a server first technical mentality to it. So just like Next.js and Remix, it's doing full SSR and hydration.
6:11We're running that server on deployed servers somewhere, whether that's serverless or long running or whatever. And then it still becomes an SPA, just like many other full stack frameworks. So once you've hydrated and streamed the response down, it becomes an SPA. And most of it is just based on TanStack Router. I would say like 90 % of the APIs that you use or are going to use when you build a TanStack start app, you're just using TanStack Router. start is actually pretty unrelated to a lot of the public API that you touch. There's obviously a lot of dependency on TanStack router and start to do the hydration and the streaming and kind of take care of the black box stuff that nobody really ever wants to touch the implementation details of.
7:07But then in design for how you interact with it, all of the routing and all of the application stuff is very separate. So if you're doing something with server functions, that comes from start. If you're doing something with SSR, you don't have to worry about that. You just use the router. So most of the time, you're just writing an application as if you're writing a good old SPA. And the reason that works is because it's isomorphic. So by default, and this is how Remix is too, we're rendering everything on the client. We're also rendering that on the server during SSR, unless you explicitly say like, hey, don't try and render this because we're using local storage or something like that.
7:54But otherwise, everything runs during SSR and on the client by default. And that's a pretty big departure from Next.js app router, where they're pushing everything kind of like, hey, not everything runs. Well, I mean, I guess client components. What a bad name, client components, because really, they render on the server too. They're isomorphic, right? So the mentality is just in like the difference of developer experience. With a TanStack router and Start app, it's much more like Remix where you feel like you're writing an SPA and you're kind of opting in to server-specific features and server-specific things as you need them instead of kind of having those server features thrust upon you.
8:49Yeah, like a good example of that is loaders. I mean, even Remix in their loader pattern, loaders are server only. They only run on the server, right? For us, that's not the case. Loaders run everywhere. They load on the server. They load on the client before you navigate. But if you do want to run something only on the server, that's where you reach for a server function. So you can create a server function, and then we will guarantee that it only will run on the server during SSR. or if you're on the client, it will make an RPC call back to the server to make sure that it runs that logic there.
9:27Nice. And how do you define a server function? Is it in a somewhat familiar way, like use server, like a pragma like that? Yeah, we have kind of two flavors. The first base layer of support uses the use server directive that you're going to see almost everywhere. Like you'll see that in React because they're trying to make it a standard thing. You know, like it's a bundler feature, like use server. We support that. So if you want to make a function and just put use server inside of it at the top, little string literal directive, that will work. We'll extract it and put it on the server, do a little RPC.
10:10That works. You can do that. But that's not what we recommend. Mostly because it's lacking. It lacks a lot of features, a lot of things, in my opinion. So if you've ever tried to do like validation or middleware, or maybe you have a server function, but you want to wrap it with some client side functionality to, it just becomes unwieldy because it's this function that gets extracted. And the lines between client and server get really blurry sometimes. And it's like the implementation gets a little blurry too. Like, okay, so when I call this function on the client, what is exactly happening, right?
10:50It's okay, it's creating a fetch. It's doing a fetch call to my server. What kind of fetch call? Are there headers involved? Can I modify those? Is it a get or a post? You know, is it just sending raw response back and forth? Is it doing serialization? Because there's a lot of questions around like, well, can I send maps and sets and dates and things like that? And will they get, could I use super JSON with this, right? And when you talk about those features, like the use server directive kind of is unwieldy. It's not fun to use. So we created a primitive for Tanstack start called create server function.
11:32and if you've ever used trpc it probably will feel a lot like creating a trpc procedure or or mutation or query so you call create server function and already inside of there you can start customizing to say this is a this server function should use the method get or method post so you You can start customizing things about how is this going to go back to the backend. You can also start adding middleware to that. So you can chain off of their.middleware and pass an array of type safe middleware functions. And middleware can not only change and read the payload and the result that you're getting back with a server function, But there's secondary channels on top of that network IO for context.
12:29So middleware can even send context between the client execution and the server execution and back again to the client without you needing to worry about passing any of that information at the call site. So for instance, we helped Sentry create a middleware for server functions that does full observability from client to server and back to client again. And all you do is add a global middleware and every single server function now has observability in it, which is way cool. You can use it for authentication and things like that. and then there's also validation which is where trpc is a really big one like trpc we're very type safe first right and type safety as soon as you cross the network type safety is kind of fake unless you control it end to end which i mean if you're doing full stack you could pretty much guarantee like that most of the time it's going to be like if you just share the types, you're going to be okay.
13:41But we wanted some extra security around things, and so we added first-class validation support for server function payloads. So what you can do is you can say.validator, and you can pass any standard schema-compliant validator. So Zod, archetype, valibot, or you can just write your own if you want. It's just a function that takes input output with types and you can actually do runtime validation and you can also say so validation by default only runs on the server but if you wanted to you could turn it on for the client too and get early early errors from from the client that's what i was going to ask is if it was just on the server or if it could be on both and that sounds amazing a question i have on that with the the validator so like if you have something like you're using you know the zod validator and passing in your schema, I assume it's giving you some kind of like standard, like it's going to throw some kind of standard error then.
14:41And then you handle that in a pretty standard way across everything. Yeah. If you use Zod and it throws, so if it's server only, we have a serialization utility behind the scenes that's making it so that we can serialize basically anything from the server back to the client. So when it throws on the server, we'll take that error, we'll package it up, we ship it back to the client and we'll re-throw it on the client and you get to respond to that ZOD error however you want. Okay, nice. And you can respond on both sides too? Yeah, if you wanted to. So on the server side, the base validator can throw and you can kind of wrap that in a catch if you want and say, oh, we'll do some extra server side logic here if we want.
15:27The default is that if it doesn't validate correctly on the server, it'll just go back to the client. And what's cool about that is validators by default are server only. So if you use Zod in a validator or something like that, we actually rip Zod away from the client package. So even though you're defining these functions right inside of your SPA kind of isomorphic code, the packages that you use inside of the server handler or like the validator, they get ripped out of the client so that you're not shipping Zod to the client, unless you want to. You can just turn on client-side validation too, and then we'll ship it.
16:07Got it. But then on the client, it's giving you those Zod errors or how is that? Yeah. So on the client, what happens then is we will run your validator client-side before we send the fetch request out on your payload. Okay. So it'd be a different validator. Yeah. Well, no, it's the same validator for now. we we have a to-do item to make it so that you can customize and say here's a client validator if you want to do that we haven't had anybody ask for it yet but it would be a pretty simple change but yeah that's the idea it's it's very we want it to be like anything you can catch on the client do simply now you know skip the network io otherwise just send it to the server so now speaking of type safety one of the big features that i see come across and this might be more of like a 10 stack router thing and a 10 stack start thing because, and correct me if I'm wrong, but the big difference obviously is like the server side functionality of 10 stack start, but then also like there's file-based routing within that.
17:06Is that true? So the router itself has file-based routing. If you, even if you don't use start. Oh, okay. Yeah. And that's just part of 10 stack router. Yeah. Just part of 10 stack router. So the router itself had nothing to do with server side, anything, but just the router itself has a VEAT plugin and a CLI. and in fact it even has an rs pack and web pack plug-in as well so you can run these plugins and and we support file-based routing and those plugins are there to give you like the full breadth of type safety that we can offer file-based routing is actually the best way to get that otherwise you end up wiring a lot of things together if you use code-based routing yeah for sure now i want to dig into that a little bit just like what does it mean to be a type safe router because I see that touted as like a huge feature.
17:55And to be honest, I haven't dug into it enough yet to fully understand that. So could you explain that to me? I think the best illustration of what we mean by that is if you go to any example or pretty much any application that's built with TanStack Router and go look at the route definitions, go look at creating a route and using route APIs. and you tell me how much TypeScript you see in those files. And I'll answer that for you. It's probably none or maybe just a little bit. If you have decided to abstract some things on your own, you got to make your own function signatures or whatever. But for the most part, you can just write with TanStack Router and never need to cast anything or write type code at all or annotations.
18:51You never have to narrow manually. So it honestly looks like you're just using JavaScript, but it is 100 % type safe behind the scenes because everything is inferred. And what we mean by that is there's a big difference between libraries like Next.js and React Router that they're written with TypeScript and they do have types, but most of the time you need to remember to put those in there. You need, you know, there's some step involved where you need to get involved to some level to make sure that things are going to be type safe. Like providing a generic, something to a generic. Yeah. Providing a generic or even with React routers new stuff, you have to remember to import the types and then grab the right types off of that file and put them where they need to go.
19:55Or even there's like Next.js and Remix, they both use like a link building utility where you have to remember to use the utility. And the bottom line is that these other routers that aren't type safe, they will allow you to write unsafe code. And I mean, that's fine. They've been around longer than us. They need to support that. We could have done that too. I wrote a router called React Location that allowed you to write unsafe code. But I didn't want that. So not only do we make it really, really easy to just write type safe code, but we also make it somewhat difficult to write code that's not safe because it's just inherently built into the entire architecture of the router.
20:47from the minute that you define your router and your routes and start going down into, you know, components and loaders and things like that, search parameters, everything is fully inferred. And all of those generics, I mean, if you just want to see how many generics we have in TanStack router, go look at the source code for TanStack router. And you'll see some of our functions have 20 or 30 generics being passed around, which is fine. You know, we we're taking on that complexity so that you don't have to. And what you get is a system that even for junior developer or somebody who's new can come in and, and get the docs and, you know, use autocomplete and write code that essentially guides you to the happy path, discourages you from making mistakes without you needing to even remember, oh, I need to make sure that I cast this as type save, or I need to make sure I remember this generic, or I hope I'm importing the right file here, or something like that, you know?
21:56So I gave a talk at Utah JS last year that was around TanStack router. And it kind of went over all of the different ways, kind of a long form answer to what you asked. And like, what is the difference between writing something with TypeScript and writing a type safe system? And it shows you firsthand like, oh, this looks type safe, but it's actually not. And let's show you why. So I would recommend going and watching that video if you're interested on that topic some more. Yeah, for sure. And this is why the type system in TypeScript can be so complex is so that you can hide away a lot of that advanced type safety from end users and they can just benefit from it.
22:44And I won't lie, it's really grueling work. I started the adventure of type safe routing four years ago now. In the first two years, I didn't even write any runtime code. I was just messing with types and trying to figure out how could I even architect this in a way that wouldn't require crazy, crazy things. At the end of the day, I found a way. After we had exhausted every possible avenue of doing this without language service plugins or massive amounts of code generation, we had done everything we could with the native TypeScript features. Then we went in and said, okay, how can we make it a little bit better now?
23:28And that's when we added one file that does some code generation, right? And that's it. That's what the plugin does. It generates one file that's just creating some shortcuts for TypeScript. One of the most interesting things about type safety is that TypeScript has no idea what a file is like in a file system. It has no idea about what file you're in or, you know, like the hierarchy of your file system. And that's a very important thing if you're doing file-based routing. Yeah. For like sub routes and things. Yeah. Nested routing. And so we had to come up with a way to teach TypeScript about the file system that was performant and lazily evaluated and performant enough to scale to tens of thousands of routes that wouldn't crash the TypeScript language service.
24:31Christopher Herobin is really the TypeScript junkie who's behind a lot of those performance hacks. He's a very, very smart person. We got really far, but he's the one who came in and has really put on like the last buffed out polishes on the type system for tan stack router. Like I proof of concepted it and I, I made it work and I made it work, right? He's making it work fast. So nice. Nice. So you mentioned working on just like pure types for a long time without actual any runtime code. I'm curious, did you use any way of doing automated testing to ensure those types were correct? Or how do you approach that when you're not actually writing runnable code?
25:20Well, I mean, if you're just writing just pure types, you can go really, really far without needing testing because something will just not compile or break if you're doing it wrong. Yeah. So TSC is your test? Yeah. And at some point though, it gets to be big enough to where you need to guard against regression. So when we were just building fresh, it was just like, yeah, TSC is good enough to like get this to check ourselves. But then when we say, okay, we figured it out, solidified it, we needed the tests are more for like regression catching. We just use the test and we write our own.d.ts files and we use the tests TypeScript stuff to say, you know, expect this type to equal this type.
26:09And for the most part like that, not for the most part, it works great. Yeah. So we'll go through and we'll, we'll change the types or fix bugs or whatever. And it will say, Hey, you know, like you're, you're, you have a public type contract that you're breaking. We don't do that for like private internal types. We only test public types so that we can go in and mess things around and re-architect the types if we need to, as long as we have those outer contracts, we're good. Yeah. And that's exactly why I was asking about that is like, I'm kind of in the mindset of thinking about the developer experience and specifically, like you said, not regressing it.
26:49And so having like a way to ensure that, you know, this is not just going to give you some weird type or some like unknown or any type, like it's going to be what it always was. Yeah, we have extensive type testing as well. So just for router, we have over 200 test suites that run just for like all the packages in router. It's a lot, which is a stark contrast from about a year and a half ago, we had zero. So big props to my team. They're much better at writing tests than I am. so sean cassieri and manuel schiller are like and and chris christopher robin on the type side but like they're all much better developers than i am another question i have around router and tan stack start those are both in the react ecosystem right are there plans for them to kind of follow other Tanstack projects and kind of abstract themselves from React and be more multi-framework supported?
27:58So I was actually on stream about a week ago with Ryan Carniato. We officially announced Tanstack Solid Router. Oh, wow. Cool. So that's already out. Fully tested, passes all the tests. got the sign of approval from, you know, a lot of the solid team. In fact, the Burke and I think Burke and his name's Brenly. I always knew his screen name is Brennell's, but Burke and Brenly from the solid JS team, they really liked 10 stack router and start. And they only started on it like three and a half weeks ago. They're like, Hey, let's write an adapter for solid. they threw in the test suite and they just started cranking away passing tests and then like we're done i was like what the heck so so we launched tan stack router for solid last week and it works great and then i just got a message this morning from let's see i want to double check who it was it was from brinley he's like uh hey so just so you know tan stack start for solid is pretty it's pretty much working that's amazing are you joking so i mean there's some there's still some things to like polish up, but it's incredible.
29:12So we actually, we named it tan stack start because I knew that router was probably going to go to other frameworks, but I didn't know if start would. Well, just a couple of days ago, Manuel Schiller on my team, he's like, Hey, by the way, we're renaming tan stack start the package to tan stack react start. And I was like, Oh, Oh, oh and he's like yeah it's so there's going to be there already is an internal package for at tan stack slash solid start which is can be confusing because there's also solid start but it's a work in progress on in terms of like how we're managing those two projects like solid start and Tanstack Start, we are working very, very closely with the Solid team.
30:02They are in the Tanstack org. We're in their org. We are cranking on some really cool stuff right now. So Solid Start is actually already using a lot of the new plugins that we built for things like server functions. So the stuff that I told you 10 minutes ago about server functions, 15 minutes ago, we built our own plugins to do that in a way that's like framework agnostic so you could do it across react or solid or whatever and it's pretty validating that that abstraction like on top of like server components and things that are more react specific yes like like the use server directive there's a package called like tan stack directive functions plug it it has nothing to do with react it's just like set it up you can inject your own runtimes into it that can call into your own code.
30:55And we made it like, I mean, in TanStack fashion, I made it extremely like inverted on control. So we put it in and then solid, the solid team Burke and Brennan were like, oh, let's replace the one in solid start with this. So they swapped it out. And then even Brandon who made analog JS, he was like, oh, I'm going to swap mine out too. And so he swapped his out to use this server function plugin and then dev agrawal he's like oh i'm i'm doing something for signals i'm going to use this for signals too so like he swapped it out for signals because it's a directive plugin not a use server plugin so you can actually support other function directives if you want to extract them out which is kind of nuts i think he's playing with something like use socket and then it like it extracts it out and you can do like custom socket logic on client and server like it's cool stuff so needless to say we're working together very closely i don't know if solid start and tan stack solid start are going to merge someday i'd say it's a possibility but it's more likely that they just kind of take on different roles where solid start might be just kind of the example framework to say, hey, this is how you can do a router agnostic full stack framework on top of solid.
32:26Check it out. And it's scoped down a little more, kind of like this is a good way to learn about it or just you do something simple. And then Tanstack Solid Start will be more of like a full-fledged product that you'll say, okay, we really want to use solid and we really want to have like a full-fledged like meta framework that's going to, you know, benefit from extra stuff. So maybe we'll use like Tanstack Solid Start. So that's probably where it's going, but we'll just have to see. We're all just kind of playing it by ear. It's just like, let's, let's just go out there and build cool stuff that we can share and see what happens.
33:10So, so far so good. I'll say that's amazing. You've had this ecosystem of tan stack products for a while, right? Query form table, and now a router and, and a whole like framework. Do you see them working together as like an ecosystem where developers could be like pick up and build pieces with like with these individual pieces and build on top of them? to then support like these more top level solid or react framework level things. I mean, I can say that's already happening. It's already happened. Yeah. Because we have framework adapters for all of the other libraries already. Some of them are more mature than others.
33:51And a lot of that is just based on the popularity of the framework and how many people use it, right? Like Svelte table needs some love, but there's not a lot of Svelte devs out there who are also like, Oh, I'm going to use Tanstack table and let's, and then let's, let's make it better. Right. I mean, so some of it is just talent there, but the adapters are there and they work. You can wire them together if you want, or you don't have to. I definitely like our goal is to stay away from some kind of like monolithic structure where everything only works well together. And they only like they have better support for each other than they do for other things.
Read the full transcript
34:32Like we want to make sure that it's more like Unix style composable blocks that work good with everything. Like if the right APIs are there designed with good inversion of control, they should work good with everything so actually two weeks ago jack harrington built a new tool called create ts router app and it's it's a drop-in replacement for create react app really yeah other than some things some differences between webpack and and modern so like it won't support like it doesn't support like old school es5 output and stuff like that but for all intents and purposes, it is a drop-in replacement for, oh, I was going to use CRA.
35:18I'm going to use, I'm going to use, you know, CTA. What's cool is you can just say NPX, you know, create TS router app drops in and it looks exactly like CRA, but then behind the scenes, you go to like that main, that main app file. It looks exactly the same, but if you go up a level to like the main entry, you'll see that we've already set up TanStack router for you just with a single app, you know, or a single route that's just going to this one component. And, and you're like, well, what if I didn't want code-based routing with file-based routing? Well, then you can add a dash dash file router to the create TS router app and it will give you file-based routing.
36:02and then you're like oh what if i want to use solid you can do dash dash solid now and it will do create react app essentially but with solid instead using 10 sec router for solid and then going even beyond that we have add-ons where you can say dash dash add-ons and it brings up this select list where you're like, oh, I want to add Tailwind, Shadzian, Century. I want to add Netlify stuff, like a demo for Netlify things. You can just check off a bunch of stuff and we will install them, give you demo pages for them and wire it all up for you. And then we also have templates too, which is Create React.
36:50I've had templates as well, but like we have a template called Tan Chat that's coming out. That's like, I think it's an anthropic, you know, hey, here's just like a really demo, fun Tan Chat thing. Sentry has an example that you can trigger, you can manually trigger errors in a couple of different places and watch them come into your Sentry dashboard live and with full stack observability. It's really cool. Not that it matters. I'm just kind of like thinking, but I know that like with React App, it was kind of doing like this weird managed thing where it was, it wasn't exposing you directly to Webpack, right?
37:27It had like a minimal configuration. Yeah. Like they had their own package called creates react scripts. React scripts. Yeah. No, we're not doing that. That's I think that's dumb. So I mentioned to somebody that it's almost like pre ejected in a way, but, but not in a way that Webpack was where it's like, now you have this huge Webpack config to handle. Like really there's a Vite.config.js file sitting there and you're like, oh, it just works because we're using the React Vite plugin and it works great. And if you want to go in and add anything or do anything with Vite, you just add the plugin, you do whatever, you know, and it's like you can still upgrade Vite and upgrade your plugins and upgrade the tech, even though you're customizing things.
38:12Right. So it gets away from that. Like, you know, you're locked into this, like, we're going to fully manage everything for you because we don't trust you. I mean, that's essentially, I mean, with Webpack, there was good reason around that. It's like, I wouldn't trust a lot of people to do that either. But with VEAT nowadays, like I trust people with VEAT, like, go ahead. Like there's, there's only a few things you could probably do that will mess things up terribly. And you can always just roll it back or, or whatever. So. No, that sounds definitely like a better approach. And that's kind of why I was asking, because there's such a great ecosystem of tools like within V itself that hiding that away or making that more difficult to adopt anything else like is almost a detriment.
38:51But it sounds like you're obviously doing the right thing. Well, what's cool, too, is it works with start. So start start is currently in beta. Right. And for now, for today, still, we use Vinci as like the as like a little runner. So you say like Vinci start Vinci build or whatever. I'm actually working on Dvin internally. We call it DaVinci, which is DaVinci, but we're working on just using Nitro and Vite directly, like a Vite plugin. We wanted to do that from the beginning, but we just needed to move fast. So Vinci let us do that. But now we're to the point where we're just getting rid of like superfluous stuff.
39:33And we could talk about that. We don't need to, but anyways if you add dash dash start to that create ts router app command you'll get a start app and it will actually look exactly the same as create react app but it's server side rendered has routing installed already it's pretty cool yeah i'm obviously biased but i think it's the best way to start a new app these days nice yeah i'll definitely have to check that out as I'm constantly creating new apps. You did mention TanChat, and that got me thinking about AI. And so I wanted to ask you what AI means to you kind of day-to-day. Like, are you using it, your day-to-day development, or like, what does it mean to you?
40:18Yes, I pay for ChatGPT, and I use that all the time just for personal stuff. And I mean, I basically use it instead of Google now. And actually can't remember the last time that I use Google to like research something. I use Google all the time to like search for a site that I need, that I need to go somewhere, you know? So it's, it's more, it's become more like AOL, what was it? AOL keywords or something like that. Do you remember those? Unfortunately. Yeah. But Google now is less of like a research tool for me or like question tool. I just send all that to OpenAI, chat GPT. And then for programming, sometimes I'll use GPT because it's just options-based and it's just kind of there.
41:06But I'm using way more Cursor lately. Really like Cursor. I still think it's better today than what Copilot has and what Windsurf has. They're all really good. But Cursor is just amazing. And I don't even use a lot of the agent stuff. for the kind of code that I'm writing. There's not a lot of prior art out there. So I don't really trust agents to go and write the kind of library code that I'm writing. When I'm building an app or a site or like, you know, templating some Tailwind or something like that, like, oh yeah, like sick an agent on that and let them write kind of the grunt work stuff. But for me, it's way more of a utility to say, to have cursors sit on top of like the tan stack router repo and see and index all of the the patterns and type utilities and things that are inside of our entire code base and then for me to go and try and write a new feature it's helping me remember like oh yeah you have this api i'm going to use it you have you use this pattern here let's use the same pattern here and it's it's frighteningly smart at auto complete and just like taking my ideas of like, oh, this is how I want to architect this thing.
42:29And it just kind of like tries to read my mind. And because it has enough context in my projects, it usually does. And I wouldn't say for me, it's not necessarily coming up with novel ideas for me. Instead, the two places that I think that it does help is it just helps me go faster. so gets my ideas out faster. I don't have to type everything. I mean, even Copilot was great at that, even if it was one line at a time. So it just helps me go faster. And also it helps me when I brush up against areas of programming or other like APIs or services that I'm not super familiar with. I'll kind of be like, hey, I think this is what I need.
43:16And then it will kind of autocomplete. And I'll be like, but that doesn't work. So it's almost like a learning tool as well to like learn fast to say, Hey, you know what? I don't know how this node streaming API thing works. So I'll just be like, command K, write me, you know, this logic, but I need you to use node streams and I need you to convert them to web streams. And then I'm watching it go. And then I'm like learning as I use it too. Yeah. Yeah. And I mean, that's a fantastic way to put it. Like we're no longer really in the world where we're staring at a blank, a blank file and like figuring out how to get started.
43:55Like you can just throw something out there and you're, you're good enough to know this is close or not close at all. And kind of refine it from there, either with AI's help or manually. That's how I'm approaching it as well in my day-to-day work. It's kind of like a lot of managing context. That's a great way to approach it. And I would also say on top of that, there's, there's always going to be discussion about, you know, is AI going to replace me? or whatever. And I get asked that a lot in like private DMs or whatever. It's like, are you worried about this? And to that, I would say, look at how much code you're writing that the AI is currently unable to do correctly, right?
44:31If that is close to 0%, then you're going to be replaced soon. If it's 50%, man, you're fine. You know, like if 50 % of the code you're writing is impossible for an AI to figure out how to do correctly, you got good job security. you know? And that's for me, like if I, if I ever get to the point where like, oh, I'm not writing, you know, it's like, oh, AI could write all, you know, design me a type safe router repo to be used by every, everyone and everything, you know, and their cat and dog or whatever. As soon as it can do that, like I, I've got to evolve, you know? So that's usually a good measuring stick for me.
45:13And, and, you know, when you, I think when you use that measuring stick, There are actually very few people who are truly just YOLOing some AI code out there. And, you know, without even being able to say, oh, I got to test it and try it and debug it. Right. But it's getting there. It's pretty scary how good some stuff is that can one shot things. And you mentioned prior art and like how it's not super useful for that. Like there's not a lot of prior art in what you're doing. and I think that coming at it from like another perspective you are in a unique position in that you're like releasing a framework within the last year where there's not a lot of prior art for these models to be trained on specifically so I'm just curious like you know Next and Remix and all of them do have that prior art the AIs can have a little bit of context to help but they won't know a lot of the new features but it's like a feature thing if I ask an AI about Tanstextar I haven't by the way, but if I did, it might not know much of anything.
46:14And just like, as a, as a author of a new like framework and paradigm, I'm curious if that's something that's on your mind of like how to approach that or how to help developers get over that hump of my chat GPT is not going to be able to help me create a server function. Cause it doesn't know what that is. Yeah. Some of that is just time. Like time will heal that to some extent, you know? And I also think that there's like, there's entropy that needs to happen for us. And I'm willing to be patient for that. There's also atrophy for, you know, outdated and old patterns for other frameworks as well.
46:50Like now there's, you can go to next and say, Hey, or say, Hey, write me a next app or write me a, write me a react router seven, whatever. And you're going to get pages router and you're going to get React Router 6 or Remix or something like that. So there's challenges all around. I would rather have the challenge of, hey, you know, they haven't indexed us yet. They haven't been trained on us yet. And you can use tools like Cursor to point your stuff towards our documentation. Or we also, I can't even remember what it was called because that's how new it was. but it's a, it's like a protocol for AI tool protocol.
47:32What's it called? MCP MCP. What's it called? It's called the model context protocol. So we are adding support for tan stack to be like an MCP service so that you can point your MCP compliant or supported thing at Tanstack and say, okay, Tanstack is now a tool, like a utility of knowledge. You know, it can use our database as a way of teaching you how to do better stuff. So looking at things like that, I just think I'm not necessarily worried about it, mostly because the same things that I would be doing to teach an AI are the same things I'm going to be doing to teach users. I have to, we have to make sure our documentation is outstanding, plenty of examples, get more and more people writing projects with it that are open source and public that use the good patterns, resisting breaking changes, resisting, you know, stuff like that.
48:38So it's almost okay that they're not indexing us yet because it's still beta for start, you know, and some things, some things might change just a little bit, you know? So I'm not worried about that though. It is hard. Even for me, I get into the source code of like 10 sec router and I'm like, Hey, I need to do this thing with AI because there's no prior art. It's like, starts bringing in react router APIs and next JS APIs, because that's all it has, you know? And I'm like, okay, you got to stop. Yeah. Yeah. And another thing that I've seen people do, or I've kind of started to see this on like doc sites and things is like, here's a cursor rules that can help you like work with our project.
49:19So maybe like something like that too. But I also think the MCP thing that's so new. Like, I think I only heard about it because I just started playing with a code, Claude code. And I think that that can do something with it, but yeah, it's, this is changing so fast and it sounds like you're on, you're on top of it. So that's awesome too, but also not worrying about it because it's not really needed yet. Cool. Well, I just kind of messaged my wife really quick. Yeah. Is there anything else you wanted to bring up or talk about today, Tanner? Oh, let's see. I'm excited about DaVinci. We're going to be using V to Nitro directly.
49:56And a lot of that includes the new environment APIs. So we're going to have in React router, they're experimenting with this now too. It's a hard upgrade path. It's a different world, like the new environment APIs, but they're very valuable because you can run things, you can run like a native Deno kind of environment, or you can run WorkerD if you're going to go to Cloudflare on your machine and kind of replicate that environment that you're going to be deploying to on your own machine, which is really neat. We're working really closely with the Nitro team to make sure that we can support as much of Nitro as possible.
50:33And it should be almost everything. As soon as we get rid of Vinci, we're going to have support for deploying to over 30 deployment destinations right out of the gate. And you'll be able to write server-side code once and literally just migrate between all of them because that's what Nitro is. It's like the server-side toolkit that kind of goes everywhere. So as long as you're using the Nitro APIs, you could ping pong between like Netlify, Vercel, Cloudflare, whatever, and not have to change really anything. If you do it right, all you have to do is change a string from like, you know, Vercel, Edge to, you know, Netlify, Lambda or something like that.
51:20And Nitro just takes care of the rest. So I'm really excited about that. I'm excited about the SSG stuff. that's big reason I'm doing the Nitro the move to Nitro and V is because I want more control I want you to be able to ship SPA mode like true SPAs with Tanstack Start where you actually you can pre-render HTML documents as landing pages that are kind of like PPR where they're like as much of the page as possible is already rendered out and then where you want to start your dynamic stuff, you can have these dynamic holes that fill in as soon as you mount. So, and then obviously this will probably be after we do 1.0, but we will, we'll bring server components to 10 sec start very soon.
52:06They're just going to be a server function that happens to return react code. So yeah, it'll be really simple to use. I think it's going to be refreshingly simple for people to use even more so than like react routers react server components there they're doing almost the same thing but you can only use them inside of a loader we're going to make it so that you can use them anywhere that you can define a server function which has nothing to do with the router it's just so i mean if it literally if you just wanted to have server functions and react and no router like you could if you wanted like that's a weird it's a weird world it's almost like what waku is but um but it would be totally possible.
52:51Future looks very bright. I'm very excited about all of this. Yeah, me too. So where can people find you? I'm usually on Twitter at Tanner Linsley. If you want to, if you want to get more personal, you jump in discord. We can talk in discord, share code. Yeah. Mostly in those two places. I don't stream a whole lot. I prefer just to work, but yeah, I mostly hang out on Twitter and in my discord. Yeah. I'm very open to like people who want to DM and chat and whatnot. So if you have cool ideas or feedback or just, you know, as long as you don't want to shout at me, we can chat about whatever you want.
53:30Darn it. Okay. No, thank you so much. And thanks so much for coming on and sharing all of this. I'm, I genuinely learned a lot about Tansac Star. I didn't, I had no idea about the solid variant of that. So I'm very excited to go look into that. And 10th X solid starts probably coming very soon, like in the next couple of weeks. So awesome. Well, I can't wait. It'll be beta just like the react version. So yeah, nice. Well, thanks so much, Tanner. And we'll catch you next time. Thanks.
54:11you
From the publisher
TanStack is an open-source collection of high-performance libraries for JavaScript and TypeScript applications, primarily focused on state management, data fetching, and table utilities. It includes popular libraries like TanStack Query, TanStack Table, and TanStack Router. These libraries emphasize declarative APIs, optimized performance, and developer-friendly features, and they are increasingly popular for modern frontend development. Tanner
The post TanStack and the Future of Frontend with Tanner Linsley appeared first on Software Engineering Daily.
