Closed hunghvu closed 10 months ago
Note, that due to #91 and #92, the layout was substantially changed. Although the measurement is different, the core idea of this ticket remains. The pictures below is from running next start
on local next build
.
FCP
LCP
TBT
CLS
With 35d936, it shifts the LCP measurement to this.
It might not be trivial to improve FCP in appDir:
If we can optimize the import of CSS, then hljs (CSS + JS), perhaps LCP will decrease. Or is it simply due to sheer length and need lazy loading?
If it is not trivial to add inline critical CSS, then we can consider purging (PurgeCSS) or minifying CSS (CSS Nano).
CSS Nano does not seems to work with Next.js, because CSS Nano is internally used by Next.js (big question mark? Only applied to .module.css
?)
Two points to think about.
In fd4c940, it seems either due to @tailwind
resides in layers, or due to misconfiguration because tailwind.config.js
resides in another package (path issue?), Tailwind JIT does not work. This causes all Tailwind CSS are delivered to production, causing a large amount of unused CSS bytes.
Besides, removing PrimeReact node_modules
from tailwind config content did something. In short,
We will go ahead and finish the optimization process here. There are still 2 unresolved issues, which will be for future tasks.
Avoid an excessive DOM size(cut in half by UI overhaul in #91 and #92)Minimize main-thread work(largely reduced by SRR in #91)Reduce JavaScript execution time(largely reduced by SRR in #91)Avoid long main-thread task(largely reduced) by SRR in #91)/