3 ms·
As a long term user of old school server side frameworks like PHP I very much "got" what the app router is trying to do once I used it, being able to reach into
by terandle 3y ago
As a long term user of old school server side frameworks like PHP I very much "got" what the app router is trying to do once I used it, being able to reach into your database from any component without having to build an API layer is incredibly productive. It feels refreshingly old school and new school at the same time. My guess is the majority of the people that don't like the app router are just very used to the modern SPA only way of building websites and will come around over time. I think the idea of server components themselves are incredibly solid and expect to see other frameworks adopt them as well.
- Solvency 3y agoI don't get it. Why not use simple .htaccess to map URLs to folders/files like always? Then, if you simply must use a JS framework like React...run it on those corresponding pages. Why use yet another framework (Next) on top of this to handle such a simple thing?
- terandle 3y agoI think what you are getting at is what the new nextjs is. Everything is just plain server rendered HTML by default and you opt into client side react on a per-subtree basis depending on if you need it or not. Some other neat bonuses are: - Page transitions still use client side routing so it still feels fast like a SPA, and it automatically preserves state on your outer layouts during page changes. - And something I find mind blowingly impressive is you can refresh the server rendered HTML at any point while the user is on the page while still preserving all of their client side state and scroll position etc. A simple call to `router.refresh()` is all you need to do that, something that would have taken a good amount of API code and shoving stuff into some state management library etc to do before.
- mpeg 3y agoI’m not a next.js or react fan at all, but “like always” is a weird thing to say about a feature that is Apache only. While Apache was wildly popular htaccess files and cgi/fcgi adapters for php, Perl and such were everywhere. These days they’ve fallen out of favor and every cloud provider has their own version of this that you can use. But let’s not pretend this is the way things have always been done, in my career pre-cloud I’ve worked with Apache and nginx, but also with Java servers (tomcat etc), phusion, IIS and occasionally custom app servers that would speak http.