Next.js Discord

Discord Forum

Moving to new team that uses pages router

Unanswered
TempJack posted this in #help-forum
Open in Discord
Avatar
TempJackOP
I am starting as a senior with a new team that uses the Pages router, but I have primarily only worked with the App Router for the past 2 years.

I have two primary questions:
1. What are the biggest changes I should look into ahead of time to familiarise myself? (What are the biggest differences)

2. I am a HUGE fan of the layout.tsx nested navigation that doesn't re-render between navigation, does this exist in pages router too?

14 Replies

Avatar
Ray
1. no server component
2. no caching out of the box
3. use getServerSideProps/getStaticProps for fetching data on server
4. no nested navigation so the full page will re-render on page change
5. no server action, so you will need an api route for mutation (that's why trpc exists)
6. no streaming
Avatar
TempJackOP
:s Do you know how viable is incremental transition? I know it's on the site but I assume there would some troubles with routing between them and using the features seamlessly.

Are there any clear benefits to the page router that you can think of? Apart from pages router probably being more widely used in terms of community support (due to it being around longer)
Avatar
Ray
app router should be better than page router that's why vercel create it. The only benefits I can think of is page router cause less headache since there is no caching by default lol
Avatar
TempJackOP
That's not typically how software works, especially in regards to major architectural changes. It's a reality that there are trade offs.

But I appreciate the responses, I think I have enough info to research
Avatar
Ray
it was not a change or upgrade. they are like creating a brand new router
Avatar
TempJackOP
Exactly
Avatar
Ray
page router is more stable than app router atm, I would still use it in a production app
Avatar
TempJackOP
To imply there are no tradeoffs in any major architectural change is just absurd, obviously they consider it more worthwhile as a company to pursue those changes and I have a huge interest in the direction they are taking, but its just not in the realm of reality to think that its just objectively better in every way
If you haven't experienced any obvious pitfalls yourself, that's extremely reasonable. Just to say it IS better period, seems like its leaving out a lot of nuance.

Although it is possible that Next.JS covered everything they thought Pages router covered ever.

I am operating off the noise I see about app giving up some solutions
Avatar
Ray
are you saying that page router should have something which is better than app router?
Avatar
TempJackOP
I find it hard to believe that a completely different architectural approach to a software solution came with no trade-offs and was an objective upgrade. But in saying that I think I have dragged this convo to a different territory and your response was helpful

Its extremely nebulous and I think you gave me decent insight with the less headaches because of caching, So I appreciate you taking the time. I don't expect this convo to necessarily resolve cleanly, I was just sharing my opinion after :)
Avatar
Ray
imo, why are they creating app router instead of adding/changing the feature in page router is they have to make sure it's backward compatible because nextjs is widely used.

App router came in next 13 and page router came when nextjs exist.
In theory, app router should be more performance/powerful than page router. I don't think a old version of the router would be better than a newer version
what you can do with page router, you should be able to do it in app router but the thing you can do in app router, you may not be able to do with page router