primeflex icon indicating copy to clipboard operation
primeflex copied to clipboard

Cripples angular universal ssr performance

Open nitedani opened this issue 3 years ago • 2 comments

Angular universal 13 introduced a feature called inlineCriticalCss. On ssr, it scans the document and inlines the css used by it. The more the css, the slower it is. image The scss imported for primeng + primeflex produces over 600kb of css. The result is, angular universal ssr takes from 150-800ms to run, on simple page with 3 cards. That is unacceptable for production. I purchased primeblocks for angular, but because it needs those large scss imports, I can't use it. After switching to tailwind, load times are much, much better. Tailwind eleminates the not needed css and it is not included in the production bundle. image I ask you to either switch over to tailwind and keep the library as a thin layer on tailwind, or implement unused css elimination just like tailwind did.

nitedani avatar May 20 '22 13:05 nitedani

Related: https://github.com/angular/universal/issues/2106

nitedani avatar May 20 '22 13:05 nitedani

watching

vytautas-pranskunas- avatar Jun 06 '22 19:06 vytautas-pranskunas-

Hi all,

https://www.primefaces.org/primeflex/setup

Production Size When using a utility CSS library like PrimeFlex, it is likely to use only a set of classes from the library leaving the rest of the library as unused. To avoid including the unused part from your application, it is strongly recommended to use a tool like PurgeCSS that analyzes your code and generates an optimized primeflex file that only contains the utilities you've used.

Best Regards,

mertsincan avatar Nov 09 '22 10:11 mertsincan