Skip to content

Commit e84be2a

Browse files
authored
Merge pull request #3027 from GetStream/develop
Next Release
2 parents fbf559d + 6758d06 commit e84be2a

35 files changed

+389
-286
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[![NPM](https://img.shields.io/npm/v/stream-chat-react-native.svg)](https://www.npmjs.com/package/stream-chat-react-native)
1111
[![Build Status](https://github.com/GetStream/stream-chat-react-native/actions/workflows/release.yml/badge.svg)](https://github.com/GetStream/stream-chat-react-native/actions)
1212
[![Component Reference](https://img.shields.io/badge/docs-component%20reference-blue.svg)](https://getstream.io/chat/docs/sdk/reactnative)
13-
![JS Bundle Size](https://img.shields.io/badge/js_bundle_size-466%20KB-blue)
13+
![JS Bundle Size](https://img.shields.io/badge/js_bundle_size-467%20KB-blue)
1414

1515
<img align="right" src="https://getstream.imgix.net/images/ios-chat-tutorial/[email protected]?auto=format,enhance" width="50%" />
1616

@@ -48,9 +48,9 @@ For complete pricing details visit our [Chat Pricing Page](https://getstream.io/
4848

4949
This repo includes 3 example apps. One made with Expo, two in TypeScript. One TypeScript app is a simple implementation for reference, the other is a more full featured app example.
5050

51-
- [Expo example](./examples/ExpoMessaging)
52-
- [Typescript example](./examples/TypeScriptMessaging)
53-
- [Fully featured messaging application](./examples/SampleApp)
51+
- [Expo example](https://github.com/GetStream/stream-chat-react-native/tree/develop/examples/ExpoMessaging)
52+
- [Typescript example](https://github.com/GetStream/stream-chat-react-native/tree/develop/examples/TypeScriptMessaging)
53+
- [Fully featured messaging application](https://github.com/GetStream/stream-chat-react-native/tree/develop/examples/SampleApp)
5454

5555
Besides, our team maintains a dedicated repository for fully-fledged sample applications and demos at [GetStream/react-native-samples](https://github.com/GetStream/react-native-samples). Please consider checking following sample applications:
5656

package/expo-package/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4733,10 +4733,10 @@ [email protected], stream-buffers@~2.2.0:
47334733
resolved "https://registry.yarnpkg.com/stream-buffers/-/stream-buffers-2.2.0.tgz#91d5f5130d1cef96dcfa7f726945188741d09ee4"
47344734
integrity sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg==
47354735

4736-
4737-
version "6.6.7"
4738-
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-6.6.7.tgz#d887234af18890c3396f1b8b5f169d9b28a793ab"
4739-
integrity sha512-Xc/S92nUBSwfVPZqNjt/zNs/DJcRV1aRa/+yCSBCqjCwo0EuiWEP9yKy3xGxBkehNe4vaIDvkeREduA4dRUGpA==
4736+
4737+
version "6.6.8"
4738+
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-6.6.8.tgz#483ade63ba051426480ab2dfd8ab3b248b90ae88"
4739+
integrity sha512-F8S70DHaiit6BEdKOkSMHq2bjMONhrouvJ+szBQuE430EJDgUlc2VErHk3yJCzqIt5lwfVZktjHuqSIOGVg5LQ==
47404740
dependencies:
47414741
"@gorhom/bottom-sheet" "^5.1.1"
47424742
dayjs "1.10.5"

package/native-package/src/optionalDependencies/FlatList.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import { FlatList as DefaultFlatList, Platform } from 'react-native';
22
let FlatList;
33

4-
54
if (Platform.constants.reactNativeVersion.minor < 72) {
65
const upgradeLog =
7-
"'@stream-io/flat-list-mvcp' is deprecated, please upgrade your react-native version to >0.71 to get same the benefits on the default FlatList and uninstall the package.";
6+
"'@stream-io/flat-list-mvcp' is deprecated, please upgrade your react-native version to >0.71 to get same the benefits on the default FlatList and uninstall the package.";
87
try {
98
FlatList = require('@stream-io/flat-list-mvcp').FlatList;
109
console.log(upgradeLog);

package/native-package/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3409,10 +3409,10 @@ statuses@~1.5.0:
34093409
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
34103410
integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==
34113411

3412-
3413-
version "6.6.7"
3414-
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-6.6.7.tgz#d887234af18890c3396f1b8b5f169d9b28a793ab"
3415-
integrity sha512-Xc/S92nUBSwfVPZqNjt/zNs/DJcRV1aRa/+yCSBCqjCwo0EuiWEP9yKy3xGxBkehNe4vaIDvkeREduA4dRUGpA==
3412+
3413+
version "6.6.8"
3414+
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-6.6.8.tgz#483ade63ba051426480ab2dfd8ab3b248b90ae88"
3415+
integrity sha512-F8S70DHaiit6BEdKOkSMHq2bjMONhrouvJ+szBQuE430EJDgUlc2VErHk3yJCzqIt5lwfVZktjHuqSIOGVg5LQ==
34163416
dependencies:
34173417
"@gorhom/bottom-sheet" "^5.1.1"
34183418
dayjs "1.10.5"

package/src/components/Attachment/AudioAttachment.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ import { useTheme } from '../../contexts';
88
import { useAudioPlayer } from '../../hooks/useAudioPlayer';
99
import { Audio, Pause, Play } from '../../icons';
1010
import {
11+
NativeHandlers,
1112
PlaybackStatus,
12-
SDK,
13-
Sound,
1413
SoundReturnType,
1514
VideoPayloadData,
1615
VideoProgressData,
@@ -51,7 +50,7 @@ export const AudioAttachment = (props: AudioAttachmentProps) => {
5150
testID,
5251
} = props;
5352
const { changeAudioSpeed, pauseAudio, playAudio, seekAudio } = useAudioPlayer({ soundRef });
54-
const isExpoCLI = SDK === 'stream-chat-expo';
53+
const isExpoCLI = NativeHandlers.SDK === 'stream-chat-expo';
5554
const isVoiceRecording = item.type === FileTypes.VoiceRecording;
5655

5756
/** This is for Native CLI Apps */
@@ -181,8 +180,8 @@ export const AudioAttachment = (props: AudioAttachmentProps) => {
181180
useEffect(() => {
182181
if (isExpoCLI) {
183182
const initiateSound = async () => {
184-
if (item && item.file && item.file.uri) {
185-
soundRef.current = await Sound.initializeSound(
183+
if (item && item.file && item.file.uri && NativeHandlers.Sound?.initializeSound) {
184+
soundRef.current = await NativeHandlers.Sound.initializeSound(
186185
{ uri: item.file.uri },
187186
{
188187
progressUpdateIntervalMillis: 100,
@@ -216,7 +215,7 @@ export const AudioAttachment = (props: AudioAttachmentProps) => {
216215
}
217216
};
218217
// For expo CLI
219-
if (!Sound.Player) {
218+
if (!NativeHandlers.Sound?.Player) {
220219
initalPlayPause();
221220
}
222221
}, [item.paused, isExpoCLI, pauseAudio, playAudio]);
@@ -344,8 +343,8 @@ export const AudioAttachment = (props: AudioAttachmentProps) => {
344343
</View>
345344
)}
346345
</View>
347-
{Sound.Player && (
348-
<Sound.Player
346+
{NativeHandlers.Sound?.Player && (
347+
<NativeHandlers.Sound.Player
349348
onEnd={handleEnd}
350349
onLoad={handleLoad}
351350
onProgress={handleProgress}

package/src/components/AttachmentPicker/AttachmentPicker.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
} from '../../contexts/attachmentPickerContext/AttachmentPickerContext';
1818
import { useTheme } from '../../contexts/themeContext/ThemeContext';
1919
import { useScreenDimensions } from '../../hooks/useScreenDimensions';
20-
import { getPhotos, oniOS14GalleryLibrarySelectionChange } from '../../native';
20+
import { NativeHandlers } from '../../native';
2121
import type { Asset } from '../../types/types';
2222
import { BottomSheet } from '../BottomSheetCompatibility/BottomSheet';
2323
import { BottomSheetFlatList } from '../BottomSheetCompatibility/BottomSheetFlatList';
@@ -122,11 +122,12 @@ export const AttachmentPicker = React.forwardRef(
122122
setLoadingPhotos(true);
123123
const endCursor = endCursorRef.current;
124124
try {
125-
if (!getPhotos) {
125+
if (!NativeHandlers.getPhotos) {
126126
setPhotos([]);
127127
setIosLimited(false);
128+
return;
128129
}
129-
const results = await getPhotos({
130+
const results = await NativeHandlers.getPhotos({
130131
after: endCursor,
131132
first: numberOfAttachmentImagesToLoadPerCall ?? 60,
132133
});
@@ -153,11 +154,11 @@ export const AttachmentPicker = React.forwardRef(
153154
return;
154155
}
155156

156-
if (!oniOS14GalleryLibrarySelectionChange) {
157+
if (!NativeHandlers.oniOS14GalleryLibrarySelectionChange) {
157158
return;
158159
}
159160
// ios 14 library selection change event is fired when user reselects the images that are permitted to be readable by the app
160-
const { unsubscribe } = oniOS14GalleryLibrarySelectionChange(() => {
161+
const { unsubscribe } = NativeHandlers.oniOS14GalleryLibrarySelectionChange(() => {
161162
// we reset the cursor and has next page to true to facilitate fetching of the first page of photos again
162163
hasNextPageRef.current = true;
163164
endCursorRef.current = undefined;

package/src/components/AttachmentPicker/components/AttachmentPickerIOSSelectMorePhotos.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Pressable, StyleSheet, Text } from 'react-native';
33

44
import { useTheme } from '../../../contexts/themeContext/ThemeContext';
55
import { useTranslationContext } from '../../../contexts/translationContext/TranslationContext';
6-
import { iOS14RefreshGallerySelection } from '../../../native';
6+
import { NativeHandlers } from '../../../native';
77

88
export const AttachmentPickerIOSSelectMorePhotos = () => {
99
const { t } = useTranslationContext();
@@ -13,13 +13,13 @@ export const AttachmentPickerIOSSelectMorePhotos = () => {
1313
},
1414
} = useTheme();
1515

16-
if (!iOS14RefreshGallerySelection) {
16+
if (!NativeHandlers.iOS14RefreshGallerySelection) {
1717
return null;
1818
}
1919

2020
return (
2121
<Pressable
22-
onPress={iOS14RefreshGallerySelection}
22+
onPress={NativeHandlers.iOS14RefreshGallerySelection}
2323
style={[styles.container, { backgroundColor: white }]}
2424
>
2525
<Text style={[styles.text, { color: accent_blue }]}>{t<string>('Select More Photos')}</Text>

package/src/components/Channel/Channel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ import {
8484
WutReaction,
8585
} from '../../icons';
8686
import {
87-
FlatList as FlatListDefault,
8887
isDocumentPickerAvailable,
8988
isImageMediaLibraryAvailable,
9089
isImagePickerAvailable,
90+
NativeHandlers,
9191
} from '../../native';
9292
import * as dbApi from '../../store/apis';
9393
import { ChannelUnreadState, DefaultStreamChatGenerics, FileTypes } from '../../types/types';
@@ -538,7 +538,7 @@ const ChannelWithContext = <
538538
FileAttachmentGroup = FileAttachmentGroupDefault,
539539
FileAttachmentIcon = FileIconDefault,
540540
FileUploadPreview = FileUploadPreviewDefault,
541-
FlatList = FlatListDefault,
541+
FlatList = NativeHandlers.FlatList,
542542
forceAlignMessages,
543543
Gallery = GalleryDefault,
544544
getMessagesGroupStyles,

package/src/components/Chat/Chat.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
import { useStreami18n } from '../../hooks/useStreami18n';
2424
import init from '../../init';
2525

26-
import { SDK } from '../../native';
26+
import { NativeHandlers } from '../../native';
2727
import { SqliteClient } from '../../store/SqliteClient';
2828
import type { DefaultStreamChatGenerics } from '../../types/types';
2929
import { DBSyncManager } from '../../utils/DBSyncManager';
@@ -187,9 +187,9 @@ const ChatWithContext = <
187187

188188
useEffect(() => {
189189
if (client) {
190-
const sdkName = (SDK ? SDK.replace('stream-chat-', '') : 'react-native') as
191-
| 'react-native'
192-
| 'expo';
190+
const sdkName = (
191+
NativeHandlers.SDK ? NativeHandlers.SDK.replace('stream-chat-', '') : 'react-native'
192+
) as 'react-native' | 'expo';
193193
client.sdkIdentifier = {
194194
name: sdkName,
195195
version,

package/src/components/ImageGallery/__tests__/ImageGallery.test.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ jest.mock('../../../native.ts', () => {
2828
isImageMediaLibraryAvailable: jest.fn(() => true),
2929
isShareImageAvailable: jest.fn(() => true),
3030
isVideoPlayerAvailable: jest.fn(() => true),
31-
Video: View,
31+
NativeHandlers: {
32+
Video: View,
33+
},
3234
};
3335
});
3436

0 commit comments

Comments
 (0)