A blog post I recently read suggested setting the sizes attribute of <img> tags automatically, using a ResizeObserver.
This would mean that at different image widths (in practice usually different breakpoints) the sizes would update each time the image resizes.
Imgix is doing something similar, and they state:
The sizes attribute was designed to give the break-points information to the browser as early as possible, typically before the images on the page have even rendered. Because imgix.js is loaded after the page's HTML markup, the browser gets the information about sizes just a tad-bit later than usual. This means that some of the performance gains from using the sizes attribute are lost, since the browser has to wait for imgix.js to load before it can make a decision.
Is this approach useful at all? Or is it wrongly using what was intended to be a static hint at image widths?