Skip to content

Commit 3acc942

Browse files
authored
fix: make react-native-image-crop-picker optional (#2603)
* fix: make react-native-image-crop-picker optional * fix: tests * docs: add optional deps docs * docs: add note for the optional dependency
1 parent 65447fe commit 3acc942

File tree

34 files changed

+280
-226
lines changed

34 files changed

+280
-226
lines changed

docusaurus/docs/reactnative/basics/installation.mdx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ Stream Chat React Native SDK requires installing some peer dependencies to provi
5656
<TabItem value='rncli'>
5757

5858
```bash title="Terminal"
59-
yarn add @react-native-camera-roll/camera-roll @react-native-community/netinfo @stream-io/flat-list-mvcp react-native-fs react-native-gesture-handler react-native-image-crop-picker react-native-image-resizer react-native-reanimated react-native-svg
59+
yarn add @react-native-camera-roll/camera-roll @react-native-community/netinfo @stream-io/flat-list-mvcp react-native-fs react-native-gesture-handler react-native-image-resizer react-native-reanimated react-native-svg
6060
```
6161

6262
</TabItem>
6363

6464
<TabItem value='expo'>
6565

6666
```bash title="Terminal"
67-
npx expo install @stream-io/flat-list-mvcp @react-native-community/netinfo expo-file-system expo-image-manipulator expo-image-picker expo-media-library react-native-gesture-handler react-native-reanimated react-native-svg
67+
npx expo install @stream-io/flat-list-mvcp @react-native-community/netinfo expo-file-system expo-image-manipulator expo-media-library react-native-gesture-handler react-native-reanimated react-native-svg
6868
```
6969

7070
</TabItem>
@@ -87,7 +87,6 @@ values={[
8787
- [`@stream-io/flat-list-mvcp`](https://github.com/GetStream/flat-list-mvcp) for bi-directional FlatList support.
8888
- [`react-native-fs`](https://github.com/itinance/react-native-fs) to perform file operations like save, delete, etc.
8989
- [`react-native-gesture-handler`](https://github.com/software-mansion/react-native-gesture-handler) to handle gestures within the SDK.
90-
- [`react-native-image-crop-picker`](https://github.com/ivpusic/react-native-image-crop-picker) to capture images to attach them in the message.
9190
- [`react-native-image-resizer`](https://github.com/bamlab/react-native-image-resizer) to compress image uploads.
9291
- [`react-native-reanimated`](https://github.com/software-mansion/react-native-reanimated) to compress image uploads.
9392
- [`react-native-svg`](https://github.com/react-native-svg/react-native-svg) for SVG support.
@@ -100,7 +99,6 @@ values={[
10099
- [`@stream-io/flat-list-mvcp`](https://github.com/GetStream/flat-list-mvcp) for bi-directional FlatList support.
101100
- [`expo-file-system`](https://docs.expo.dev/versions/latest/sdk/filesystem/) to perform file operations like save, delete, etc.
102101
- [`react-native-gesture-handler`](https://github.com/software-mansion/react-native-gesture-handler) to handle gestures within the SDK.
103-
- [`expo-image-picker`](https://docs.expo.dev/versions/latest/sdk/imagepicker/) to capture images to attach them in the message.
104102
- [`expo-image-manipulator`](https://docs.expo.dev/versions/latest/sdk/imagemanipulator/) to compress image uploads.
105103
- [`react-native-reanimated`](https://github.com/software-mansion/react-native-reanimated) to compress image uploads.
106104
- [`react-native-svg`](https://docs.expo.dev/versions/latest/sdk/svg/) for SVG support.
@@ -110,6 +108,10 @@ values={[
110108

111109
### Optional Dependencies
112110

111+
:::note
112+
Starting from `v5.35.0` the `react-native-image-crop-picker` and `expo-image-picker` is no longer a required dependency. You can use it if you want to capture images to attach them in the message else feel free to uninstall it.
113+
:::
114+
113115
There are a few optional dependencies that can be added to have more features within the SDK.
114116

115117
<Tabs
@@ -122,6 +124,7 @@ values={[
122124
>
123125
<TabItem value='rncli'>
124126

127+
- [`react-native-image-crop-picker`](https://github.com/ivpusic/react-native-image-crop-picker) to capture images to attach them in the message.
125128
- [`react-native-video`](https://github.com/react-native-video/react-native-video) for Video and Audio playback support.
126129
- [`react-native-audio-recorder-player`](https://github.com/hyochan/react-native-audio-recorder-player) for Audio recording and async audio messages support.
127130
- [`react-native-share`](https://github.com/react-native-share/react-native-share) for Attachment sharing support.
@@ -134,6 +137,7 @@ values={[
134137
<TabItem value="expo">
135138

136139
- [`expo-av`](https://docs.expo.dev/versions/latest/sdk/av/) for Video and Audio playback, recording and async audio messages support.
140+
- [`expo-image-picker`](https://docs.expo.dev/versions/latest/sdk/imagepicker/) to capture images to attach them in the message.
137141
- [`expo-sharing`](https://docs.expo.dev/versions/latest/sdk/sharing/) for Attachments sharing support.
138142
- [`expo-haptics`](https://docs.expo.dev/versions/latest/sdk/haptics/) for user haptics support.
139143
- [`expo-clipboard`](https://docs.expo.dev/versions/latest/sdk/clipboard/) for Copy message support.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Enable the file picker on the [`MessageInput`](../../../../ui-components/message-input.mdx) component.
2+
3+
| Type | Default |
4+
| ------- | ------- |
5+
| Boolean | `true` |

docusaurus/docs/reactnative/common-content/ui-components/channel/props/has_file_picker.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ Enable the file picker on the [`MessageInput`](../../../../ui-components/message
22

33
| Type | Default |
44
| ------- | ------- |
5-
| boolean | true |
5+
| Boolean | `true` |

docusaurus/docs/reactnative/common-content/ui-components/channel/props/has_image_picker.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ Enable the image picker on the [`MessageInput`](../../../../ui-components/messag
22

33
| Type | Default |
44
| ------- | ------- |
5-
| boolean | true |
5+
| Boolean | `true` |

docusaurus/docs/reactnative/contexts/message-input-context.mdx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import DoDocUploadRequest from '../common-content/ui-components/channel/props/do
2626
import DoImageUploadRequest from '../common-content/ui-components/channel/props/do_image_upload_request.mdx';
2727
import EmojiSearchIndex from '../common-content/ui-components/channel/props/emoji_search_index.mdx';
2828
import FileUploadPreview from '../common-content/ui-components/channel/props/file_upload_preview.mdx';
29+
import HasCameraPicker from '../common-content/ui-components/channel/props/has_camera_picker.mdx';
2930
import HasCommands from '../common-content/ui-components/channel/props/has_commands.mdx';
3031
import HasFilePicker from '../common-content/ui-components/channel/props/has_file_picker.mdx';
3132
import HasImagePicker from '../common-content/ui-components/channel/props/has_image_picker.mdx';
@@ -182,15 +183,19 @@ const { sendMessage, toggleAttachmentPicker } = useMessageInputContext();
182183

183184
<EmojiSearchIndex />
184185

186+
### <div class="label description">_forwarded from [Channel](../../core-components/channel#hascamerapicker)_ props</div> `hasCameraPicker` {#hascamerapicker}
187+
188+
<HasCameraPicker />
189+
185190
### <div class="label description">_forwarded from [Channel](../../core-components/channel#hascommands)_ props</div> `hasCommands` {#hascommands}
186191

187192
<HasCommands />
188193

189-
### <div class="label description">_forwarded from [Channel](../../core-components/channel#hasfilepicker)_ props</div> hasFilePicker {#hasfilepicker}
194+
### <div class="label description">_forwarded from [Channel](../../core-components/channel#hasfilepicker)_ props</div> `hasFilePicker` {#hasfilepicker}
190195

191196
<HasFilePicker />
192197

193-
### <div class="label description">_forwarded from [Channel](../../core-components/channel#hasimagepicker)_ props</div> hasImagePicker {#hasimagepicker}
198+
### <div class="label description">_forwarded from [Channel](../../core-components/channel#hasimagepicker)_ props</div> `hasImagePicker` {#hasimagepicker}
194199

195200
<HasImagePicker />
196201

docusaurus/docs/reactnative/core-components/channel.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ import HandleQuotedReply from '../common-content/ui-components/channel/props/han
7474
import HandleReaction from '../common-content/ui-components/channel/props/handle_reaction.mdx';
7575
import HandleRetry from '../common-content/ui-components/channel/props/handle_retry.mdx';
7676
import HandleThreadReply from '../common-content/ui-components/channel/props/handle_thread_reply.mdx';
77+
import HasCameraPicker from '../common-content/ui-components/channel/props/has_camera_picker.mdx';
7778
import HasCommands from '../common-content/ui-components/channel/props/has_commands.mdx';
7879
import HasFilePicker from '../common-content/ui-components/channel/props/has_file_picker.mdx';
7980
import HasImagePicker from '../common-content/ui-components/channel/props/has_image_picker.mdx';
@@ -524,6 +525,10 @@ The max allowable is 255, which when reached displays as `255+`.
524525

525526
<HandleThreadReply />
526527

528+
### `hasCameraPicker`
529+
530+
<HasCameraPicker />
531+
527532
### `hasCommands`
528533

529534
<HasCommands />

examples/SampleApp/ios/Podfile.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,15 +1240,15 @@ PODS:
12401240
- glog
12411241
- RCT-Folly (= 2022.05.16.00)
12421242
- React-Core
1243-
- RNImageCropPicker (0.39.0):
1243+
- RNImageCropPicker (0.41.2):
12441244
- React-Core
12451245
- React-RCTImage
1246-
- RNImageCropPicker/QBImagePickerController (= 0.39.0)
1247-
- TOCropViewController
1248-
- RNImageCropPicker/QBImagePickerController (0.39.0):
1246+
- RNImageCropPicker/QBImagePickerController (= 0.41.2)
1247+
- TOCropViewController (~> 2.7.4)
1248+
- RNImageCropPicker/QBImagePickerController (0.41.2):
12491249
- React-Core
12501250
- React-RCTImage
1251-
- TOCropViewController
1251+
- TOCropViewController (~> 2.7.4)
12521252
- RNNotifee (7.8.2):
12531253
- React-Core
12541254
- RNNotifee/NotifeeCore (= 7.8.2)
@@ -1276,7 +1276,7 @@ PODS:
12761276
- libwebp (~> 1.0)
12771277
- SDWebImage/Core (~> 5.10)
12781278
- SocketRocket (0.6.1)
1279-
- TOCropViewController (2.6.1)
1279+
- TOCropViewController (2.7.4)
12801280
- Yoga (1.14.0)
12811281

12821282
DEPENDENCIES:
@@ -1608,7 +1608,7 @@ SPEC CHECKSUMS:
16081608
RNFBMessaging: 9b16c72d001787aca05e2fb997e5c979b821dbb4
16091609
RNFS: 4ac0f0ea233904cb798630b3c077808c06931688
16101610
RNGestureHandler: 2e3251b41d462552997c61afd680220d019fea65
1611-
RNImageCropPicker: 14fe1c29298fb4018f3186f455c475ab107da332
1611+
RNImageCropPicker: 771e2ca319d2cf92e04ebf334ece892ee9a6728f
16121612
RNNotifee: 8e2d3df3f0e9ce8f5d1fe4c967431138190b6175
16131613
RNReactNativeHapticFeedback: afa5bf2794aecbb2dba2525329253da0d66656df
16141614
RNReanimated: 440ca83ef0a79a3376455663fc4a01300e131240
@@ -1618,7 +1618,7 @@ SPEC CHECKSUMS:
16181618
SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d
16191619
SDWebImageWebPCoder: 908b83b6adda48effe7667cd2b7f78c897e5111d
16201620
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
1621-
TOCropViewController: edfd4f25713d56905ad1e0b9f5be3fbe0f59c863
1621+
TOCropViewController: 80b8985ad794298fb69d3341de183f33d1853654
16221622
Yoga: 9e6a04eacbd94f97d94577017e9f23b3ab41cf6c
16231623

16241624
PODFILE CHECKSUM: 751ee2c534898a790da0a7dba7d623f1f21ae757

examples/SampleApp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"react-native-fs": "^2.18.0",
4343
"react-native-gesture-handler": "^2.14.0",
4444
"react-native-haptic-feedback": "2.0.3",
45-
"react-native-image-crop-picker": "0.39.0",
45+
"react-native-image-crop-picker": "^0.41.2",
4646
"react-native-image-resizer": "1.4.5",
4747
"react-native-markdown-package": "1.8.2",
4848
"react-native-quick-sqlite": "8.0.2",

examples/SampleApp/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6203,10 +6203,10 @@ [email protected]:
62036203
resolved "https://registry.yarnpkg.com/react-native-haptic-feedback/-/react-native-haptic-feedback-2.0.3.tgz#09133b2175503831c04798cb0dc63ae91e3959c1"
62046204
integrity sha512-7+qvcxXZts/hA+HOOIFyM1x9m9fn/TJVSTgXaoQ8uT4gLc97IMvqHQ559tDmnlth+hHMzd3HRMpmRLWoKPL0DA==
62056205

6206-
react-native-image-crop-picker@0.39.0:
6207-
version "0.39.0"
6208-
resolved "https://registry.yarnpkg.com/react-native-image-crop-picker/-/react-native-image-crop-picker-0.39.0.tgz#9cb8e8ffb0e8ab06f7b3227cadf077169e225eba"
6209-
integrity sha512-4aANbQMrmU6zN/4b0rVBA7SbaZ3aa5JESm3Xk751sINybZMt1yz/9h95LkO7U0pbslHDo3ofXjG75PmQRP6a/w==
6206+
react-native-image-crop-picker@^0.41.2:
6207+
version "0.41.2"
6208+
resolved "https://registry.yarnpkg.com/react-native-image-crop-picker/-/react-native-image-crop-picker-0.41.2.tgz#824fa8fee8391fbb3e0b5ae2973221a2dff0cafb"
6209+
integrity sha512-GcDu/adXU/1y/MrxsbOfqcGRGWC2pTttt5VGy/jyRJ6GXfoC29fTQf8SG5kGtc5schSR6K+mKYO4uW6eJPljlQ==
62106210

62116211
62126212
version "1.4.5"

examples/TypeScriptMessaging/ios/Podfile.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,15 +1148,15 @@ PODS:
11481148
- glog
11491149
- RCT-Folly (= 2022.05.16.00)
11501150
- React-Core
1151-
- RNImageCropPicker (0.39.0):
1151+
- RNImageCropPicker (0.41.2):
11521152
- React-Core
11531153
- React-RCTImage
1154-
- RNImageCropPicker/QBImagePickerController (= 0.39.0)
1155-
- TOCropViewController
1156-
- RNImageCropPicker/QBImagePickerController (0.39.0):
1154+
- RNImageCropPicker/QBImagePickerController (= 0.41.2)
1155+
- TOCropViewController (~> 2.7.4)
1156+
- RNImageCropPicker/QBImagePickerController (0.41.2):
11571157
- React-Core
11581158
- React-RCTImage
1159-
- TOCropViewController
1159+
- TOCropViewController (~> 2.7.4)
11601160
- RNReactNativeHapticFeedback (2.0.3):
11611161
- React-Core
11621162
- RNReanimated (3.7.1):
@@ -1173,7 +1173,7 @@ PODS:
11731173
- RNSVG (14.1.0):
11741174
- React-Core
11751175
- SocketRocket (0.6.1)
1176-
- TOCropViewController (2.6.1)
1176+
- TOCropViewController (2.7.4)
11771177
- Yoga (1.14.0)
11781178

11791179
DEPENDENCIES:
@@ -1497,14 +1497,14 @@ SPEC CHECKSUMS:
14971497
RNCMaskedView: 0e1bc4bfa8365eba5fbbb71e07fbdc0555249489
14981498
RNFS: 4ac0f0ea233904cb798630b3c077808c06931688
14991499
RNGestureHandler: 67fb54b3e6ca338a8044e85cd6f340265aa41091
1500-
RNImageCropPicker: 14fe1c29298fb4018f3186f455c475ab107da332
1500+
RNImageCropPicker: 771e2ca319d2cf92e04ebf334ece892ee9a6728f
15011501
RNReactNativeHapticFeedback: afa5bf2794aecbb2dba2525329253da0d66656df
15021502
RNReanimated: 15a855719335a6b655a214531e86d806edfd49da
15031503
RNScreens: 17e2f657f1b09a71ec3c821368a04acbb7ebcb46
15041504
RNShare: d82e10f6b7677f4b0048c23709bd04098d5aee6c
15051505
RNSVG: ba3e7232f45e34b7b47e74472386cf4e1a676d0a
15061506
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
1507-
TOCropViewController: edfd4f25713d56905ad1e0b9f5be3fbe0f59c863
1507+
TOCropViewController: 80b8985ad794298fb69d3341de183f33d1853654
15081508
Yoga: d17d2cc8105eed528474683b42e2ea310e1daf61
15091509

15101510
PODFILE CHECKSUM: 90406e1e85c82b37484f5d746afa45c0637bb4b3

0 commit comments

Comments
 (0)