So some of the things that Redwood has done that's a little bit different is their router is very different. They have a configuration router. If you liked React Router 7, you'll probably like Redwood's router. They're very similar. They've taken a lot of the same patterns, whereas Next.js is a file-based routing system. So if you want a new page, you just create the page, create the file, like there it is. So it's a little bit different.
In my opinion, there's some benefits to having that page-based, like configuration-based routing system. You can change routes without having to move your files around. But one of the key differences, I would say, that most people appreciate with the Redwood system is how they handle middleware. So if you look at that router config, and this is why I kind of brought it up, is that it's essentially an array of parameters that you're passing in to say if you go to this route, deliver this component. But they handle middleware and interrupters.
They're kind of the same thing. Middleware runs before every single page. Interrupters you can say, I just want it to run on certain pages. But you get this clear picture of when the middleware is running and when these interrupters are running and then when it's loading the page. Whereas with Next, that's actually done through a middleware file.
And so sometimes at least when I've built Next.js projects, sometimes I've forgotten about middleware. I'm like, why is this not working? And it's because it's hidden in this side fold file. They're like, oh yeah, it exists over here. Thanks for the very cool RSC framing. One thing I miss about APIs now that I'm starting to use RSC and Next.js is seeing clean request response JSON payloads in Chrome DevTools Networks tab. Any tips on RSC debugging tools?
Yeah, I don't have anything specifically, but I will say kind of the gotcha there when you're trying to do debugging is like, where is this coming from? You'll log something out and it's not in the browser console. Where is it? It's in the terminal. It's because it ran on the terminal and not the browser. But one thing that I would say, if you like the clean request response JSON payload, look at Redwood because they've tried to make it very clear that this is the request that we're putting in and this is the response. So you can have it respond with a React component.
You can have just a normal HTTP response. You can just stick that back in the browser. You can send in text. And so it makes it very clear and easy for beginners to understand this is the request and this is the response that you're going to get back. Awesome. Well, thank you so much, Amy. Thank you.
Comments