John Au-Yeung
Dec 1, 2021 ⋅ 5 min read

Comparing Next.js and After.js for SSR React apps

John Au-Yeung I'm a web developer interested in JavaScript stuff.

Recent posts:

Bulma Css Adoption Guide: Overview, Examples, And Alternatives

Bulma CSS adoption guide: Overview, examples, and alternatives

Explore how Bulma CSS simplifies frontend development with its ease of use and customizable, responsive, pre-designed UI elements.

Timonwa Akintokun
May 23, 2024 ⋅ 10 min read
Using Mountaineer To Develop A React App With Python

Using Mountaineer to develop a React app with Python

Develop a React app with Python using the Mountaineer framework for building a simple app with integrated your frontend and backend database.

Rosario De Chiara
May 23, 2024 ⋅ 7 min read
Enhance CSS View Transitions With Velevette

Enhance CSS view transitions with Velvette

Velvette is a utility library developed to make working with view transitions easier.

David Omotayo
May 22, 2024 ⋅ 9 min read
Six Carousel Components For Modern Frontends

6 carousel components for modern frontend languages

Carousel components have become an effective technique to organize and display it content to users.

Isaac Okoro
May 22, 2024 ⋅ 10 min read
View all posts

One Reply to "Comparing Next.js and After.js for SSR React apps"

  1. The elephant in the room with Next.js is lack of nested routing[0]. In any moderately complex site, you don’t want to re-render all your components (header/footer) on a page transition. Which also requires you to include your React components on every route path (page.tsx). I was excited to migrate from a Vue.js SSR project to next.js/react, but these basic requirements seem to be lacking. After.js recognises this and uses React Router. But After.js does not have the momentum Next.js has.

    Another issue with Next.js that I think stems from the lack of nested routing is the fact that routes with a getServerSideProps() are called even on client side page transitions[1]. This means that if you fetch data for the entire page, eg user, menu and footer data in getServerSideProps(), this will be fetched again and again on each and every page navigation. There are hacks for these issues, but After.js seems to not have these in the first place.

    [0] https://github.com/vercel/next.js/issues/8193
    [1] [https://github.com/vercel/next.js/issues/11897]

Leave a Reply