You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the bulk project, I am reviewing the loading sequence and most of the logic is inherited from this repo. The loading sequence diverged from the non-commerce boilerplate and it lost its target: focus on showing the LCP element as fast as possible.
One main issue is that projects have different pages, some requires the commerce stuff, some don't. And in the bulk case, the homepage (=most critical page) does not need the commerce stuff to show the LCP. The loading sequence is then polluted by a lot of other resources being loaded.
Recommendations:
get rid of the speculationrules, modulepreload and preconnect from head.html - this is coming in the way of loading the LCP image as early as possible for the non-commerce pages
get rid of commerce.js and configs.js from head.html - if something needs them, it can import them
get rid of import maps - this is a developer preference, this does not help code reader introducing a different pattern for some of the files
create commerce-light.js file with the minimal stuff required pre-LCP
do not preload files, nor in the eager phase nor later. The "wait for LCP" is the only objectives of this phase. Anything needed by a potential LCP block can be directly loaded from the block. And then it is too late to preload anyway. This makes the loading sequence hard to debug and is anyway generally wrong to use.
why are the dropins loaded immediately ? This really feels like optimisation for the product pages.
of course (and I agree this is tricky), the LCP blocks need to have this notion of 2 phases loading, first being "do everything to load the potential LCP image - and avoid CLS" and in second step, load the rest that can be async if it takes longer. I think the ProductDetails is somehow trying to do this (+/- the preload of the main image which can be removed - just inject it eager loaded).
The text was updated successfully, but these errors were encountered:
Thanks for the review @kptdobe - just one note - the speculationrules have no impact on LCP - they are just declarative for preload rules for Chrome/Edge - and don't load anything..
For the bulk project, I am reviewing the loading sequence and most of the logic is inherited from this repo. The loading sequence diverged from the non-commerce boilerplate and it lost its target: focus on showing the LCP element as fast as possible.
One main issue is that projects have different pages, some requires the commerce stuff, some don't. And in the bulk case, the homepage (=most critical page) does not need the commerce stuff to show the LCP. The loading sequence is then polluted by a lot of other resources being loaded.
Recommendations:
,speculationrules
modulepreload
andpreconnect
fromhead.html
- this is coming in the way of loading the LCP image as early as possible for the non-commerce pagescommerce.js
andconfigs.js
fromhead.html
- if something needs them, it can import themcommerce-light.js
file with the minimal stuff required pre-LCPThe text was updated successfully, but these errors were encountered: