3 ms·
Thanks, that's an interesting suggestion. I'll have to think a little about how it would work in practice—object detection is simple, but I'd need to make sure
by ionfish 16y ago
Thanks, that's an interesting suggestion. I'll have to think a little about how it would work in practice—object detection is simple, but I'd need to make sure I could map the API well enough in each case for it to be worthwhile. If I did do that, it would probably be as an optional library (specified at build time), providing a fallback in the same way I intend to provide a fallback for browsers which don't provide an implementation of CSSMatrix. The other possibility would be to embed a minimal animation library like Émile [1], and just use that directly.
The other way of doing this would be to pull Firmin into more general DOM libraries as an alternative animation backend, and toggle between them based on runtime feature detection (for an example of how to do this, see [2]). A special case of that is doing it at the application level, in cases where the potential performance gains are vital; I mention an instance where I've actually done this in the article.
[1] https://github.com/madrobby/emile https://github.com/madrobby/emile
[2] https://github.com/othermedia/edgecase/blob/master/source/edge-gallery.js#L68-89 https://github.com/othermedia/edgecase/blob/master/source/ed...