Live data from Hacker News

Next.js App Router Update

nextjs.org

51–60 of 93 posts

Re: Next.js App Router Update

#51
What are the viable alternatives for those who don't care about the API routes but still want some level of pre-rendering / SSR? Staying in the React ecosystem that is.

Remix is always touted as the alternative but it seems like a whole new approach to learn and it's own strong opinions.

I've been using Next for 3+ years but I don't feel confident to start a new project today. Do I go to the dying page router? Or trail blaze with the app router with all the teething issues and issues everyone's encountering (myself included).

Re: Next.js App Router Update

#52

Earlier quoted context omitted.

Vite with trpc? I personally don't use the backend functionality of NextJS at all, I have my own backend (in Rust but I'd do the same in Node as well) that communicates via GraphQL to the frontend in NextJS, it's pretty nice.

What are you doing with trpc if your backend is in Rust? trpc is typescript to typescript

I never said I was using trpc, I was simply answering the parent's question about NextJS alternatives. But even with Rust, you can use a similar project called rspc that creates TS types from Rust.

Re: Next.js App Router Update

#53

Earlier quoted context omitted.

Why?

> Next and React have gotten way too complicated. Because I'm fed up with all the unnecessary complexity, and I want to try Vue because it looks a lot less complex, and I've already had a positive experience in the ecosystem with Vite and Vitest.

I mean.... This just sounds like novelty.

You could keep using the react you've always liked?

Re: Next.js App Router Update

#54
I worked on a couple of Next.js projects and all of them turned into a code mess. I have more than a year of experience with Next.js as a senior developer and I still don't know what this frameworks was built for? Is it for a blog post or a full blown app? It started as a framework for a simple blog, but now it turned into this Frankenstein monster and I despise working with it. This is all the sad side effect of JavaScript ecosystem not having a good backend framework like Ruby on Rails or Django. It's a shit show.

Re: Next.js App Router Update

#55

The new docs are extremely annoying; if you're still running a legacy app, sometimes you get put into a doc for a feature you think exists, but then you realize it's not for the right version you're running. Also the new app routers are very confusing. There are concepts of a layout, template, page, etc. While it's nice to have server rendering at this level, it's difficult to understand what is bubbling which direct…

This new routing approach with fetching data everywhere will end up like old PHP mess and then they will discover controllers again :)

I’ve tried to make it work for SPA development but it doesn’t work in that scenario well as all recent data fetching libs were using hooks which you can’t use in async functions. Seem like people aren’t sure how to best solve it now.

Re: Next.js App Router Update

#56
Currently, standalone Next.js apps using App Router consume a lot of memory and leak memory over time (issue #49929 has been open for over a month). I would greatly appreciate it if the Next.js team could investigate this matter (see my comment here: https://github.com/vercel/next.js/issues/49929#issuecomment-...). As it stands, this issue is preventing me from adopting App Router for new projects.

Re: Next.js App Router Update

#57
Lots of negativity here. I don’t share the sentiment. I have ported one project over to the app router months ago when it was still in beta with zero problems and another one is in the works using server actions and drizzle-orm to get end to end type safety. I think it’s a blast. For those complaining about the feature set growing: I think this is just a question of use-case. At my current gig we are using pretty much everything next has to offer for a fairly sophisticated eCommerce site. If your app has thousands of pages (like product pages) with integration into a dozen micro services, auth, large images everywhere, redirects everywhere for seo purposes, middleware for various purposes, i18n and needs SSG for seo and perf reasons then next offers pretty well thought out solutions for all of that.

I can understand the performance argument but most of that is being worked on and the next team has already shipped lots of improvements in the past. But maybe the things I worked on haven’t reached a scale yet where these things become a bottleneck.

Re: Next.js App Router Update

#58

I worked on a couple of Next.js projects and all of them turned into a code mess. I have more than a year of experience with Next.js as a senior developer and I still don't know what this frameworks was built for? Is it for a blog post or a full blown app? It started as a framework for a simple blog, but now it turned into this Frankenstein monster and I despise working with it. This is all the sad side effect of Jav…

I think this has more todo with ad-hoc programing without any guide lines than something inherent to Next.js. If you adopt a basic folder structure to place models, interfaces, routes and what not in, I don't see how things can become super messy. Using Typescript can help to more easily navigate the code base.

Re: Next.js App Router Update

#59

What are the viable alternatives for those who don't care about the API routes but still want some level of pre-rendering / SSR? Staying in the React ecosystem that is. Remix is always touted as the alternative but it seems like a whole new approach to learn and it's own strong opinions. I've been using Next for 3+ years but I don't feel confident to start a new project today. Do I go to the dying page router? Or tra…

API routes are nothing new, and not a big part of the new App router (also, called "route handlers" there). Are you confusing features here?

Re: Next.js App Router Update

#60
post #11

Earlier quoted context omitted.

You can use getServerSideProps to look at the cookies before rendering the page for a user. It’s slightly annoying though since you can’t use both getServerSideProps and getStaticProps on the same page.

Except getServerSideProps is no longer used in Next 13 and actually you have no simple access to the request object anymore. Have to write middleware for everything, it is extremely frustrating

You can just call the `cookies()` or `headers()` function in every server component in the app router?
Post reply on HN