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
Using a service worker it would be possible to preload the images without injecting <link rel="preload"> tags at build time (and without the performance implications that has). The ef-hotspots service could then load all of the images (which would be immediate since they have been preloaded into the service worker already) and collect the dimensions in its load method (that method should likely be an ember-concurrency task btw – currently it's possible to end up with multiple parallel fetches for /assets/eh-hotspots.json and that's maybe even likely to happen since the eh-background component calls the method in its constructor so rendering two such components on the same route should likely trigger 2 concurrent requests).
Overall I think this would allow for simplifying this addon quite a bit while improving the solution at the same time.
The text was updated successfully, but these errors were encountered:
I think it should be possible to drop the extra
eh-hotspots.json
file (and all of the build time tasks this addon performs really).Using https://github.com/adopted-ember-addons/ember-cli-ifa you'd have access to the list of images at runtime so you could get the list of relevant image files from that instead of from disk at build time.
Using a service worker it would be possible to preload the images without injecting
<link rel="preload">
tags at build time (and without the performance implications that has). Theef-hotspots
service could then load all of the images (which would be immediate since they have been preloaded into the service worker already) and collect the dimensions in itsload
method (that method should likely be an ember-concurrency task btw – currently it's possible to end up with multiple parallel fetches for/assets/eh-hotspots.json
and that's maybe even likely to happen since theeh-background
component calls the method in its constructor so rendering two such components on the same route should likely trigger 2 concurrent requests).Overall I think this would allow for simplifying this addon quite a bit while improving the solution at the same time.
The text was updated successfully, but these errors were encountered: