Skip to content
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

fix: remove netinfo from native handlers and add it as dev dependency of core #2538

Merged
merged 5 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docusaurus/docs/reactnative/basics/client.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ const client = StreamChat.getInstance('api_key');
**Usage of `StreamChat.getInstance()` available since [email protected].**

<br />
This new Singleton pattern allows you to instantiate a unique StreamChat client, i.e create a StreamChat instance and retrieve
it wherever you need it on your app to perform API calls. After calling it once, any following <code>
This new Singleton pattern allows you to instantiate a unique StreamChat client, i.e create a StreamChat instance and
retrieve it wherever you need it on your app to perform API calls. After calling it once, any following <code>
getInstance
</code> call will return the initial StreamChat instance. This will prevent you from accidentally creating multiple StreamChat
instances, opening multiple WebSockets, and driving up your concurrent connections unnecessarily.
</code> call will return the initial StreamChat instance. This will prevent you from accidentally creating multiple
StreamChat instances, opening multiple WebSockets, and driving up your concurrent connections unnecessarily.
<br />
<br />

Expand Down
8 changes: 0 additions & 8 deletions docusaurus/docs/reactnative/customization/native-handlers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,6 @@ A function that returns photos from the camera roll given an offset of `after` a
| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| [`@react-native-camera-roll/camera-roll`](https://github.com/react-native-cameraroll/react-native-cameraroll) | [`expo-media-library`](https://docs.expo.io/versions/latest/sdk/media-library/) |

### `NetInfo`

A object containing two keys, `addEventListener` and `fetch`, which are functions that allow a developer to add listeners to `NetInfo` or fetch information from `NetInfo`.

| React Native CLI | Expo |
| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| [`@react-native-community/netinfo`](https://github.com/react-native-netinfo/react-native-netinfo) | [`@react-native-community/netinfo`](https://github.com/react-native-netinfo/react-native-netinfo) |

### `pickDocument`

A function to open the document picker and return documents picked from it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ const client = StreamChat.getInstance('api_key');
**Usage of `StreamChat.getInstance()` available since [email protected].**

<br />
This new Singleton pattern allows you to instantiate a unique StreamChat client, i.e create a StreamChat instance and retrieve
it wherever you need it on your app to perform API calls. After calling it once, any following <code>
This new Singleton pattern allows you to instantiate a unique StreamChat client, i.e create a StreamChat instance and
retrieve it wherever you need it on your app to perform API calls. After calling it once, any following <code>
getInstance
</code> call will return the initial StreamChat instance. This will prevent you from accidentally creating multiple StreamChat
instances, opening multiple WebSockets, and driving up your concurrent connections unnecessarily.
</code> call will return the initial StreamChat instance. This will prevent you from accidentally creating multiple
StreamChat instances, opening multiple WebSockets, and driving up your concurrent connections unnecessarily.
<br />
<br />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ const client = StreamChat.getInstance('api_key');
**Usage of `StreamChat.getInstance()` available since [email protected].**

<br />
This new Singleton pattern allows you to instantiate a unique StreamChat client, i.e create a StreamChat instance and retrieve
it wherever you need it on your app to perform API calls. After calling it once, any following <code>
This new Singleton pattern allows you to instantiate a unique StreamChat client, i.e create a StreamChat instance and
retrieve it wherever you need it on your app to perform API calls. After calling it once, any following <code>
getInstance
</code> call will return the initial StreamChat instance. This will prevent you from accidentally creating multiple StreamChat
instances, opening multiple WebSockets, and driving up your concurrent connections unnecessarily.
</code> call will return the initial StreamChat instance. This will prevent you from accidentally creating multiple
StreamChat instances, opening multiple WebSockets, and driving up your concurrent connections unnecessarily.
<br />
<br />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ The guidance provided makes the assumption you are using [React Navigation](http

<code>createNativeStackNavigator</code> uses the native APIs <code>UINavigationController</code> on iOS and <code>
Fragment
</code> on Android. The <code>OverlayProvider</code> needs to exist in a view that can render content in front of the chat
screen. Therefore using a <code>fullScreenModal</code> with <code>createNativeStackNavigator</code>, which uses <code>
</code> on Android. The <code>OverlayProvider</code> needs to exist in a view that can render content in front of the
chat screen. Therefore using a <code>fullScreenModal</code> with <code>createNativeStackNavigator</code>, which uses <code>
UIModalPresentationFullScreen
</code> on iOS and <code>modal</code> on Android, to render your chat screen will leave the <code>
OverlayProvider
</code> rendered behind the chat. If you are having issues we suggest you get in touch with support and we can find a
solution to your specific navigation arrangement.
</code> on iOS and <code>modal</code> on Android, to render your chat screen will leave the <code>OverlayProvider</code> rendered
behind the chat. If you are having issues we suggest you get in touch with support and we can find a solution to your
specific navigation arrangement.

:::

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ const client = StreamChat.getInstance('api_key');
**Usage of `StreamChat.getInstance()` available since [email protected].**

<br />
This new Singleton pattern allows you to instantiate a unique StreamChat client, i.e create a StreamChat instance and retrieve
it wherever you need it on your app to perform API calls. After calling it once, any following <code>
This new Singleton pattern allows you to instantiate a unique StreamChat client, i.e create a StreamChat instance and
retrieve it wherever you need it on your app to perform API calls. After calling it once, any following <code>
getInstance
</code> call will return the initial StreamChat instance. This will prevent you from accidentally creating multiple StreamChat
instances, opening multiple WebSockets, and driving up your concurrent connections unnecessarily.
</code> call will return the initial StreamChat instance. This will prevent you from accidentally creating multiple
StreamChat instances, opening multiple WebSockets, and driving up your concurrent connections unnecessarily.
<br />
<br />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ The guidance provided makes the assumption you are using [React Navigation](http

<code>createNativeStackNavigator</code> uses the native APIs <code>UINavigationController</code> on iOS and <code>
Fragment
</code> on Android. The <code>OverlayProvider</code> needs to exist in a view that can render content in front of the chat
screen. Therefore using a <code>fullScreenModal</code> with <code>createNativeStackNavigator</code>, which uses <code>
</code> on Android. The <code>OverlayProvider</code> needs to exist in a view that can render content in front of the
chat screen. Therefore using a <code>fullScreenModal</code> with <code>createNativeStackNavigator</code>, which uses <code>
UIModalPresentationFullScreen
</code> on iOS and <code>modal</code> on Android, to render your chat screen will leave the <code>
OverlayProvider
</code> rendered behind the chat. If you are having issues we suggest you get in touch with support and we can find a
solution to your specific navigation arrangement.
</code> on iOS and <code>modal</code> on Android, to render your chat screen will leave the <code>OverlayProvider</code> rendered
behind the chat. If you are having issues we suggest you get in touch with support and we can find a solution to your
specific navigation arrangement.

:::

Expand Down
25 changes: 5 additions & 20 deletions examples/ExpoMessaging/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7327,10 +7327,10 @@ [email protected]:
version "0.0.0"
uid ""

stream-chat-react-native-core@5.29.0:
version "5.29.0"
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.29.0.tgz#b89d5f954c2063316ab6dc254e0b98188f01524d"
integrity sha512-cm8CQUIHPE+hHxM1hVQ6V3ogUJLpGPRZBvMYbJW7+MBdhUTn4+40EqEbqHTEtHdkLgPUmxaDJsh/gFCtVEGgog==
stream-chat-react-native-core@5.31.1:
version "5.31.1"
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.31.1.tgz#4367276c8316d325e6b062e4efb95d464d4e2eef"
integrity sha512-EKHMQ0bWRoyubTxk1IKEbkIzcIY5hxHDpyGU7ObGXLLnhoVBEDranZBQ7dNDdbuM88uKh9mGK5WH4NQSTioKxQ==
dependencies:
"@gorhom/bottom-sheet" "4.4.8"
dayjs "1.10.5"
Expand All @@ -7342,27 +7342,12 @@ [email protected]:
path "0.12.7"
react-native-markdown-package "1.8.2"
react-native-url-polyfill "^1.3.0"
stream-chat "8.17.0"
stream-chat "8.31.0"

"stream-chat-react-native-core@link:../../package":
version "0.0.0"
uid ""

[email protected]:
version "8.17.0"
resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.17.0.tgz#01c4aacbcdb5dd734b088e70f40cd42a0bcd0fb7"
integrity sha512-0cYKSroKGiLilElk8Ol6AKAowWIIpXz3wsY97o+cAqixOwwHdnbuPZ00L2CzAjNB2c94Vl5L48n1K+9iOEpv3w==
dependencies:
"@babel/runtime" "^7.16.3"
"@types/jsonwebtoken" "~9.0.0"
"@types/ws" "^7.4.0"
axios "^1.6.0"
base64-js "^1.5.1"
form-data "^4.0.0"
isomorphic-ws "^4.0.1"
jsonwebtoken "~9.0.0"
ws "^7.4.4"

[email protected]:
version "8.31.0"
resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.31.0.tgz#387ed3109ac930e222bf260d98afc37dd1fcb1ac"
Expand Down
25 changes: 5 additions & 20 deletions examples/SampleApp/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6825,10 +6825,10 @@ statuses@~1.5.0:
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==

stream-chat-react-native-core@5.29.0:
version "5.29.0"
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.29.0.tgz#b89d5f954c2063316ab6dc254e0b98188f01524d"
integrity sha512-cm8CQUIHPE+hHxM1hVQ6V3ogUJLpGPRZBvMYbJW7+MBdhUTn4+40EqEbqHTEtHdkLgPUmxaDJsh/gFCtVEGgog==
stream-chat-react-native-core@5.31.1:
version "5.31.1"
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.31.1.tgz#4367276c8316d325e6b062e4efb95d464d4e2eef"
integrity sha512-EKHMQ0bWRoyubTxk1IKEbkIzcIY5hxHDpyGU7ObGXLLnhoVBEDranZBQ7dNDdbuM88uKh9mGK5WH4NQSTioKxQ==
dependencies:
"@gorhom/bottom-sheet" "4.4.8"
dayjs "1.10.5"
Expand All @@ -6840,7 +6840,7 @@ [email protected]:
path "0.12.7"
react-native-markdown-package "1.8.2"
react-native-url-polyfill "^1.3.0"
stream-chat "8.17.0"
stream-chat "8.31.0"

"stream-chat-react-native-core@link:../../package":
version "0.0.0"
Expand All @@ -6850,21 +6850,6 @@ [email protected]:
version "0.0.0"
uid ""

[email protected]:
version "8.17.0"
resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.17.0.tgz#01c4aacbcdb5dd734b088e70f40cd42a0bcd0fb7"
integrity sha512-0cYKSroKGiLilElk8Ol6AKAowWIIpXz3wsY97o+cAqixOwwHdnbuPZ00L2CzAjNB2c94Vl5L48n1K+9iOEpv3w==
dependencies:
"@babel/runtime" "^7.16.3"
"@types/jsonwebtoken" "~9.0.0"
"@types/ws" "^7.4.0"
axios "^1.6.0"
base64-js "^1.5.1"
form-data "^4.0.0"
isomorphic-ws "^4.0.1"
jsonwebtoken "~9.0.0"
ws "^7.4.4"

[email protected]:
version "8.31.0"
resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.31.0.tgz#387ed3109ac930e222bf260d98afc37dd1fcb1ac"
Expand Down
6 changes: 3 additions & 3 deletions examples/TypeScriptMessaging/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ PODS:
- React-Core
- react-native-image-resizer (1.4.5):
- React-Core
- react-native-netinfo (11.3.0):
- react-native-netinfo (11.3.2):
- React-Core
- react-native-quick-sqlite (8.0.2):
- React
Expand Down Expand Up @@ -1476,7 +1476,7 @@ SPEC CHECKSUMS:
react-native-document-picker: 2b8f18667caee73a96708a82b284a4f40b30a156
react-native-flipper: 9c1957af24b76493ba74f46d000a5c1d485e7731
react-native-image-resizer: d9fb629a867335bdc13230ac2a58702bb8c8828f
react-native-netinfo: 299dad906cdbf3b67bcc6f693c807f98bdd127cc
react-native-netinfo: 076df4f9b07f6670acf4ce9a75aac8d34c2e2ccc
react-native-quick-sqlite: 2b225dadc63b670f027111e58f6f169773f6d755
react-native-safe-area-context: b97eb6f9e3b7f437806c2ce5983f479f8eb5de4b
react-native-video: d440605e68cf173e70f0b25112455e3d86890663
Expand Down Expand Up @@ -1517,4 +1517,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 90406e1e85c82b37484f5d746afa45c0637bb4b3

COCOAPODS: 1.15.2
COCOAPODS: 1.14.3
4 changes: 2 additions & 2 deletions examples/TypeScriptMessaging/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
"@react-native-camera-roll/camera-roll": "^5.3.1",
"@react-native-clipboard/clipboard": "^1.10.0",
"@react-native-community/masked-view": "0.1.11",
"@react-native-community/netinfo": "^11.0.1",
"@react-native-community/netinfo": "^11.3.2",
"@react-navigation/native": "^6.0.8",
"@react-navigation/stack": "^6.2.0",
"@stream-io/flat-list-mvcp": "0.10.3",
"react": "18.2.0",
"react-native-audio-recorder-player": "3.6.6",
"react-native": "^0.73.6",
"react-native-audio-recorder-player": "3.6.6",
"react-native-document-picker": "^9.0.1",
"react-native-fs": "^2.18.0",
"react-native-gesture-handler": "^2.14.0",
Expand Down
33 changes: 9 additions & 24 deletions examples/TypeScriptMessaging/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2057,10 +2057,10 @@
resolved "https://registry.yarnpkg.com/@react-native-community/masked-view/-/masked-view-0.1.11.tgz#2f4c6e10bee0786abff4604e39a37ded6f3980ce"
integrity sha512-rQfMIGSR/1r/SyN87+VD8xHHzDYeHaJq6elOSCAD+0iLagXkSI2pfA0LmSXP21uw5i3em7GkkRjfJ8wpqWXZNw==

"@react-native-community/netinfo@^11.0.1":
version "11.3.0"
resolved "https://registry.yarnpkg.com/@react-native-community/netinfo/-/netinfo-11.3.0.tgz#9d99ba00138b38350a794eab5eca436f6e209114"
integrity sha512-mR9iqUi0GzuC8ut+goI/lLkgG+a2OViI1mjSdXHKZnkfdJVjHblyWX3xoA8GE4GH8X4r0X/PNM3Vvyf2FH9mVg==
"@react-native-community/netinfo@^11.3.2":
version "11.3.2"
resolved "https://registry.yarnpkg.com/@react-native-community/netinfo/-/netinfo-11.3.2.tgz#e63201d0b87ad42d086d1003be48ae7b327f0594"
integrity sha512-YsaS3Dutnzqd1BEoeC+DEcuNJedYRkN6Ef3kftT5Sm8ExnCF94C/nl4laNxuvFli3+Jz8Df3jO25Jn8A9S0h4w==

"@react-native/[email protected]":
version "0.73.1"
Expand Down Expand Up @@ -6882,10 +6882,10 @@ statuses@~1.5.0:
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==

stream-chat-react-native-core@5.29.0:
version "5.29.0"
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.29.0.tgz#b89d5f954c2063316ab6dc254e0b98188f01524d"
integrity sha512-cm8CQUIHPE+hHxM1hVQ6V3ogUJLpGPRZBvMYbJW7+MBdhUTn4+40EqEbqHTEtHdkLgPUmxaDJsh/gFCtVEGgog==
stream-chat-react-native-core@5.31.1:
version "5.31.1"
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.31.1.tgz#4367276c8316d325e6b062e4efb95d464d4e2eef"
integrity sha512-EKHMQ0bWRoyubTxk1IKEbkIzcIY5hxHDpyGU7ObGXLLnhoVBEDranZBQ7dNDdbuM88uKh9mGK5WH4NQSTioKxQ==
dependencies:
"@gorhom/bottom-sheet" "4.4.8"
dayjs "1.10.5"
Expand All @@ -6897,7 +6897,7 @@ [email protected]:
path "0.12.7"
react-native-markdown-package "1.8.2"
react-native-url-polyfill "^1.3.0"
stream-chat "8.17.0"
stream-chat "8.31.0"

"stream-chat-react-native-core@link:../../package":
version "0.0.0"
Expand All @@ -6912,21 +6912,6 @@ stream-chat-react-native-devtools@^1.1.0:
version "0.0.0"
uid ""

[email protected]:
version "8.17.0"
resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.17.0.tgz#01c4aacbcdb5dd734b088e70f40cd42a0bcd0fb7"
integrity sha512-0cYKSroKGiLilElk8Ol6AKAowWIIpXz3wsY97o+cAqixOwwHdnbuPZ00L2CzAjNB2c94Vl5L48n1K+9iOEpv3w==
dependencies:
"@babel/runtime" "^7.16.3"
"@types/jsonwebtoken" "~9.0.0"
"@types/ws" "^7.4.0"
axios "^1.6.0"
base64-js "^1.5.1"
form-data "^4.0.0"
isomorphic-ws "^4.0.1"
jsonwebtoken "~9.0.0"
ws "^7.4.4"

[email protected]:
version "8.31.0"
resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.31.0.tgz#387ed3109ac930e222bf260d98afc37dd1fcb1ac"
Expand Down
7 changes: 3 additions & 4 deletions package/expo-package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
"stream-chat-react-native-core": "5.31.1"
},
"peerDependencies": {
"@react-native-community/netinfo": ">=6.0.0",
"expo": ">=44.0.0",
"expo-av": "*",
"expo-clipboard": "*",
khushal87 marked this conversation as resolved.
Show resolved Hide resolved
"expo-document-picker": "*",
"expo-file-system": "*",
"expo-haptics": "*",
"expo-image-manipulator": "*",
"expo-image-picker": ">=14.1.0",
"expo-media-library": "*",
"expo-sharing": "*",
"expo-av": "*"
"expo-sharing": "*"
},
"peerDependenciesMeta": {
"expo-av": {
Expand All @@ -42,7 +42,6 @@
}
},
"devDependencies": {
"@react-native-community/netinfo": "^6.0.0",
"expo": "^44.0.0",
"expo-file-system": "^11.0.2",
"expo-image-manipulator": "^9.1.0",
Expand Down
43 changes: 0 additions & 43 deletions package/expo-package/src/handlers/NetInfo.ts

This file was deleted.

1 change: 0 additions & 1 deletion package/expo-package/src/handlers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export * from './deleteFile';
export * from './getLocalAssetUri';
export * from './getPhotos';
export * from './iOS14RefreshGallerySelection';
export * from './NetInfo';
export * from './oniOS14GalleryLibrarySelectionChange';
export * from './saveFile';
export * from './Sound';
Expand Down
Loading
Loading