-
Notifications
You must be signed in to change notification settings - Fork 3k
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 Web/Desktop: Add support for http headers #13036
Image Web/Desktop: Add support for http headers #13036
Conversation
8ddbaa0
to
efdf4d2
Compare
Holding on this as we try to get the upstream |
ac2598f
to
2dbbf10
Compare
2dbbf10
to
4ddff74
Compare
I've cherry picked this commit in order to test the new Image functionality: 34d941d92742dda5e383a19b759ef60247e5376a Details about the related PR here: #12603 (comment) |
Thanks for this @kidroca!
Note: There's a draft PR to re-implement the iOS / Android caching: #13304 but we're not planning to move forward with that for another week (assuming the maintainer of https://github.com/DylanVann/react-native-fast-image/ doesn't respond sooner) So if we get your |
c4b7588
to
39a5238
Compare
@Beamanator @aimane-chnaif One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
reviewing today |
@aimane-chnaif I'm sorry if you've already started reviewing, but we're still going through a few revisions on the |
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.
Love what I've seen so far, got a few initial comments
39a5238
to
9e0a124
Compare
This comment was marked as outdated.
This comment was marked as outdated.
b8cf933
to
75e5c63
Compare
@aimane-chnaif FYI the changes in the related fork PR are very close to being approved, so feel free to jump in and start testing this when you have a chance 👍 🙏 |
This patch focuses on resolving issues encountered with avatar image loading, specifically addressing the challenges related to CORS (Cross-Origin Resource Sharing) errors. Changes: - Removed the `isAuthTokenRequired` flag from the `AttachmentModal` component in various files, including `ProfilePage.js`, `RoomHeaderAvatars.js`, and `DetailsPage.js`. This change is crucial for loading of avatar images that are hosted externally. Rationale: - The primary purpose of this modification is to streamline the loading process for avatars by removing the unnecessary inclusion of authentication tokens in requests for external images. This approach aligns with standard practices for handling externally hosted content and aims to enhance compatibility and performance. - Raised a question here as whether there are cases of avatar images that need authentication: https://github.com/Expensify/App/pull/24425/files#r1404352872 This update is expected to resolve the CORS errors associated with avatar image loading, thereby improving the overall functionality and user experience in our application.
061ee6e
to
cc49208
Compare
Done |
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.
LGTM! Some minor feedback
}, | ||
})(Image); | ||
ImageWithOnyx.resizeMode = RESIZE_MODES; | ||
ImageWithOnyx.resolveDimensions = resolveDimensions; |
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.
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.movAndroid: mWeb Chromemchrome.moviOS: Nativeios.moviOS: mWeb Safarimsafari.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
Pushed a commit to address the code style issues |
can you please also pull main and retest? almost 1k commits behind |
I've synced and re-tested - everything seems good, though there seems to be a Typescript error unrelated to my changes src/libs/actions/Link.ts:103:29 - error TS2345: Argument of type 'string' is not assignable to parameter of type 'AllRoutes | undefined'. |
It's being discussed here. |
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.
🎉
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.
LGTM!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/Beamanator in version: 1.4.9-0 🚀
|
🚀 Deployed to staging by https://github.com/Beamanator in version: 1.4.9-0 🚀
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.4.9-5 🚀
|
Details
This PR refactors the
Image
component, aligning the web/desktop and native implementations for better consistency and maintainability.Changes:
Introduced
BaseImage
Component:src/components/Image/BaseImage.js
onLoad
event, it ensures that both web and native platforms have the same signature.Native Implementation Update:
src/components/Image/BaseImage.native.js
react-native-fast-image
.Unified Image Component for Web/Desktop and Native:
src/components/Image/index.js
Image
component has been refactored to use the newBaseImage
.Removed Redundant Native Specific Implementation:
src/components/Image/index.native.js
Patch for
react-native-web
patches/react-native-web+0.19.9+005+image-header-support.patch
Fixed Issues
$ #12603
PROPOSAL: N/A
Tests
Verify the Image component works on all platforms
X-Chat-Attachment-Token
header.X-Chat-Attachment-Token
value changes.Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
Screen.Recording.2023-11-06.at.9.14.20.mp4
Mobile Web - Chrome
Mobile Web - Safari
Desktop
Screen.Recording.2023-11-06.at.10.27.12.mov
iOS
Android