| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
feat: native multipart upload (#3566) ## 🎯 Goal This PR adds optional native multipart upload support for React Native and Expo packages, with native iOS/Android uploaders, a JS axios adapter, upload progress propagation and new attachment progress UI. Additionally, it also moves pending attachment uploads onto `client.uploadManager`, adds local attachment id tracking, improves video/document attachment handling, and updates SampleApp to exercise the new native upload path. The reason why we decided to add an opt-in native upload is related to the fact that `axios` does not always report upload progress correctly on React Native, especially Android. It will sometimes either not update the progress at all or report it badly, causing UI glitches. Additionally, native uploads are much, much faster as we take advantage of streaming directly without any intermediate ephemeral files in order to do that. Finally, `axios` can easily break if an override to the underlying RN's `fetch` implementation has been made, especially on `Android`. ## What Changed - Added a shared native multipart upload module for iOS and Android, including request parsing, file/text multipart parts, progress events, cancellation, timeouts, response handling, and bounded response body reads. - Added native package and Expo package bindings for `StreamMultipartUploader`, plus native handler registration through `stream-chat-react-native` and `stream-chat-expo` - Added core JS helpers and public types for native multipart upload requests, responses, progress events, abort handling, and uploader creation - Added `installNativeMultipartAdapter` / `wrapAxiosAdapterWithNativeMultipart` to route multipart `FormData` axios requests through the native uploader when available, while leaving non-multipart requests on the existing adapter - Added `Chat` support for enabling native multipart uploads via `useNativeMultipartUpload`; SampleApp enables this path - Reworked pending message attachment uploads to use `client.uploadManager.upload` by local attachment id instead of directly calling `channel.sendImage` / `channel.sendFile` - Added `localId` propagation from local attachments into message attachments so pending uploads can be correlated with `client.uploadManager` - Updated message sendability and upload indicator behavior to depend on `allowSendBeforeAttachmentsUpload` rather than offline support - Added upload progress UI for image, video, file, and audio attachments, including circular determinate progress, media overlays, file/audio byte progress labels, and a short completion hold to avoid UI flicker - Added new overrideable/default components for attachment upload progress: `AttachmentUploadIndicator`, `CircularProgressIndicator`, and `MediaUploadProgressOverlay` - Updated gallery/video thumbnail rendering so pending media attachments can show upload progress overlays - Updated document picking in both native and Expo packages to generate thumbnails for picked video files (this was missing from V9 initially) - Updated iOS video thumbnail URL handling to strip query and fragment data from local file URLs - Refined native iOS shimmer behavior to reduce animation restarts, handle foreground/background transitions, visibility, alpha, trait changes, and resolved color updates more reliably (this should improve shimmer performance for iOS significantly) - Updated `Android` shared native source syncing to resolve shared native sources from the canonical project path - Replaced SampleApp’s `react-native-fast-image` dependency with `@d11/react-native-fast-image` ## 🛠 Implementation details <!-- Provide a description of the implementation --> ## 🎨 UI Changes <!-- Add relevant screenshots --> <details> <summary>iOS</summary> <table> <thead> <tr> <td>Before</td> <td>After</td> </tr> </thead> <tbody> <tr> <td> <!--<img src="" /> --> </td> <td> <!--<img src="" /> --> </td> </tr> </tbody> </table> </details> <details> <summary>Android</summary> <table> <thead> <tr> <td>Before</td> <td>After</td> </tr> </thead> <tbody> <tr> <td> <!--<img src="" /> --> </td> <td> <!--<img src="" /> --> </td> </tr> </tbody> </table> </details> ## 🧪 Testing <!-- Explain how this change can be tested (or why it can't be tested) --> ## ☑️ Checklist - [ ] I have signed the [Stream CLA](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform) (required) - [ ] PR targets the `develop` branch - [ ] Documentation is updated - [ ] New code is tested in main example apps, including all possible scenarios - [ ] SampleApp iOS and Android - [ ] Expo iOS and Android --------- Co-authored-by: Zita Szupera <szuperaz@gmail.com> | 4 个月前 | |
chore(yarn): migrate to Yarn 4 + native workspaces (#3594) ## 🎯 Goal Move us onto Yarn 4 with native workspaces and drop Lerna. The `.yarnrc.yml` was already half-migrated, but `yarnPath` still pointed at the v1 binary — this finishes that off. ## 🛠 Implementation details Tooling only; nothing in `package/src` changes. Roughly: - `.yarn/releases/` swapped to 4.14.1, and all seven `yarn.lock` files migrated v1 → v8 in place — resolutions preserved, no drift. - Single root `workspaces` array now covers `package/`, both native wrapper packages, and all three example apps. `link:../../package/*` becomes `workspace:^`, nested lockfiles are gone, and the install-and-build-sdk composite action collapses to one `yarn install --immutable`. - Shared-native sync + husky setup run from the core SDK workspace's `postinstall` (Yarn 4 doesn't run root-workspace lifecycle scripts on install). - Lerna removed: `release/release.config.js` no longer reads `lerna.json`, and `release` / `release-next` / `extract-changelog` use `yarn workspaces foreach`. - Husky 6 → 9 (the v6 hook boilerplate is on the deprecation path). - `.yarnrc.yml` picks up the conservative hardening tier: `enableHardenedMode`, `npmMinimalAgeGate: 3d`, `enableScripts: false` with a small `dependenciesMeta` allowlist for the packages that genuinely need to build (`@swc/core`, `better-sqlite3`, `react-native-nitro-modules`, `unrs-resolver`). - CI workflows cache `.yarn/` via setup-node; drive-by fix for the deprecated `::set-output` calls in `changelog-preview.yml`. ## 🎨 UI Changes N/A. ## 🧪 Testing Locally: `yarn install --immutable` is clean, `yarn lint` + `yarn build` pass, husky hooks fired on every commit in this PR. Can't verify locally: example apps on real devices, and the release flow itself. The Lerna → `yarn workspaces foreach` rewrite is the riskiest single change — worth a dry-run on a throwaway branch before merging. ## ☑️ Checklist - [x] I have signed the [Stream CLA](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform) (required) - [x] PR targets the `develop` branch - [x] Documentation is updated - [ ] New code is tested in main example apps, including all possible scenarios - [ ] SampleApp iOS and Android - [ ] Expo iOS and Android --------- Co-authored-by: Ivan Sekovanikj <ivan.sekovanikj@getstream.io> | 3 个月前 | |
fix: expo clipboard and extend with cb api (#3758) ## 🎯 Goal Resolves [this Zendesk ticket](https://getstream.zendesk.com/agent/tickets/82587). ## 🛠 Implementation details `expo-clipboard` has changed their API from the synchronous `setString` to the asynchronous `setStringAsync`. Our optional dependency for this exact purpose was never really updated and so copying messages did not work whenever using `stream-chat-expo`. In this PR we address that. Additionally, I noticed that a confirmation/failure snackbar was missing from the clipboard feature and so we add one as well. Since changing to an async API is technically breaking, we'll rely on the success/failure callbacks for now and update this in the next major. We anyway want to get rid of the dependencies to these super small libraries and keep them inhouse. Will be backported to V8 as well. ## 🎨 UI Changes <!-- Add relevant screenshots --> <details> <summary>iOS</summary> <table> <thead> <tr> <td>Before</td> <td>After</td> </tr> </thead> <tbody> <tr> <td> <!--<img src="" /> --> </td> <td> <!--<img src="" /> --> </td> </tr> </tbody> </table> </details> <details> <summary>Android</summary> <table> <thead> <tr> <td>Before</td> <td>After</td> </tr> </thead> <tbody> <tr> <td> <!--<img src="" /> --> </td> <td> <!--<img src="" /> --> </td> </tr> </tbody> </table> </details> ## 🧪 Testing <!-- Explain how this change can be tested (or why it can't be tested) --> ## ☑️ Checklist - [ ] I have signed the [Stream CLA](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform) (required) - [ ] PR targets the `develop` branch - [ ] Documentation is updated - [ ] New code is tested in main example apps, including all possible scenarios - [ ] SampleApp iOS and Android - [ ] Expo iOS and Android | 1 个月前 | |
fix: expose default native handlers (#3704) ## 🎯 Goal This PR addresses [this GH issue](https://github.com/GetStream/stream-chat-react-native/issues/3379). While exposing a prop might be slightly more convenient, our native handlers have a ton of arguments we don't want to expose every single one of them separately as it will cause an argument storm. Instead, we expose the default native handlers and allow integrators to use them as they see fit. For example, they could invoke them with different properties, make them conditionally depend on configuration and similar. It would also make it easier to conditionally override the handlers in certain scenarios. Runtime passing of different arguments should still be done on the callsites themselves, this approach is more of a global switch to something else if necessary. ## 🛠 Implementation details <!-- Provide a description of the implementation --> ## 🎨 UI Changes <!-- Add relevant screenshots --> <details> <summary>iOS</summary> <table> <thead> <tr> <td>Before</td> <td>After</td> </tr> </thead> <tbody> <tr> <td> <!--<img src="" /> --> </td> <td> <!--<img src="" /> --> </td> </tr> </tbody> </table> </details> <details> <summary>Android</summary> <table> <thead> <tr> <td>Before</td> <td>After</td> </tr> </thead> <tbody> <tr> <td> <!--<img src="" /> --> </td> <td> <!--<img src="" /> --> </td> </tr> </tbody> </table> </details> ## 🧪 Testing <!-- Explain how this change can be tested (or why it can't be tested) --> ## ☑️ Checklist - [ ] I have signed the [Stream CLA](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform) (required) - [ ] PR targets the `develop` branch - [ ] Documentation is updated - [ ] New code is tested in main example apps, including all possible scenarios - [ ] SampleApp iOS and Android - [ ] Expo iOS and Android | 2 个月前 |