Skip to content

Commit 3fddc34

Browse files
committed
chore: add react native 0.78 and react 19 compatibility
1 parent 19a7d18 commit 3fddc34

File tree

26 files changed

+2328
-4629
lines changed

26 files changed

+2328
-4629
lines changed

package/expo-package/yarn.lock

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,10 +1439,10 @@
14391439
find-up "^5.0.0"
14401440
js-yaml "^4.1.0"
14411441

1442-
"@gorhom/bottom-sheet@^5.0.6":
1443-
version "5.0.6"
1444-
resolved "https://registry.yarnpkg.com/@gorhom/bottom-sheet/-/bottom-sheet-5.0.6.tgz#f20736502399c7bcf8c73ea09e6b571dc07fe0eb"
1445-
integrity sha512-SI/AhPvgRfnCWN6/+wbE6TXwRE4X8F2fLyE4L/0bRwgE34Zenq585qLT139uEcfCIyovC2swC3ICqQpkmWEcFA==
1442+
"@gorhom/bottom-sheet@^5.1.1":
1443+
version "5.1.1"
1444+
resolved "https://registry.yarnpkg.com/@gorhom/bottom-sheet/-/bottom-sheet-5.1.1.tgz#43ecb9e7b4d4ca4b4cefdf3b6b497f7715f350bc"
1445+
integrity sha512-Y8FiuRmeZYaP+ZGQ0axDwWrrKqVp4ByYRs1D2fTJTxHMt081MHHRQsqmZ3SK7AFp3cSID+vTqnD8w/KAASpy+w==
14461446
dependencies:
14471447
"@gorhom/portal" "1.0.14"
14481448
invariant "^2.2.4"
@@ -5113,12 +5113,12 @@ [email protected], stream-buffers@~2.2.0:
51135113
resolved "https://registry.yarnpkg.com/stream-buffers/-/stream-buffers-2.2.0.tgz#91d5f5130d1cef96dcfa7f726945188741d09ee4"
51145114
integrity sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg==
51155115

5116-
5117-
version "6.6.5"
5118-
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-6.6.5.tgz#ac34a1bd2ec3b950b3bc8bc122ec826d6dd51113"
5119-
integrity sha512-SZyr/TlOoW+j7t4X/CXBhvQ8LN8AgFg4vR6UfcP151fYvf4uwMrzmMN1T/IBsUBr30Kjmr54ik/dH0Z+tnLX2w==
5116+
5117+
version "6.6.6"
5118+
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-6.6.6.tgz#d701beb9652f0a5851286f752d8c4fdadb3e0603"
5119+
integrity sha512-sfBtWz4K4OzhFDMRaPF2xMj7aP9FQU4dMN1XCsmRT07hyYn6iEviECxNttYvoRLB1zNdeja5cL63IDY3UZSpAQ==
51205120
dependencies:
5121-
"@gorhom/bottom-sheet" "^5.0.6"
5121+
"@gorhom/bottom-sheet" "^5.1.1"
51225122
dayjs "1.10.5"
51235123
emoji-regex "^10.3.0"
51245124
i18next "^21.6.14"
@@ -5129,13 +5129,13 @@ [email protected]:
51295129
path "0.12.7"
51305130
react-native-markdown-package "1.8.2"
51315131
react-native-url-polyfill "^1.3.0"
5132-
stream-chat "^8.56.1"
5132+
stream-chat "^8.57.5"
51335133
use-sync-external-store "^1.4.0"
51345134

5135-
stream-chat@^8.56.1:
5136-
version "8.56.1"
5137-
resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.56.1.tgz#53779c987b9a46ea6908508f3b164cb14051bdc1"
5138-
integrity sha512-ZgNzD9z2JF65SE2J9Tur29fJTzpVAj2VYgu0OYqb3IEcpoP3ncLD0F3dsCvg8UDd/kYklkIncgvlAFAS4frYFw==
5135+
stream-chat@^8.57.5:
5136+
version "8.57.5"
5137+
resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.57.5.tgz#1b49b7504371e19a539465e2ae5dc86aa3269637"
5138+
integrity sha512-ndcbH/zGzUIAhZLGn1owVV8MeNvVfWITIlhAhfmnsV7RLoo/eiGFEuP4aNoG1YRos/g9xJQ7TEmKpz8xYqo13w==
51395139
dependencies:
51405140
"@babel/runtime" "^7.16.3"
51415141
"@types/jsonwebtoken" "~9.0.0"

package/native-package/yarn.lock

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,10 +1038,10 @@
10381038
"@babel/helper-validator-identifier" "^7.24.7"
10391039
to-fast-properties "^2.0.0"
10401040

1041-
"@gorhom/bottom-sheet@^5.0.6":
1042-
version "5.0.6"
1043-
resolved "https://registry.yarnpkg.com/@gorhom/bottom-sheet/-/bottom-sheet-5.0.6.tgz#f20736502399c7bcf8c73ea09e6b571dc07fe0eb"
1044-
integrity sha512-SI/AhPvgRfnCWN6/+wbE6TXwRE4X8F2fLyE4L/0bRwgE34Zenq585qLT139uEcfCIyovC2swC3ICqQpkmWEcFA==
1041+
"@gorhom/bottom-sheet@^5.1.1":
1042+
version "5.1.1"
1043+
resolved "https://registry.yarnpkg.com/@gorhom/bottom-sheet/-/bottom-sheet-5.1.1.tgz#43ecb9e7b4d4ca4b4cefdf3b6b497f7715f350bc"
1044+
integrity sha512-Y8FiuRmeZYaP+ZGQ0axDwWrrKqVp4ByYRs1D2fTJTxHMt081MHHRQsqmZ3SK7AFp3cSID+vTqnD8w/KAASpy+w==
10451045
dependencies:
10461046
"@gorhom/portal" "1.0.14"
10471047
invariant "^2.2.4"
@@ -4242,12 +4242,12 @@ statuses@~1.5.0:
42424242
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
42434243
integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==
42444244

4245-
4246-
version "6.6.5"
4247-
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-6.6.5.tgz#ac34a1bd2ec3b950b3bc8bc122ec826d6dd51113"
4248-
integrity sha512-SZyr/TlOoW+j7t4X/CXBhvQ8LN8AgFg4vR6UfcP151fYvf4uwMrzmMN1T/IBsUBr30Kjmr54ik/dH0Z+tnLX2w==
4245+
4246+
version "6.6.6"
4247+
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-6.6.6.tgz#d701beb9652f0a5851286f752d8c4fdadb3e0603"
4248+
integrity sha512-sfBtWz4K4OzhFDMRaPF2xMj7aP9FQU4dMN1XCsmRT07hyYn6iEviECxNttYvoRLB1zNdeja5cL63IDY3UZSpAQ==
42494249
dependencies:
4250-
"@gorhom/bottom-sheet" "^5.0.6"
4250+
"@gorhom/bottom-sheet" "^5.1.1"
42514251
dayjs "1.10.5"
42524252
emoji-regex "^10.3.0"
42534253
i18next "^21.6.14"
@@ -4258,13 +4258,13 @@ [email protected]:
42584258
path "0.12.7"
42594259
react-native-markdown-package "1.8.2"
42604260
react-native-url-polyfill "^1.3.0"
4261-
stream-chat "^8.56.1"
4261+
stream-chat "^8.57.5"
42624262
use-sync-external-store "^1.4.0"
42634263

4264-
stream-chat@^8.56.1:
4265-
version "8.56.1"
4266-
resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.56.1.tgz#53779c987b9a46ea6908508f3b164cb14051bdc1"
4267-
integrity sha512-ZgNzD9z2JF65SE2J9Tur29fJTzpVAj2VYgu0OYqb3IEcpoP3ncLD0F3dsCvg8UDd/kYklkIncgvlAFAS4frYFw==
4264+
stream-chat@^8.57.5:
4265+
version "8.57.5"
4266+
resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.57.5.tgz#1b49b7504371e19a539465e2ae5dc86aa3269637"
4267+
integrity sha512-ndcbH/zGzUIAhZLGn1owVV8MeNvVfWITIlhAhfmnsV7RLoo/eiGFEuP4aNoG1YRos/g9xJQ7TEmKpz8xYqo13w==
42684268
dependencies:
42694269
"@babel/runtime" "^7.16.3"
42704270
"@types/jsonwebtoken" "~9.0.0"

package/package.json

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -94,62 +94,62 @@
9494
}
9595
},
9696
"devDependencies": {
97-
"@babel/cli": "^7.12.17",
98-
"@babel/core": "^7.20.0",
97+
"@babel/cli": "^7.26.4",
98+
"@babel/core": "^7.26.9",
9999
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
100100
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
101-
"@babel/plugin-transform-arrow-functions": "^7.24.1",
102-
"@babel/plugin-transform-shorthand-properties": "^7.24.1",
103-
"@babel/plugin-transform-template-literals": "^7.24.1",
104-
"@babel/preset-env": "7.13.12",
105-
"@babel/preset-typescript": "7.13.0",
106-
"@babel/runtime": "^7.20.0",
107-
"@op-engineering/op-sqlite": "^9.3.0",
101+
"@babel/plugin-transform-arrow-functions": "^7.25.9",
102+
"@babel/plugin-transform-shorthand-properties": "^7.25.9",
103+
"@babel/plugin-transform-template-literals": "^7.26.8",
104+
"@babel/preset-env": "7.26.9",
105+
"@babel/preset-typescript": "7.26.0",
106+
"@babel/runtime": "^7.26.9",
107+
"@op-engineering/op-sqlite": "^11.4.8",
108108
"@react-native-community/eslint-config": "3.2.0",
109109
"@react-native-community/eslint-plugin": "1.3.0",
110110
"@react-native-community/netinfo": "^11.3.2",
111-
"@react-native/babel-preset": "0.73.21",
111+
"@react-native/babel-preset": "0.78.0",
112112
"@testing-library/jest-native": "^5.4.3",
113-
"@testing-library/react-native": "12.4.5",
114-
"@types/better-sqlite3": "^7.6.0",
115-
"@types/eslint": "7.2.10",
116-
"@types/jest": "^29.5.12",
117-
"@types/linkify-it": "3.0.2",
118-
"@types/lodash": "4.14.169",
119-
"@types/mime-types": "2.1.0",
120-
"@types/react": "18.2.6",
121-
"@types/react-test-renderer": "18.0.7",
113+
"@testing-library/react-native": "13.1.0",
114+
"@types/better-sqlite3": "^7.6.12",
115+
"@types/eslint": "9.6.1",
116+
"@types/jest": "^29.5.14",
117+
"@types/linkify-it": "5.0.0",
118+
"@types/lodash": "4.17.16",
119+
"@types/mime-types": "2.1.4",
120+
"@types/react": "19.0.10",
121+
"@types/react-test-renderer": "19.0.0",
122122
"@types/use-sync-external-store": "^0.0.6",
123-
"@types/uuid": "^8.3.4",
123+
"@types/uuid": "^10.0.0",
124124
"babel-eslint": "10.1.0",
125-
"babel-jest": "29.6.3",
126-
"babel-loader": "8.2.2",
127-
"babel-plugin-module-resolver": "4.1.0",
125+
"babel-jest": "29.7.0",
126+
"babel-loader": "10.0.0",
127+
"babel-plugin-module-resolver": "5.0.2",
128128
"better-sqlite3": "11.8.1",
129129
"eslint": "^9.20.1",
130-
"eslint-config-prettier": "10.0.1",
130+
"eslint-config-prettier": "10.0.2",
131+
"eslint-plugin-eslint-comments": "^3.2.0",
131132
"eslint-plugin-import": "^2.31.0",
132133
"eslint-plugin-jest": "^28.11.0",
133134
"eslint-plugin-markdown": "5.1.0",
134135
"eslint-plugin-prettier": "5.2.3",
135136
"eslint-plugin-react": "^7.37.4",
136-
"eslint-plugin-eslint-comments": "^3.2.0",
137-
"eslint-plugin-react-hooks": "^5.1.0",
137+
"eslint-plugin-react-hooks": "^5.2.0",
138138
"eslint-plugin-react-native": "^5.0.0",
139-
"i18next-parser": "^9.0.0",
139+
"i18next-parser": "^9.3.0",
140140
"jest": "^29.7.0",
141-
"moment-timezone": "^0.5.45",
142-
"prettier": "^3.5.2",
143-
"react": "18.2.0",
144-
"react-native": "0.73.6",
145-
"react-native-builder-bob": "0.23.1",
146-
"react-native-gesture-handler": "~2.16.1",
147-
"react-native-reanimated": "~3.10.0",
148-
"react-native-svg": "15.1.0",
149-
"react-test-renderer": "18.2.0",
150-
"typescript": "5.0.4",
151-
"typescript-eslint": "^8.24.1",
152-
"uuid": "^8.3.2"
141+
"moment-timezone": "^0.5.47",
142+
"prettier": "^3.5.3",
143+
"react": "19.0.0",
144+
"react-native": "0.78.0",
145+
"react-native-builder-bob": "0.37.0",
146+
"react-native-gesture-handler": "~2.24.0",
147+
"react-native-reanimated": "~3.17.1",
148+
"react-native-svg": "15.11.2",
149+
"react-test-renderer": "19.0.0",
150+
"typescript": "5.8.2",
151+
"typescript-eslint": "^8.25.0",
152+
"uuid": "^11.1.0"
153153
},
154154
"resolutions": {
155155
"@types/react": "18.2.6"

package/src/components/Attachment/AudioAttachment.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect, useMemo, useState } from 'react';
1+
import React, { RefObject, useEffect, useMemo, useState } from 'react';
22
import { I18nManager, Pressable, StyleSheet, Text, View } from 'react-native';
33

44
import dayjs from 'dayjs';
@@ -352,7 +352,7 @@ export const AudioAttachment = (props: AudioAttachmentProps) => {
352352
onSeek={onSeek}
353353
paused={item.paused}
354354
rate={currentSpeed}
355-
soundRef={soundRef}
355+
soundRef={soundRef as RefObject<SoundReturnType>}
356356
testID='sound-player'
357357
uri={item.file.uri}
358358
/>

package/src/components/AttachmentPicker/AttachmentPicker.tsx

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import React, { useCallback, useEffect, useRef, useState } from 'react';
22
import { BackHandler, Keyboard, Platform, StyleSheet } from 'react-native';
33

4-
import BottomSheet, { BottomSheetFlatList } from '@gorhom/bottom-sheet';
4+
import BottomSheetOriginal from '@gorhom/bottom-sheet';
5+
import type { BottomSheetHandleProps } from '@gorhom/bottom-sheet';
6+
57
import dayjs from 'dayjs';
68
import duration from 'dayjs/plugin/duration';
79

@@ -17,6 +19,8 @@ import { useTheme } from '../../contexts/themeContext/ThemeContext';
1719
import { useScreenDimensions } from '../../hooks/useScreenDimensions';
1820
import { getPhotos, oniOS14GalleryLibrarySelectionChange } from '../../native';
1921
import type { Asset } from '../../types/types';
22+
import { BottomSheet } from '../BottomSheetCompatibility/BottomSheet';
23+
import { BottomSheetFlatList } from '../BottomSheetCompatibility/BottomSheetFlatList';
2024

2125
dayjs.extend(duration);
2226

@@ -62,7 +66,7 @@ export type AttachmentPickerProps = Pick<
6266
};
6367

6468
export const AttachmentPicker = React.forwardRef(
65-
(props: AttachmentPickerProps, ref: React.ForwardedRef<BottomSheet>) => {
69+
(props: AttachmentPickerProps, ref: React.ForwardedRef<BottomSheetOriginal>) => {
6670
const {
6771
AttachmentPickerBottomSheetHandle,
6872
attachmentPickerBottomSheetHandleHeight,
@@ -99,7 +103,7 @@ export const AttachmentPicker = React.forwardRef(
99103
const fullScreenHeight = screenVh(100);
100104

101105
const [currentIndex, setCurrentIndex] = useState(-1);
102-
const endCursorRef = useRef<string>();
106+
const endCursorRef = useRef<string>(undefined);
103107
const [photoError, setPhotoError] = useState(false);
104108
const [iOSLimited, setIosLimited] = useState(false);
105109
const hasNextPageRef = useRef(true);
@@ -266,17 +270,23 @@ export const AttachmentPicker = React.forwardRef(
266270
*/
267271
const snapPoints = [initialSnapPoint, finalSnapPoint];
268272

273+
const MemoizedAttachmentPickerBottomSheetHandle = useCallback(
274+
(props: BottomSheetHandleProps) =>
275+
/**
276+
* using `null` here instead of `style={{ opacity: photoError ? 0 : 1 }}`
277+
* as opacity is not an allowed style
278+
*/
279+
!photoError && AttachmentPickerBottomSheetHandle ? (
280+
<AttachmentPickerBottomSheetHandle {...props} />
281+
) : null,
282+
[AttachmentPickerBottomSheetHandle, photoError],
283+
);
284+
269285
return (
270286
<>
271287
<BottomSheet
272288
enablePanDownToClose={true}
273-
handleComponent={
274-
/**
275-
* using `null` here instead of `style={{ opacity: photoError ? 0 : 1 }}`
276-
* as opacity is not an allowed style
277-
*/
278-
photoError ? null : AttachmentPickerBottomSheetHandle
279-
}
289+
handleComponent={MemoizedAttachmentPickerBottomSheetHandle}
280290
// @ts-ignore
281291
handleHeight={handleHeight}
282292
index={-1}

package/src/components/AttachmentPicker/components/AttachmentPickerItem.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React from 'react';
22

33
import { Alert, ImageBackground, StyleSheet, Text, View } from 'react-native';
44

5-
import { TouchableOpacity } from '@gorhom/bottom-sheet';
65
import { lookup } from 'mime-types';
76

87
import { AttachmentPickerContextValue } from '../../../contexts/attachmentPickerContext/AttachmentPickerContext';
@@ -12,6 +11,7 @@ import { useViewport } from '../../../hooks/useViewport';
1211
import { Recorder } from '../../../icons';
1312
import type { Asset, File } from '../../../types/types';
1413
import { getDurationLabelFromDuration } from '../../../utils/utils';
14+
import { BottomSheetTouchableOpacity } from '../../BottomSheetCompatibility/BottomSheetTouchableOpacity';
1515

1616
type AttachmentPickerItemType = Pick<
1717
AttachmentPickerContextValue,
@@ -95,7 +95,7 @@ const AttachmentVideo = (props: AttachmentVideoProps) => {
9595
};
9696

9797
return (
98-
<TouchableOpacity onPress={onPressVideo}>
98+
<BottomSheetTouchableOpacity onPress={onPressVideo}>
9999
<ImageBackground
100100
source={{ uri: originalUri }}
101101
style={[
@@ -121,7 +121,7 @@ const AttachmentVideo = (props: AttachmentVideoProps) => {
121121
) : null}
122122
</View>
123123
</ImageBackground>
124-
</TouchableOpacity>
124+
</BottomSheetTouchableOpacity>
125125
);
126126
};
127127

@@ -171,7 +171,7 @@ const AttachmentImage = (props: AttachmentImageProps) => {
171171
};
172172

173173
return (
174-
<TouchableOpacity onPress={onPressImage}>
174+
<BottomSheetTouchableOpacity onPress={onPressImage}>
175175
<ImageBackground
176176
source={{ uri }}
177177
style={[
@@ -189,7 +189,7 @@ const AttachmentImage = (props: AttachmentImageProps) => {
189189
</View>
190190
)}
191191
</ImageBackground>
192-
</TouchableOpacity>
192+
</BottomSheetTouchableOpacity>
193193
);
194194
};
195195

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import React from 'react';
2+
3+
import BottomSheetOriginal from '@gorhom/bottom-sheet';
4+
import type { BottomSheetProps } from '@gorhom/bottom-sheet';
5+
6+
export const BottomSheet = BottomSheetOriginal as React.ComponentType<BottomSheetProps>;
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import React, { useCallback } from 'react';
2+
import type { FlatListProps } from 'react-native';
3+
4+
import type { AnimatedProps } from 'react-native-reanimated';
5+
6+
import { BottomSheetFlatListMethods } from '@gorhom/bottom-sheet';
7+
8+
import {
9+
BottomSheetFlatList as BottomSheetFlatListOriginal,
10+
BottomSheetScrollableProps,
11+
} from '@gorhom/bottom-sheet';
12+
13+
export type BottomSheetFlatListProps<T> = Omit<
14+
AnimatedProps<FlatListProps<T>>,
15+
'decelerationRate' | 'onScroll' | 'scrollEventThrottle'
16+
> &
17+
BottomSheetScrollableProps & {
18+
ref?: React.Ref<BottomSheetFlatListMethods>;
19+
};
20+
21+
export const BottomSheetFlatList = <T,>(props: BottomSheetFlatListProps<T>) => {
22+
const MemoizedBottomSheetFlatList = useCallback(
23+
BottomSheetFlatListOriginal as React.ComponentType<BottomSheetFlatListProps<T>>,
24+
[],
25+
);
26+
27+
return <MemoizedBottomSheetFlatList {...props} />;
28+
};
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import React from 'react';
2+
3+
import {
4+
BottomSheetModal as BottomSheetModalOriginal,
5+
BottomSheetModalProps,
6+
BottomSheetModalProvider as BottomSheetModalProviderOriginal,
7+
} from '@gorhom/bottom-sheet';
8+
9+
export interface BottomSheetModalProviderProps {
10+
children?: React.ReactNode;
11+
}
12+
13+
export const BottomSheetModalProvider =
14+
BottomSheetModalProviderOriginal as React.ComponentType<BottomSheetModalProviderProps>;
15+
export const BottomSheetModal =
16+
BottomSheetModalOriginal as React.ComponentType<BottomSheetModalProps>;

0 commit comments

Comments
 (0)