-
Notifications
You must be signed in to change notification settings - Fork 46
[CLNP-7734] feat: support expo-file-system in expo 54 or higher #273
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
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #273 +/- ##
==========================================
- Coverage 10.88% 10.85% -0.04%
==========================================
Files 360 360
Lines 9019 9047 +28
Branches 2421 2555 +134
==========================================
Hits 982 982
+ Misses 8036 7989 -47
- Partials 1 76 +75 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Pull Request Overview
This PR adds support for expo-file-system SDK 54+ while maintaining backward compatibility with the legacy API. The new SDK introduced breaking changes to the file system API, replacing async methods like getInfoAsync() with a new object-oriented approach using File and Directory classes.
- Introduces type definitions for both legacy and new expo-file-system APIs
- Implements utility functions to abstract API differences and detect which version is in use
- Updates existing file operations to use the new backward-compatible utility functions
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/uikit-react-native/src/utils/expoBackwardUtils.ts | Adds type definitions for legacy and new expo-file-system APIs, implements detection logic and wrapper functions for file operations (getFileInfo, getDocumentDirectory, getCacheDirectory, downloadFile) |
| packages/uikit-react-native/src/platform/createMediaService.expo.tsx | Updates image compression to use new getFileInfo utility function instead of direct fsModule.getInfoAsync call |
| packages/uikit-react-native/src/platform/createFileService.expo.ts | Updates file download and record file path creation to use new utility functions for accessing directories and downloading files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| compress: Math.min(Math.max(0, compressionRate), 1), | ||
| }); | ||
| const fileInfo = await fsModule.getInfoAsync(uri); | ||
| const fileInfo = await expoBackwardUtils.fileSystem.getFileInfo(fsModule, uri); |
Copilot
AI
Nov 12, 2025
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.
The file info is being retrieved for the original uri instead of the compressedURI. This means the returned size will be incorrect - it will reflect the original file size rather than the compressed file size.
Suggested fix:
const fileInfo = await expoBackwardUtils.fileSystem.getFileInfo(fsModule, compressedURI);| const fileInfo = await expoBackwardUtils.fileSystem.getFileInfo(fsModule, uri); | |
| const fileInfo = await expoBackwardUtils.fileSystem.getFileInfo(fsModule, compressedURI); |
bang9
left a comment
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!
External Contributions
This project is not yet set up to accept pull requests from external contributors.
If you have a pull request that you believe should be accepted, please contact
the Developer Relations team [email protected] with details
and we'll evaluate if we can setup a CLA to allow for the contribution.
For Internal Contributors
[CLNP-7734](https://sendbird.atlassian.net/browse/CLNP-7734)
Description Of Changes
Expo 54부터 expo-file-system의 api 가 변경되어 기존의 백워드 유지하면서 지원하도록 수정하였습니다
Types Of Changes
What types of changes does your code introduce to this project?
Put an
xin the boxes that apply_