00:00:00Tan Stick Start is seeing some hype these days, and the question is, should you switch from
00:00:05Next.js?
00:00:06Is it better than Next.js?
00:00:08Now yesterday I had an entire livestream where I compared the two and built two apps or one
00:00:14app twice, once with Next.js and one time with Tan Stick Start and you can view that if you
00:00:19want to see that, but here I'll give you my short summary of what's different, what's
00:00:25better and which one you should use.
00:00:27Of course, just my opinion, obviously not an objective comparison, but I'll share my
00:00:32experience about the two and what I think of Next.js and Tan Stick Start.
00:00:37Now I came up with a couple of dimensions which I want to use for comparing the two and you
00:00:42could add more and you could also add more frameworks here.
00:00:47I mean, we could include Remix, React Router now, we could include Nuxt for Vue, we could
00:00:52talk about SvelteKit, but I won't, this video is about Next.js and Tan Stick Start, not because
00:00:57the others are bad, but because these two are often compared.
00:01:01Now first it's worth noting that Tan Stick Start is in the end just Tan Stick Router plus
00:01:08some server stuff, mainly.
00:01:10So you can use Tan Stick Router standalone if you want to build a single page application
00:01:15that doesn't need server-side rendering and server-side functions, for example.
00:01:19You can use Tan Stick Router instead of React Router in your React Vite app, for example.
00:01:25Tan Stick Start then, as mentioned, just adds server-side stuff to Tan Stick Router, making
00:01:30it a full React full-stack framework.
00:01:32Just like Next.js, which of course is also a full-stack React framework.
00:01:37And that's also important.
00:01:38I sometimes get the question whether you should use Next.js or React Vite with React Router
00:01:45and I think that's the wrong comparison.
00:01:47If you don't need server-side logic, if you don't need server-side rendering, then you
00:01:52should just use React Vite, so a Vite project with React, and add React Router or Tan Stick
00:01:59Router.
00:02:00There's no need to go down the Next.js route in that case.
00:02:02Anyways, let's start with that comparison.
00:02:05And the first dimension I picked is the AI readiness of the two, because of course that
00:02:11matters these days.
00:02:12You are very likely using AI for generating some code, maybe all of the code you want
00:02:19in your Next.js or Tan Stick Start project, and therefore AI of course needs to know how
00:02:23to write that code.
00:02:25Obviously, you can and you should provide appropriate context by copying documentation pages or by
00:02:32using an MCP like Context 7 to have the AI reach out to docs, or by telling the AI that
00:02:39it should do some web search, or by adding agent skills that teach the AI how to use Tan
00:02:45Stick Start or Next.js.
00:02:47But out of the box, if you just ask ChatGPT a Tan Stick Start question, it will very likely
00:02:53know less about it than it knows about Next.js and what it knows is probably wrong.
00:02:59Because even now, when I'm recording this, Tan Stick Start is still in release candidate
00:03:04phase, which means no drastic breaking changes anymore, but also not fully stable.
00:03:10For the last year it has primarily been in beta and alpha though and that is the knowledge
00:03:16these AI chatbots have out of the box, which is why they will out of the box have wrong
00:03:21knowledge about Tan Stick Start.
00:03:23So the AI readiness out of the box is not that great, it's definitely better for Next.js.
00:03:31Now with Next.js there of course also have been changes over the years, there is the new
00:03:36use cache directive which the AI out of the box also doesn't know that well but the AI
00:03:42has a decent good understanding about the app router, about React server components and all
00:03:47that stuff so it's definitely better for Next.js than for Tan Stick Start.
00:03:51But again, as mentioned, you should make sure that you give the AI the appropriate extra
00:03:57context it needs, otherwise you're just using AI wrong.
00:04:01What about the ecosystem and with that I mean other resources you can find like tutorials,
00:04:08YouTube videos, courses, maybe also extra packages for these frameworks.
00:04:13And here of course Next.js also looks way better than Tan Stick Start simply because it's older,
00:04:21it's been around longer, you'll find more resources on it because it is bigger too.
00:04:27It's also worth noting of course that it is bigger which means more usage because Next.js
00:04:32is part of that default stack the AI has where it basically gives you Next.js, React, Tailwind
00:04:39and TypeScript for most web apps you're requesting Tan Stick Start will probably never be its
00:04:45default choice.
00:04:47And therefore unsurprisingly if you're comparing the download charts of the two, yeah, Tan Stick
00:04:52Start has definitely less downloads as you can see.
00:04:55If you remove Next.js you can see a nice upward trend for Tan Stick Start though.
00:05:01Kind of related to that ecosystem point is of course the ease of learning but not just
00:05:06that.
00:05:07With ease of learning I mean how simple is it to learn the thing?
00:05:11And I know of course now in the age of AI you're not interested in learning it but as a good
00:05:16developer you should understand the thing you're working with.
00:05:19You may not be writing all the code by hand anymore but you should understand the code
00:05:23the AI generates for you.
00:05:25So learning it still is important.
00:05:28And here I would say for Next.js it's mixed.
00:05:33You can give it, I'm not sure if I would want to give it one or two pluses because getting
00:05:38started with Next.js with the app router and by the way this all here refers to the app
00:05:43router is pretty straightforward.
00:05:46It makes sense.
00:05:47Yesterday in the stream I built a little note taking application where you could create and
00:05:54save and render notes.
00:05:56And you do that with Next.js by just specifying a couple of page.tsx files which are your,
00:06:01you guessed it, pages.
00:06:03You can have dynamic segments.
00:06:04And learning that syntax and that approach to building your application is pretty straightforward
00:06:11in the end.
00:06:12I also think that documentation does a good job at guiding you through the core concepts
00:06:17step by step and getting you started with Next.js.
00:06:22But things get more complex once you build more complex applications and once you dive
00:06:27into the more advanced concepts like caching.
00:06:30And especially the caching part can be super confusing because Next.js made the decision
00:06:36that with the introduction of the app router they wanted to do some super aggressive caching
00:06:42on different layers and understanding that and understanding how to configure your components
00:06:47to work well with that built-in caching and to give your users the behavior you want them
00:06:53to be can be tricky.
00:06:55I'll say that.
00:06:56So getting started is great.
00:06:59Learning the more advanced features is difficult.
00:07:02I'll probably give this two pluses here.
00:07:05And I'll give Tan Stick Start the same but for very different reasons.
00:07:09For Tan Stick Start I'd say that getting started is maybe a bit harder than with Next.js
00:07:16because their getting started docs are not as good as the Next.js docs.
00:07:20Important concepts are missing here I would say like data fetching or mutations.
00:07:27Though if you already have Next.js knowledge there is a pretty good comparison document
00:07:31that compares the key features including related to data fetching and mutations.
00:07:36But I think it can be a bit harder because the docs even though I will say they have been
00:07:40vastly improved still have a little bit of that brain dump feeling where it's not super
00:07:46clear which article you need and well for example there is no data fetching article here and
00:07:53stuff like that.
00:07:54In addition since Tan Stick Start is built up on Tan Stick Router for all the routing
00:07:58related stuff you have to go into the Tan Stick Router documentation which also is rather overwhelming
00:08:05when you look at it the first time.
00:08:07But once you got over that initial barrier it gets way easier and it all in my opinion
00:08:12makes a lot of sense and it's not that difficult and there are no hidden foot guns like the
00:08:18caching related problems you may have with Next.js.
00:08:22That's why I would say that getting started is harder with Tan Stick Start but once you're
00:08:26running it's easier to progress and dive into the more advanced features than with Next.js.
00:08:32As mentioned that's just my personal take on it of course though.
00:08:36Now what about the ease of use from a developers perspective?
00:08:41How fun is it to work with it?
00:08:43That is totally subjective of course but Next.js definitely has some problems here.
00:08:48Not just the problems related to learning potentially but also other problems.
00:08:53For example with the caching it can happen that your app behaves differently in development
00:08:59mode than in production mode which means you always have to test it in production mode which
00:09:04you should do anyways but it gets rather annoying if you have to do this all the time during
00:09:08development because that slows you down.
00:09:11So that is one big problem I had in the past.
00:09:14The dev server can also beget quite slow.
00:09:18At least if you're using the webpack version the new default turbo pack version is much
00:09:22better there but in my experience it doesn't beat the vid based setup Tan Stick Start gives
00:09:29you.
00:09:30So I'll give that three pluses here because in my experience working with it has been super
00:09:37smooth from the developer experience point of view.
00:09:40It's fast, it's predictable, there is no weird behaviour for the most part, there are still
00:09:46some quirks here and there and it is still in release candidate phase but overall I prefer
00:09:53the developer experience of Tan Stick Start over that of Next.js.
00:09:57Obviously that may be different for you though.
00:10:00Now what about the concrete features offered by Next.js and Tan Stick Start?
00:10:06For the routing as I showed you in Next.js you have a file based approach, you set up
00:10:10files which act as your routes and there you have various naming conventions you have to
00:10:15follow.
00:10:16The documentation does a good job at explaining them but there also definitely are more complex
00:10:21features like parallel routes which can be quirky to set up.
00:10:25Tan Stick Start also has a file based approach using Tan Stick Router under the hood as mentioned
00:10:29and you also have filename conventions to follow here which are also similarly easy to learn.
00:10:36One advantage you get out of Tan Stick Start is that with it's file based routing it gives
00:10:41you full type safety which can be pretty nice.
00:10:45So both are file based and it comes down to your preferences which naming pattern you prefer
00:10:51but Tan Stick Start also has that 100% type safety that comes with it's file based router
00:10:57which is nice to have.
00:11:00And which also answers Next question, Next.js has very good typescript support and Tan Stick
00:11:07Start has even better typescript support in my experience.
00:11:11Also when it comes to stuff like server actions or server functions or however you want to
00:11:16call them and data fetching.
00:11:18So yeah, when you use typescript, which you should I think, Tan Stick Start is really a
00:11:23joy to work with.
00:11:24Now when it comes to data fetching and data mutations, they both as I mentioned allow
00:11:28you to run code on the server, they're both full stack React applications but they take
00:11:33different approaches.
00:11:35Next.js uses React server components and for a long time it was the only framework that
00:11:40supported React server components.
00:11:43That means that your page components by default are only rendered on the server.
00:11:48They're never re-rendered on the client which means you can put your data fetching code like
00:11:51this one which will access a database behind the scenes into your components and that will
00:11:56not spill over to the client.
00:11:59Tan Stick Start has a different approach.
00:12:01React server component support is going to land there too soon, it's not out yet when
00:12:06I'm recording this but the approach I'm showing you here and I have used in all my projects
00:12:10will also continue to exist and in that approach your route components by default are rendered
00:12:16on both the server side and the client side, pre-rendered on the server side, updated on
00:12:21the client side and therefore you can't put your server-side code into the component functions.
00:12:27Instead it uses a loader pattern which you might know from Remix for example where you
00:12:32can attach a loader to your routes which will also run on the client and server side but
00:12:37you can then call functions that are decorated or wrapped with create server functions so
00:12:44to say which is a function provided by Tan Stick Start which marks a function as to be
00:12:49run on the server side only but callable from the client side.
00:12:54That is what a server function is.
00:12:56And if you have such a function you can safely call it in a loader or also from the component
00:13:02function body and the code will stay on the server side.
00:13:05Behind the scenes an HTTP request will be sent.
00:13:07So Next.js primarily relies on RSC though you could of course also set up API endpoints
00:13:12there and use useEffect with the Fetch API.
00:13:15Tan Stick Start uses loaders and server functions though it's also worth noting that there too
00:13:20you can also set up API routes and use the Fetch API Tan Stick query or anything like
00:13:25that but the main built-in approach is this loader plus server function approach.
00:13:30For mutations Next.js uses server actions so that are actions that are decorated with this
00:13:37special useServer directive.
00:13:39One of the things Next.js has are these directives useServer, useClient.
00:13:44Some people don't like them I'm also not a big fan I will say.
00:13:47And if you have a file decorated with useServer then all the functions in there become server
00:13:52functions that will only be executed on the server.
00:13:55Not on the client side you can still call them from the client side though.
00:13:59So for example this saveNode function which I have here which stores a node in the database
00:14:04can still be called from the client side here by using the useActionState hook for example.
00:14:10In Tan Stick Start we simply keep on using this createServer function approach here because
00:14:15I mentioned that R functions that are guaranteed to run on the server and you can use them for
00:14:19data fetching or for data mutations because again the code will only run on the server.
00:14:24In a component function that is also rendered on the client you can use the useServer function
00:14:28hook provided by Tan Stick Start to wrap your server function and that essentially makes
00:14:33it callable from the client side and gives you extra features like automatic redirect
00:14:37handling and so on.
00:14:39So that then allows me to call that server function from my client side components.
00:14:43So Next.js uses the official React server functions Tan Stick Start uses their own server functions
00:14:50in the end.
00:14:51The general idea of course is the same though.
00:14:54Now what about caching?
00:14:56I mentioned that is the difficult part.
00:14:58It is pretty aggressive and potentially complex in Next.js.
00:15:04It's definitely one of the harder parts of Next.js.
00:15:07And I do cover it just like all the other important Next.js concepts in my Next.js course in case
00:15:13you want to learn all about Next.js.
00:15:16That course is a great resource to get you from absolute beginner to advanced Next.js
00:15:20user.
00:15:21But caching is definitely one of the more problematic topics with Next.js.
00:15:26The advantage of course is that due to the aggressive defaults you can potentially get
00:15:31pretty good caching for your users.
00:15:35But you can also shoot yourself into the foot pretty easily.
00:15:38For Tan Stick Start I would summarize it as good defaults.
00:15:43Way less aggressive than Next.js and most importantly consistent in my experience at least between
00:15:49development and production mode.
00:15:52It does also give you caching so that when users navigate between routes for example data
00:15:57is cached for a certain time period.
00:16:00So that for rapid navigation you're not sending a bunch of requests to your server.
00:16:04And that of course helps a lot with performance but it's not caching everything or trying to
00:16:09cache everything on different layers and that can make your life as a developer easier.
00:16:14It also of course means though that if you want to get the best performance for your users
00:16:19and potentially save traffic you have to set good caching headers yourself and think a bit
00:16:25more about how you cache your application than you maybe need to do with Next.js.
00:16:30There you have to think about other problems though.
00:16:32Now what about stability?
00:16:34Now here I'll probably give both two pluses.
00:16:39They're both pretty stable.
00:16:40Obviously Next.js is more mature but in my experience it has been quite buggy over the
00:16:46last couple of years especially the development server has had its problems with crashes and
00:16:52so on.
00:16:53But it got way better and overall it's a stable experience and there are of course hundreds
00:16:58and thousands of applications that use it that are running in production without issues.
00:17:03That is definitely important to note.
00:17:06Obviously we had those React security vulnerabilities but for one some of them could be discovered
00:17:10in the future and also affect 10-stack start especially once they also start supporting
00:17:15React server components and two that is not primarily a problem of Next.js of course.
00:17:2110-stack start is still in release candidate phase and I have definitely encountered my
00:17:25fair share of problems with it.
00:17:28Some weird crashes, weird error messages, weird behaviors here and there so I could also just
00:17:33give it one plus for that but since it is in release candidate phase and for that it is
00:17:38pretty stable I'll go for two here.
00:17:41Just be aware that you can definitely run into some problems when using 10-stack start.
00:17:47That being said though I have applications running in production like buildmygraphic.com
00:17:51here which you can use to build amazing infographics with help of AI that are powered by 10-stack
00:17:57start and run without problems and also were no problem to build.
00:18:02What about batteries included?
00:18:04So how easy is it to get optimized image rendering, internationalization or any of that fun stuff.
00:18:12Here Next.js is definitely doing a better job.
00:18:15It has its built-in image component, it has built-in internationalization support and 10-stack
00:18:21start doesn't have any of that.
00:18:24Not sure if it's planned, not sure if it's important for you, it's definitely not something
00:18:29you need, there are other alternatives, third-party packages you can use, maybe you don't even
00:18:34want the built-in stuff but if that is something you care or worry about then Next.js is probably
00:18:41the better choice here.
00:18:43And then what about deployment?
00:18:45That is a difficult topic.
00:18:48Next.js is built by Vercel of course and if you deploy it on Vercel it's super easy and
00:18:55smooth.
00:18:56Everything is optimized for that.
00:18:57Historically it has been a bit difficult to deploy it on your own servers for example but
00:19:03to be fair the Next.js team really has done some work to make that easier, write better
00:19:09documentation and therefore nowadays I would say you can absolutely deploy it on other services
00:19:15without a lot of problems too.
00:19:17So that is two or three pluses, three pluses if you use Vercel and two probably if you use
00:19:25other providers I would say.
00:19:28For 10 stack start I will go for two here right now but I could also give it three.
00:19:36The main reason for me giving two is that at the point of time where I'm recording this
00:19:41the hosting documentation is still a bit tricky.
00:19:45There are officially supported partners like Cloudflare and Netlify which have pretty good
00:19:50documentation and where deployment probably is pretty smooth, I haven't used those though.
00:19:56If you wanna run it on your own VPS for example with BUN there are some instructions here but
00:20:02I found it a bit hard to follow them or ran in some issues which were all solvable but
00:20:10it definitely took me some time.
00:20:12I think once there is a good guide for deploying 10 stack start with BUN or Node on a VPS deployment
00:20:19it will definitely get easier especially if that guide includes recommendations regarding
00:20:24some best practices you should follow or potential pitfalls you may be facing.
00:20:29But as mentioned you could definitely also go for three pluses here depending on how you
00:20:33look at that.
00:20:34As I mentioned this is all subjective and just my experience, my thoughts and obviously I'm
00:20:40also interested in hearing your thoughts.
00:20:42If you made the switch or what you think about next.js and 10 stack start, if you're considering
00:20:46switching or if you use neither of them and you instead use another option.