aemsites / esri

Apache License 2.0
1 stars 1 forks source link

Map block should have 90+ lighthouse scroe #96

Closed hanem100k closed 4 weeks ago

hanem100k commented 1 month ago

Currently, even though we're loading our iframe lazily, it blocks on load, reducing our LS score to low sixties.

Todo. Add background loading and only block while the placeholder is loading.

The placeholder could be an image of a loaded map, or just text, if the eventual load is fast.

twhite313 commented 1 month ago

We use Intersection Observer for some lazy loading. You could not load it until it reaches the viewport. No need to load the map at all if the user isn't scrolling down.

Certainly something we can test. @jsavella you've worked with Felipe on our lazy loading correct?

hanem100k commented 1 month ago

i did try with the intersection observer, the issue is that on the page I was testing it is instantly inside the viewport, so lazy loading does nothing.

twhite313 commented 1 month ago

I see. I was looking at the full page, not the isolated test.

A placeholder is fine. We have the Calcite framework loaded so you should be able to leverage the Calcite Loader, which might be an option:

<calcite-loader label="Loading map..."></calcite-loader> https://developers.arcgis.com/calcite-design-system/components/loader/