Next.js Discord

Discord Forum

Router-less App vs Pages dilemma

Unanswered
New Zealand posted this in #help-forum
Open in Discord
New ZealandOP
My case involves a website that has no server or routing involved.

I am looking for help to pick one or the other, so any input as to are the pros and cons of each would be appreciated, especially with the no need for a router part in mind.

Thanks in advance!

17 Replies

Plott Hound
Tell us more about the planned features of the site. We need more info to make an informed decision.
It’s generally recommended to use app router now.
New ZealandOP
its essentially a marketing website, featuring a lot of animations on the copy and assets.
I’m going with next for performance thanks to the SSG and out of the box optimizations
the need for interactivity and animation from the first screen means that it will pretty much have ‘use client’ from top to bottom of the component tree as far as I can tell
the idea is that you keep everything an RSC if possible, and scope "use client" to interactive components
in real-life, sometimes you need "use client" immediately at the top of a page, that's totally ok, but sometimes you can move client components to the leave and getter a better arch
anyway, Next.js is a good choice here as you noticed thanks to build-time rendering + if possible RSC and the possibility to easily use React
you can use the App Router without any problem, the cool stuff it brings are route handlers
this is great for adding RSS feed as an "rss.xml" route, a sitemap etc.
you can do the same with "pages" but it's a tad more intuitive with the App Router
New ZealandOP
thanks for the detailed response @Eric Burel ! I figured there would be a way to postpone the use client tag until strictly necessary at the leaves, as you mention.

curiously enough, Ive managed to start building the app with gsap animations getting triggered from a useIsometricLayoutEffect hook. it checks typeof window to =useEffect on the server and =useLayoutEffect on the client.

strangely enough, I have not had to use the “use client” tag anywhere yet… could that be because of the hook? i thought i was going to be using client everywhere and now im thinking i can get away with no usage of it whatsoever 😂
Plott Hound
The only problem you might run into if it has lots of animations. Specifically layout or page transitions. Unfortunately in app router it is not possible to properly have an animated page transitions due to not being able to use an exit animation
To my knowledge this is pretty much the only relevant reason to use pages router. But if it’s not important to you then I’d recommend app router all the way