-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Android: Support HTTP headers for source prop on <Image> components #7791
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
Conversation
By analyzing the blame information on this pull request, we identified @foghina and @brentvatne to be potential reviewers. |
cc: @dmmiller - we merged the iOS version of this last week, so it would be great to get Android support landed too! |
@@ -99,8 +99,8 @@ private static ImagePipelineConfig getDefaultConfig( | |||
} | |||
|
|||
OkHttpClient okHttpClient = OkHttpClientProvider.getOkHttpClient(); | |||
ImagePipelineConfig.Builder builder = | |||
OkHttpImagePipelineConfigFactory.newBuilder(context.getApplicationContext(), okHttpClient); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can remove the import for OkHttpImagePipelineConfigFactory.
Few questions inline, seems good to me, but also ccing @andreicoman11 who has been looking at the image fetching code lately. |
@rigdern Looking at this, I think it would be better to add this capability first to Fresco (also open source) and then we can pull the update into RN. I'd rather not create an additional copy of a random Fresco file for just this. It seems like you can add the addHeader call when Fresco builds the request pretty easily, and then we can take this more easily. |
@rigdern do you have any updates for this pull request? It's been a while since the last update so wanted to check in and see if you've looked at the requested changes. |
Thanks for checking in and sorry for the delay. I've been busy with some other stuff but I plan on making the requested changes soon. |
Any word on when will this be merged? |
Can somebody else take over this ticket and finish the android integration? @dmmiller @andreicoman11 @rigdern |
@ospfranco I apologize I haven't been able to finish this PR yet. Based on the earlier discussion in this PR, part of my change needs to be redone within the Fresco repo. Before I can do that, I need to wait for an internal request to be approved which will ensure I can safely contribute to the Fresco project. Adam Comella |
I understand, thanks @rigdern looking forward to having this released |
b888fa1
to
c74001d
Compare
@rigdern updated the pull request - view changes |
@dmmiller I moved some of the functionality into Fresco (PR facebook/fresco#1459). I also pushed an update to this PR which consumes the new Fresco feature. Before this PR can be merged, we'll have to get the Fresco PR merged and then update React Native to depend on that version of Fresco. |
c7428d4
to
c104038
Compare
@AndrewJack thanks for the suggestion. I updated to Fresco 1.0.1 and fixed the buck compilation errors. Let's see if the CI system is happy. |
@rigdern Tells me this has been reviewed and should be merged. @facebook-github-bot shipit |
I tried to merge this pull request into the Facebook internal repo but some checks failed. To unblock yourself please check the following: Does this pull request pass all open source tests on GitHub? If not please fix those. Does the code still apply cleanly on top of GitHub master? If not can please rebase. In all other cases this means some internal test failed, for example a part of a fb app won't work with this pull request. I've added the Import Failed label to this pull request so it is easy for someone at fb to find the pull request and check what failed. If you don't see anyone comment in a few days feel free to comment mentioning one of the core contributors to the project so they get a notification. |
I tried to merge this pull request into the Facebook internal repo but some checks failed. To unblock yourself please check the following: Does this pull request pass all open source tests on GitHub? If not please fix those. Does the code still apply cleanly on top of GitHub master? If not can please rebase. In all other cases this means some internal test failed, for example a part of a fb app won't work with this pull request. I've added the Import Failed label to this pull request so it is easy for someone at fb to find the pull request and check what failed. If you don't see anyone comment in a few days feel free to comment mentioning one of the core contributors to the project so they get a notification. |
Maybe we should update to 1.0.1, since it solves EXIF problems: |
@mobinni Thanks, the PR was already updated to Fresco 1.0.1. |
Also would like to see this getting merged, since it already works on iOS. 👍 |
Summary: A copy of #7791 because of our very imperfect tools that mirror the changes from pull requests in the fb monorepo. The internal Phabricator revision for #7791 is in an 'abandoned' state (by foghina probably because of changing teams) and Phabricator doesn't allow me to claim that revision and merge it. Therefore I'm creating a new one. (It's not foghina's fault, no one probably knew about this "abandoned Phabricator revision" edge case, don't remember we hit it before.) Will try to keep attribution (git blame) to rigdern when merging. Closes #12448 Differential Revision: D4584743 Pulled By: mkonicek fbshipit-source-id: 66e5b88134fca1980adc4cd8a2ff17c42e10022c
@mkonicek No worries. Thanks for getting this merged! |
When will this be available via npm? |
Summary: A copy of facebook#7791 because of our very imperfect tools that mirror the changes from pull requests in the fb monorepo. The internal Phabricator revision for facebook#7791 is in an 'abandoned' state (by foghina probably because of changing teams) and Phabricator doesn't allow me to claim that revision and merge it. Therefore I'm creating a new one. (It's not foghina's fault, no one probably knew about this "abandoned Phabricator revision" edge case, don't remember we hit it before.) Will try to keep attribution (git blame) to rigdern when merging. Closes facebook#12448 Differential Revision: D4584743 Pulled By: mkonicek fbshipit-source-id: 66e5b88134fca1980adc4cd8a2ff17c42e10022c
Summary: A copy of facebook#7791 because of our very imperfect tools that mirror the changes from pull requests in the fb monorepo. The internal Phabricator revision for facebook#7791 is in an 'abandoned' state (by foghina probably because of changing teams) and Phabricator doesn't allow me to claim that revision and merge it. Therefore I'm creating a new one. (It's not foghina's fault, no one probably knew about this "abandoned Phabricator revision" edge case, don't remember we hit it before.) Will try to keep attribution (git blame) to rigdern when merging. Closes facebook#12448 Differential Revision: D4584743 Pulled By: mkonicek fbshipit-source-id: 66e5b88134fca1980adc4cd8a2ff17c42e10022c
@Traubenfuchs Here's a description of React Native's release cadence: http://facebook.github.io/react-native/blog/2017/01/07/monthly-release-cadence.html. Based on that, my assumption is that this change will be available in the March (0.43) version of React Native. This means you can get a release candidate containing this change at the beginning of March and a stable release containing this change at the end of March. |
Summary: A copy of facebook#7791 because of our very imperfect tools that mirror the changes from pull requests in the fb monorepo. The internal Phabricator revision for facebook#7791 is in an 'abandoned' state (by foghina probably because of changing teams) and Phabricator doesn't allow me to claim that revision and merge it. Therefore I'm creating a new one. (It's not foghina's fault, no one probably knew about this "abandoned Phabricator revision" edge case, don't remember we hit it before.) Will try to keep attribution (git blame) to rigdern when merging. Closes facebook#12448 Differential Revision: D4584743 Pulled By: mkonicek fbshipit-source-id: 66e5b88134fca1980adc4cd8a2ff17c42e10022c
@gayancliyanage looking at this PR's history, this PR was closed in favor of PR #12448 by mkonicek. Looking at that PR, it was merged as commit 8c0e6ec. And looking at that commit, we can see the first stable release of React Native to include that commit is 0.43: |
This PR depends on Fresco PR facebook/fresco#1459
Allows developers to specify headers to include in the HTTP request when fetching a remote image. For example, one might leverage this when fetching an image from an endpoint that requires authentication:
Note that the header values must be strings.
Related to PR #7338 which is for the iOS implementation.
Test plan (required)
Adam Comella
Microsoft Corp.