intershop / intershop-pwa

The Intershop PWA is an Angular based progressive web app storefront for the Intershop Commerce Platform.
https://www.intershop.com/progressive-web-app
MIT License
154 stars 79 forks source link

Optimization for google Lighthouse review #1602

Open tbouliere-datasolution opened 4 months ago

tbouliere-datasolution commented 4 months ago

Is your feature request related to a problem? If yes, please describe it.

The application currently performs very poorly in the google lighthouse test in mobile mode. It's true that it's very difficult to optimize angular applications for this test. Even more so with a generic application.

However, there are architectural choices that prevent us from making improvements in our projects:

Describe the desired solution.

Describe alternatives you've considered.

Splitting ShareModule and lazy loading CMS doesn't take so much time. The real difficulty lies in the extensions loaded on the home page.

A first cut has been made here as a poc (~ 4/5 hour of work): https://github.com/tbouliere-datasolution/intershop-pwa/tree/refactor/split-shared-module

Provide additional context.

image

Initial webpack bundle

image

Expected splitted webpack bundle

image

AB#94658

andreassteinmann commented 3 months ago

Hi @tbouliere-datasolution, we looked at the changes and figured out several improvements in the Lighthouse test for mobile (Unused JS, FCP, TBT). Thank you for the work! We are not going to take the POC as it is but we are going to look at certain re-arrangements and improvements.

tbouliere-datasolution commented 3 months ago

Hello Andreas.

I understand that this type of modification can be hard to integrate. That's why we've abandoned the idea of achieving a correct ligthouse score for the time being. It would take us too far away from the initial trunk.

I can, however, add the following comments:

And once again, all these libraries are loaded into the core (some even via app.module.ts).