responsiveimagescg / ri-defer-usecases Goto Github PK
View Code? Open in Web Editor NEWUse Cases and Requirements for a deferred image loading feature.
Use Cases and Requirements for a deferred image loading feature.
Apologies if I'm not correctly following the format of this repo (should I do a PR and write some code instead of creating an issue?)
Over in the Container Queries repo there's an issue discussing syntax, which morphed into (among other things) a discussion of images. The issue I presented was that the sizes
attribute in <img/>
would need to support container queries, at which point @aFarkas pointed out that that wasn't necessary, as sizes
is only needed at parse-time (when container queries may not yet be available). We both came to the conclusion that a possible solution would be to defer selection of the right image until afterwards (when layout information is available).
So here's my use case then: I'm using the wonderful new container queries everywhere, hence I don't know beforehand how big an image will be relative to the viewport (because it's sized relative to its container instead). I want the right image to be pulled from srcset
once layout has been calculated, and I don't want any image to be downloaded until then.
In this case (I apologies for jumping directly from use case to implementation) it would make sense to require either sizes
or defer
/lazysize
(but not both) on an image that has dimension-based choices in srcset
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.