diff --git a/docusaurus/docs/reactnative/basics/troubleshooting.mdx b/docusaurus/docs/reactnative/basics/troubleshooting.mdx index 7ee77335d0..58a75ab7e3 100644 --- a/docusaurus/docs/reactnative/basics/troubleshooting.mdx +++ b/docusaurus/docs/reactnative/basics/troubleshooting.mdx @@ -405,3 +405,19 @@ This is likely due to ProGuard removing reanimated 2 related classes. If you're On newer MacBooks with the Apple M1 SoC, there are a few required steps that need to be followed for an app to build. The user [aiba](https://github.com/aiba) has written [a guide](https://github.com/aiba/react-native-m1) to make the necessary changes to your project. The iOS build version can be changed to suit your needs, but keep in mind to change the version to the same major and minor version consistently throughout the guide. + +## React Native Video failing with Xcode 17 + +Following error is a known issue with using Xcode 17 and react-native-video dependency. + +``` +The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions +``` + +To temporarily fix this, you can follow the solution as per mentioned in the description of [this issue on GitHub](https://github.com/react-native-video/react-native-video/issues/3154). + +Alternatively, you can apply [this patch](https://github.com/react-native-video/react-native-video/files/11932302/react-native-video%2B6.0.0-alpha.6.patch) using the [patch-package](https://www.npmjs.com/package/patch-package) library to the package `react-native-video`. + +:::note +This shall be fixed soon with the new alpha release of the package `react-native-video`. +::: diff --git a/examples/SampleApp/CHANGELOG.md b/examples/SampleApp/CHANGELOG.md index ae813ab6ea..f41a795eea 100644 --- a/examples/SampleApp/CHANGELOG.md +++ b/examples/SampleApp/CHANGELOG.md @@ -1,5 +1,19 @@ # Change Log +### [1.22.11](https://github.com/GetStream/stream-chat-react-native/compare/sampleapp@v1.22.10...sampleapp@v1.22.11) (2023-10-20) + + +### Workspaces + +* Following linked packages updated: [stream-chat-react-native] + +### [1.22.10](https://github.com/GetStream/stream-chat-react-native/compare/sampleapp@v1.22.9...sampleapp@v1.22.10) (2023-10-19) + + +### Workspaces + +* Following linked packages updated: [stream-chat-react-native] + ### [1.22.9](https://github.com/GetStream/stream-chat-react-native/compare/sampleapp@v1.22.8...sampleapp@v1.22.9) (2023-10-11) diff --git a/examples/SampleApp/package.json b/examples/SampleApp/package.json index 886aa6e42a..0741741c90 100644 --- a/examples/SampleApp/package.json +++ b/examples/SampleApp/package.json @@ -1,6 +1,6 @@ { "name": "sampleapp", - "version": "1.22.9", + "version": "1.22.11", "private": true, "repository": { "type": "git", diff --git a/examples/SampleApp/useChatClient.ts b/examples/SampleApp/useChatClient.ts deleted file mode 100644 index 6e6fce501e..0000000000 --- a/examples/SampleApp/useChatClient.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { useEffect, useState } from 'react'; -import { StreamChat } from 'stream-chat'; - -import { USER_TOKENS, USERS } from '../ChatUsers'; -import AsyncStore from '../utils/AsyncStore'; - -import type { LoginConfig, StreamChatGenerics } from '../types'; - -export const useChatClient = () => { - const [chatClient, setChatClient] = useState | null>(null); - const [isConnecting, setIsConnecting] = useState(true); - - const loginUser = async (config: LoginConfig) => { - const client = StreamChat.getInstance(config.apiKey, { - timeout: 6000, - }); - - const user = { - id: config.userId, - image: config.userImage, - name: config.userName, - }; - - await client.connectUser(user, config.userToken); - await AsyncStore.setItem('@stream-rn-sampleapp-login-config', config); - - setChatClient(client); - }; - - const switchUser = async (userId?: string) => { - setIsConnecting(true); - - try { - if (userId) { - await loginUser({ - apiKey: 'yjrt5yxw77ev', - userId: USERS[userId].id, - userImage: USERS[userId].image, - userName: USERS[userId].name, - userToken: USER_TOKENS[userId], - }); - } else { - const config = await AsyncStore.getItem( - '@stream-rn-sampleapp-login-config', - null, - ); - - if (config) { - await loginUser(config); - } - } - } catch (e) { - console.warn(e); - } - setIsConnecting(false); - }; - - const logout = async () => { - setChatClient(null); - chatClient?.disconnectUser(); - await AsyncStore.removeItem('@stream-rn-sampleapp-login-config'); - }; - - useEffect(() => { - switchUser(); - }, []); - - return { - chatClient, - isConnecting, - loginUser, - logout, - switchUser, - }; -}; diff --git a/package/CHANGELOG.md b/package/CHANGELOG.md index 2ecff68131..2bdfbfc92a 100644 --- a/package/CHANGELOG.md +++ b/package/CHANGELOG.md @@ -1,5 +1,19 @@ # Change Log +### [5.19.2](https://github.com/GetStream/stream-chat-react-native/compare/v5.19.1...v5.19.2) (2023-10-20) + + +### Bug Fixes + +* issue with String.replaceAll being undefined function ([#2271](https://github.com/GetStream/stream-chat-react-native/issues/2271)) ([af9050a](https://github.com/GetStream/stream-chat-react-native/commit/af9050a3fb46346ed5d0ba387b42d5a85d937e93)) + +### [5.19.1](https://github.com/GetStream/stream-chat-react-native/compare/v5.19.0...v5.19.1) (2023-10-19) + + +### Bug Fixes + +* update stream-chat to fix failing get requests with undefined param ([#2269](https://github.com/GetStream/stream-chat-react-native/issues/2269)) ([a85d71a](https://github.com/GetStream/stream-chat-react-native/commit/a85d71af17c87aaa0703a6d71bce0d4bd704266e)) + ## [5.19.0](https://github.com/GetStream/stream-chat-react-native/compare/v5.18.1...v5.19.0) (2023-10-11) diff --git a/package/expo-package/package.json b/package/expo-package/package.json index c02f07ad58..0b22d9adfd 100644 --- a/package/expo-package/package.json +++ b/package/expo-package/package.json @@ -1,7 +1,7 @@ { "name": "stream-chat-expo", "description": "The official Expo SDK for Stream Chat, a service for building chat applications", - "version": "5.19.0", + "version": "5.19.2", "author": { "company": "Stream.io Inc", "name": "Stream.io Inc" @@ -10,7 +10,7 @@ "main": "src/index.js", "types": "types/index.d.ts", "dependencies": { - "stream-chat-react-native-core": "5.19.0" + "stream-chat-react-native-core": "5.19.2" }, "peerDependencies": { "@react-native-community/netinfo": ">=6.0.0", diff --git a/package/expo-package/yarn.lock b/package/expo-package/yarn.lock index 6529fae030..b871bac900 100644 --- a/package/expo-package/yarn.lock +++ b/package/expo-package/yarn.lock @@ -3034,10 +3034,10 @@ stream-buffers@2.2.x: resolved "https://registry.yarnpkg.com/stream-buffers/-/stream-buffers-2.2.0.tgz#91d5f5130d1cef96dcfa7f726945188741d09ee4" integrity sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg== -stream-chat-react-native-core@5.19.0: - version "5.19.0" - resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.19.0.tgz#8408f64c7d4eb97fc315e865b0759092e17c09ca" - integrity sha512-p/+Rdo18JIoBkt+BovFnNezh18DXq+/k6WClx1JPgjcJg35OkqXx/W47WLLWuurBw/NR/Il9orFj7JRO/Ebddg== +stream-chat-react-native-core@5.19.1: + version "5.19.1" + resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.19.1.tgz#937ab2d96eb6b8c9e67427a64363da9cb1970a84" + integrity sha512-N8QNlwMSL5DH+h/NkVaOzfnwEj3oVcxmqRHYsWR+iD2J2DqEB2TGZYh2Rs11z1dmTnyJJLpAVa3eUCIlzSCw9A== dependencies: "@babel/runtime" "^7.12.5" "@gorhom/bottom-sheet" "4.4.8" @@ -3051,12 +3051,12 @@ stream-chat-react-native-core@5.19.0: path "0.12.7" react-native-markdown-package "1.8.2" react-native-url-polyfill "^1.3.0" - stream-chat "~8.12.2" + stream-chat "~8.13.1" -stream-chat@~8.12.2: - version "8.12.4" - resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.12.4.tgz#3c2044ceb74b4be8bd06191963723d7d47014ec1" - integrity sha512-YaNuQNqiJcF82+VKAGNSV8wv0+Th73kHIV4Owiu2Bvhwqt7398Ertr+bxW4WXkBtwKoAeOZOc0oacrUKWQAuKQ== +stream-chat@~8.13.1: + version "8.13.1" + resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.13.1.tgz#9781a456487f376d7c9c98271a4f4c926a9e6cf8" + integrity sha512-k0tOmtlLsvVxpZ2EuR+Z/qQiyCHOIjACqwnBZnT1ERA1t3549U2vzkUE6l2tN2VGAgUP1tDl00FhZO5JrAkMKw== dependencies: "@babel/runtime" "^7.16.3" "@types/jsonwebtoken" "~9.0.0" diff --git a/package/native-package/package.json b/package/native-package/package.json index c3015e43d8..f0175677f7 100644 --- a/package/native-package/package.json +++ b/package/native-package/package.json @@ -1,7 +1,7 @@ { "name": "stream-chat-react-native", "description": "The official React Native SDK for Stream Chat, a service for building chat applications", - "version": "5.19.0", + "version": "5.19.2", "author": { "company": "Stream.io Inc", "name": "Stream.io Inc" @@ -11,7 +11,7 @@ "types": "types/index.d.ts", "dependencies": { "es6-symbol": "^3.1.3", - "stream-chat-react-native-core": "5.19.0" + "stream-chat-react-native-core": "5.19.2" }, "peerDependencies": { "@react-native-camera-roll/camera-roll": ">=5.0.0", diff --git a/package/native-package/yarn.lock b/package/native-package/yarn.lock index d8e32a4928..788db2f790 100644 --- a/package/native-package/yarn.lock +++ b/package/native-package/yarn.lock @@ -4379,10 +4379,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.19.0: - version "5.19.0" - resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.19.0.tgz#8408f64c7d4eb97fc315e865b0759092e17c09ca" - integrity sha512-p/+Rdo18JIoBkt+BovFnNezh18DXq+/k6WClx1JPgjcJg35OkqXx/W47WLLWuurBw/NR/Il9orFj7JRO/Ebddg== +stream-chat-react-native-core@5.19.1: + version "5.19.1" + resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.19.1.tgz#937ab2d96eb6b8c9e67427a64363da9cb1970a84" + integrity sha512-N8QNlwMSL5DH+h/NkVaOzfnwEj3oVcxmqRHYsWR+iD2J2DqEB2TGZYh2Rs11z1dmTnyJJLpAVa3eUCIlzSCw9A== dependencies: "@babel/runtime" "^7.12.5" "@gorhom/bottom-sheet" "4.4.8" @@ -4396,12 +4396,12 @@ stream-chat-react-native-core@5.19.0: path "0.12.7" react-native-markdown-package "1.8.2" react-native-url-polyfill "^1.3.0" - stream-chat "~8.12.2" + stream-chat "~8.13.1" -stream-chat@~8.12.2: - version "8.12.4" - resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.12.4.tgz#3c2044ceb74b4be8bd06191963723d7d47014ec1" - integrity sha512-YaNuQNqiJcF82+VKAGNSV8wv0+Th73kHIV4Owiu2Bvhwqt7398Ertr+bxW4WXkBtwKoAeOZOc0oacrUKWQAuKQ== +stream-chat@~8.13.1: + version "8.13.1" + resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.13.1.tgz#9781a456487f376d7c9c98271a4f4c926a9e6cf8" + integrity sha512-k0tOmtlLsvVxpZ2EuR+Z/qQiyCHOIjACqwnBZnT1ERA1t3549U2vzkUE6l2tN2VGAgUP1tDl00FhZO5JrAkMKw== dependencies: "@babel/runtime" "^7.16.3" "@types/jsonwebtoken" "~9.0.0" diff --git a/package/package.json b/package/package.json index 1885bd10d1..431f1aa326 100644 --- a/package/package.json +++ b/package/package.json @@ -1,7 +1,7 @@ { "name": "stream-chat-react-native-core", "description": "The official React Native and Expo components for Stream Chat, a service for building chat applications", - "version": "5.19.0", + "version": "5.19.2", "author": { "company": "Stream.io Inc", "name": "Stream.io Inc" @@ -79,7 +79,7 @@ "path": "0.12.7", "react-native-markdown-package": "1.8.2", "react-native-url-polyfill": "^1.3.0", - "stream-chat": "~8.12.2" + "stream-chat": "~8.13.1" }, "peerDependencies": { "react-native-quick-sqlite": ">=5.1.0", diff --git a/package/src/components/ChannelPreview/hooks/useLatestMessagePreview.ts b/package/src/components/ChannelPreview/hooks/useLatestMessagePreview.ts index eebf1fe1ab..b728a0e9c5 100644 --- a/package/src/components/ChannelPreview/hooks/useLatestMessagePreview.ts +++ b/package/src/components/ChannelPreview/hooks/useLatestMessagePreview.ts @@ -63,7 +63,9 @@ const getMentionUsers = < }, ''); // escape special characters - return mentionUserString.replaceAll(/[.*+?^${}()|[\]\\]/g, '\\$&'); + return mentionUserString.replace(/[.*+?^${}()|[\]\\]/g, function (match) { + return '\\' + match; + }); } return ''; diff --git a/package/src/components/Message/MessageSimple/utils/renderText.tsx b/package/src/components/Message/MessageSimple/utils/renderText.tsx index e533655b62..93b7808ed7 100644 --- a/package/src/components/Message/MessageSimple/utils/renderText.tsx +++ b/package/src/components/Message/MessageSimple/utils/renderText.tsx @@ -226,7 +226,10 @@ export const renderText = < if (userName) { acc += `${acc.length ? '|' : ''}@${userName}`; } - return acc.replaceAll(/[.*+?^${}()|[\]\\]/g, '\\$&'); + + return acc.replace(/[.*+?^${}()|[\]\\]/g, function (match) { + return '\\' + match; + }); }, '') : ''; diff --git a/package/src/version.json b/package/src/version.json index be5d09d537..fb4c5ceb6e 100644 --- a/package/src/version.json +++ b/package/src/version.json @@ -1,3 +1,3 @@ { - "version": "5.19.0" + "version": "5.19.2" } diff --git a/package/yarn.lock b/package/yarn.lock index d54960c906..98b5b019d4 100644 --- a/package/yarn.lock +++ b/package/yarn.lock @@ -9499,10 +9499,10 @@ stream-buffers@2.2.x: resolved "https://registry.yarnpkg.com/stream-buffers/-/stream-buffers-2.2.0.tgz#91d5f5130d1cef96dcfa7f726945188741d09ee4" integrity sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg== -stream-chat@~8.12.2: - version "8.12.2" - resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.12.2.tgz#c1906a15280ce8114639b0ee338d2e3722d1f572" - integrity sha512-Fn13nh1g2ZkW94tzH3BF0E87hS8cI6nBIH1UlgkUodRx4zmcNKH8L7dvuEFEWzsxb5ZBA4j3rwKCQfLynMuUsQ== +stream-chat@~8.13.1: + version "8.13.1" + resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.13.1.tgz#9781a456487f376d7c9c98271a4f4c926a9e6cf8" + integrity sha512-k0tOmtlLsvVxpZ2EuR+Z/qQiyCHOIjACqwnBZnT1ERA1t3549U2vzkUE6l2tN2VGAgUP1tDl00FhZO5JrAkMKw== dependencies: "@babel/runtime" "^7.16.3" "@types/jsonwebtoken" "~9.0.0"