Open DuncanMacWeb opened 5 years ago
Thanks for the ideas @DuncanMacWeb ! Both sound good to me. The second one should be really straight forward. The first one can be a bit more tricky to implement, but we can maybe use the same media-engine lib that we already use fo media queries. Would be happy to make these changes but if you want feel free to do it!
No worries! I can definitely upgrade the library but don’t have much bandwidth to tackle the full responsive images spec right now... will give it some further thought though :)
I just did the cross-fetch
changes in a separate PR. Hope you don't mind.
That change is great, specially because cross-fetch
solves some issues un React Native that isomorphic-fetch
, for future RN integration.
I kind of needed this change before moving forward with #485, so I can now have better (and fastest) tests using jest-fetch-mock
My only concern here is that isomorphic-fetch
is a fbjs
dependency, which is also a react-reconciler
dependency. So there's no really a way of getting rid of isomorphic-fetch
completely right? what do you think @DuncanMacWeb ?
@diegomura thanks! I’ve replied over at #486... so let’s change this issue to cover the multiple image resolutions / responsive images only.
Here are some ideas to improve how we handle images, that I had while thinking about #478:
Handling multiple image resolutions
The web has a standard that we could draw on to handle multiple image resolutions: the
srcset
andsizes
attributes. Might this be useful to, for example, output a smaller PDF for screen than for print?~Upgrade from
isomorphic-fetch
and aliasfetch
~(separated out to #486)
~Also it might be good to take the opportunity to upgrade to
cross-fetch
which seems to be better maintained thanisomorphic-fetch
. We could aliasfetch
tocross-fetch
at the same time:~'isomorphic-fetch'
to'fetch'
~cross-fetch
and alias it the same way we aliasedyoga-layout-prebuilt
in this commit~