shadcn-ui / taxonomy

An open source application built using the new router, server components and everything new in Next.js 13.
https://tx.shadcn.com
MIT License
17.99k stars 2.47k forks source link

Pages Load Slowly #173

Open Zac-Zajdel opened 1 year ago

Zac-Zajdel commented 1 year ago

Hi everyone,

Starting to learn the app router and upgrade some side projects so I went to the 🐐 of UI components and found this sample. I pulled this down just to see how it was architected but I immediately noticed locally and even on the hosted website that switching between pages initially takes 3-4 seconds.

Is this the cost of server components 👀 or is there just something super unoptimized going on? I will continue to investigate and post here in the days ahead but compared to some of my next.js 12 apps, this performs much worse.

vaynevayne commented 1 year ago

same issue

davidmayr commented 1 year ago

In auth.ts: https://github.com/shadcn/taxonomy/blob/main/lib/auth.ts there is a database call in the jwt method.

I've experimented with this before and in my own project this method gets called about 4–10 times per page load. (maybe this is not the case in this project tho)

Are you logged in? Because maybe that's the issue

rajaryyn commented 1 year ago

It's not the issue with server components. The issue came from webpack it's making hot reloading slow. Use turbo pack beta version

S4ntiego commented 1 year ago

It is the cost of server components in case of websites that utilize user authentication, at least in their current state, but it used to be much worse a few months ago, so let's hope that it will get even better over time.