maybe
maybe copied to clipboard
Migrate from Next.js Pages to App router
Not sure if this is a priority or not, but I personally would like to have App router vs Pages.
https://nextjs.org/docs/app/building-your-application/upgrading/app-router-migration#migrating-from-pages-to-app
There's an opportunity here to entirely remove the separate server
package and usage of tRPC. There's a decent chunk of endpoints, but not a overwhelming amount. A lot of that extra "glue" code between client and server can be removed in the process of moving towards App Router + Server Components + Server Actions.
I noticed, for example, it's using the Pages Router patten of adding getLayout
(which was the kind of hacky way of having layouts support before it was a built-in primitive). Now, it probably makes the most sense to incrementally tackle this rather than doing it all at once.
For example, since most of the data fetching here seems to be client-side through custom React hooks, the first step of incremental adoption here would be to make the entry into the application (the top level page
) as a Client Component with "use client"
.
I'm happy to answer questions and possibly even try to assist (or code review) in places here!
Hey @leerob stoked to see you here! Would definitely love your input and guidance as things continue to progress.
I migrated our entire turborepo (3 client apps and a server app) in my last company from Next.js pages to app router when it was just released so I would love to take this up. And what could be better than having the opportunity to ask questions directly to @leerob himself 🙏
@ExplorerAadi My suggestion is to open a draft PR and outline your general gameplan on what work you plan on doing. Then others can add comments to that as well as review code changes as you're working on them.
Hey everyone! I've created a draft PR for this, please check it out and drop any suggestions you have.
Thanks a lot @Shpigford . I was actually going through the app and noting down the point to plan the upgrade and then raise a better draft request.