I wrote a blog post the other day about how Next.js Middleware can be useful for working around some of the restrictions imposed by server componen...
For further actions, you may consider blocking this person and/or reporting abuse
Thanks for sharing your experience - I've just come back to learn more about Next after not using it for a while. I'm enjoying the app router on the face of it but it's really good to get perspective from someone already using it in the wild, so to speak.
I've bookmarked this article so I can come back to the details as my understanding deepens, some very interesting points here...
Thanks for the article.
I recently went through a lot of these pains, as I started migrating some of my pages router api routes into the app router. Vercel recently released a new utility called waitUntil, which was really useful for my app, and only works for the app router. So I thought I would migrate.
I was able to successfully migrate all of my logic, including my auth, payload, and encryption interceptors with the new architecture. I was constantly running into walls where things should have just worked, but they didn't. Like not being able to access query parameters from within a try catch.
One of my biggest pain points, was the full page re-renders when working on route handlers in dev. On the pages directory, you could modify your route handlers without causing your application to reload in dev.
Ultimately I've decided to stay away from the app directory. The DX is horrible and the amount of boilerplate files is insane. If the pages router get fully sunsetted, I would much rather just move away from NextJS. It would be a similar amount of work either way.
Hey I can relate this with my biggest mistake of trying to create the world's first ever open-sourced social media app... yeah just a fancy way of advertising, lambda, it's built with nextjs 14. And it's a pain to maintain
I feel this one.
I think a lot of things in frameworks have gotten strictly better over time but routing is maybe not one of them. Routing methods (file based or not) are something every framework tries a little differently and it's not clear there's an optimal solution vs. just different options.
Spot on. 10/10 🙂
“Why does this work… like that?”
This got me 😂🤣
It's a well-written article! I think we are seeing next.js finding its own niche, while for other things (like writing a Dashboard or doing a mostly static page with little interactivity) we will (or already have) better tools that are less complicated.
The problem is falling in love with any tech and not looking at the big picture, not looking at alternatives. Frameworks that can stay close to their programming languages, that don't force you into their own world, are going to stay longer.
People expect to reuse their knowledge. That can only happen when your framework does not require extremely custom thinking.
such poll doesn't mean much without splitting voters by years of front-end experience at least, as we do not know if most are new-comers with little experience and thus get easily confused the more a technology gets advanced.
Hey, what do you think about this: github.com/javaScriptKampala/z-js I started to work on it a while ago, recently released it on mpm... but I was remembering this article so am here!
Very true. Pain in the ass to use itt nowadays.
Interesting, I have started using SvelteKit And I must say I like it more then NextJs.
Great post keep up the good work!
I started using Astro, feeling the same way regarding NextJs.