-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image: modern API and implementation #1786
Comments
We have two uses for the image queryCache I wanted to share here
|
Looking forward to this change! Some possible solutions for implementing some of the props with CSS:
It would be cool if React Native could add something similar to object-position otherwise it would be nice if we could use it in React Native Web somehow. |
@necolas just to make sure I'm understanding correctly - the proposed new API will be in tension with the React Native API such that it won't have built-in support for HTTP verbs like headers, for example, in the as this is already not present in the our use case, FWIW, is secure images served behind an authentication layer in our API server; i'm not sure how common of a use case this is. if there is a way to somehow shoehorn this in, I would love to see that or help make that happen. If not, our web-specific workarounds will live to see another day 😸 |
I'd give a +1 to @viggyfresh's use-case of wanting to serve images behind auth. For example, Expo (which wraps RNWeb) doesn't really have cookie support, so instead suggests using token-based auth: expo/expo#6756 (comment) . (Even if cookies were supported, I believe having all client-side data stored together in LocalStorage, and communicated via http headers, is a more modern approach). So without support for cookies or http headers when serving images, I think the only option remaining becomes to stick the auth token in the querystring. I suppose there's not really anything wrong with that, but for consistency it would be nice if the same auth mechanism could be used everywhere. |
Sending private tokens in the query string is not recommended because unlike headers, they often show up in logs. |
I've built this as an alternative to the RN web implementation if that can provide ideas for improvements. Def has lots of tradeoffs and doesn't implement all RN features. The main idea is to extend the source prop with a |
#2171 is covered by this as well |
Is your feature request related to a problem? Please describe.
Provider a high-performance
Image
implementation for web. This issue is to discuss how we should rewriteImage
to support modern web features.Describe a solution you'd like
The new
Image
should implement the following feature requests…alt
text.backgroundBlendMode
.The new
Image
will not support the following APIs…tintColor
,resizeMode
, andshadow*
styles.repeat
value forresizeMode
.The proposed
Image
API looks like this…Any dynamic loading via XHR/fetch would have to be layered upon that.
Additional context
Please comment with addition context and use cases.
The text was updated successfully, but these errors were encountered: