Skip to content

Commit 77980fa

Browse files
authored
chore: upgrade sample apps to RN 0.76.1 and added new arch docs (#2756)
* chore: upgrade sample apps to RN 0.76.1 * docs: add new architecture guide * docs: add new architecture guide * fix: vale issues * chore: update the sample apps
1 parent 65f1a6b commit 77980fa

File tree

26 files changed

+1986
-2334
lines changed

26 files changed

+1986
-2334
lines changed

.styles/Vocab/Base/accept.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,6 @@ loadMore
5959
pollAnswers
6060
enum
6161
SendMessage
62+
interop
63+
bridgeless
64+
resizer
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
id: new-architecture
3+
title: React Native New Architecture
4+
---
5+
6+
Starting v6 we support the [new architecture](https://reactnative.dev/architecture/landing-page) for the React Native Chat SDK.
7+
8+
To be compatible with the new architecture, it is recommended that you use React Native version `0.75.4` and above for React Native CLI and `>=51` for Expo.
9+
10+
### Dependencies
11+
12+
On Native CLI, we recommend you to be on the following versions or higher of the peer dependencies to be able to run the new architecture:
13+
14+
| Dependencies | Versions |
15+
| ----------------------------------- | ---------- |
16+
| `@op-engineering/op-sqlite` | `>=9.3.0` |
17+
| `@react-native-clipboard/clipboard` | `>=1.4.1` |
18+
| `react-native-blob-util` | `>=0.17.0` |
19+
| `react-native-document-picker` | `>=9.1.1` |
20+
| `react-native-gesture-handler` | `>=2.15.0` |
21+
| `react-native-haptic-feedback` | `>=2.2.0` |
22+
| `react-native-image-picker` | `>=7.1.1` |
23+
| `react-native-reanimated` | `>=3.9.0` |
24+
| `react-native-share` | `>=10.0.2` |
25+
| `react-native-svg` | `>=15.2.0` |
26+
27+
Few of the dependencies we rely on are not fully new architecture compatible yet.
28+
29+
1. `react-native-audio-recorder-player` and `react-native-video` work on interop mode.
30+
2. `react-native-document-picker` doesn't support the bridgeless mode. Please use [`@react-native-documents/picker`](https://react-native-documents.github.io/docs/sponsor-only/intro) if you want the bridgeless mode. You can register your own native handler with us using our [Native Handler](../customization/native-handlers.mdx) guide.
31+
3. `@react-native-camera-roll/camera-roll` doesn't work alongside the Image resizer module that we have. We recommend using the native image picker for now. You can read [the guide](./native-image-picker.mdx) here.
32+
33+
:::note
34+
Although the above dependencies are not fully compatible with the new architecture, you can still use them in your project. They doesn't stop you from building the app on both iOS and Android.
35+
:::
36+
37+
For expo, make sure you are on the latest version of the dependencies with the current expo version you have.
38+
39+
### Known issues and limitations
40+
41+
- The audio recorder is not fully compatible with the new architecture, so you might face some issues while recording the audio and playing it using `react-native-audio-recorder-player`. We are working on it to fix the issues.
42+
- The image gallery animations behaves differently and seem to lag a bit on the new architecture specially when you use the pan gesture to drag down the image. We are working on it to fix the issues.
43+
44+
Please feel free to report any issues you face while using the new architecture.

docusaurus/sidebars-react-native.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@
157157
"guides/audio-messages-support",
158158
"guides/date-time-formatting",
159159
"guides/native-image-picker",
160+
"guides/new-architecture",
160161
"customization/typescript",
161162
"basics/troubleshooting",
162163
"basics/stream_chat_with_navigation",

examples/SampleApp/Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ ruby ">= 2.6.10"
66
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
77
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
88
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
9+
gem 'xcodeproj', '< 1.26.0'
910
gem 'fastlane'
1011
gem 'rubocop-performance'
1112
gem 'rubocop-require_tools'

examples/SampleApp/android/app/src/main/java/com/sampleapp/MainApplication.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import com.facebook.react.ReactPackage
99
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
1010
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
1111
import com.facebook.react.defaults.DefaultReactNativeHost
12+
import com.facebook.react.soloader.OpenSourceMergedSoMapping
1213
import com.facebook.soloader.SoLoader
1314

1415
class MainApplication : Application(), ReactApplication {
@@ -34,7 +35,7 @@ class MainApplication : Application(), ReactApplication {
3435

3536
override fun onCreate() {
3637
super.onCreate()
37-
SoLoader.init(this, false)
38+
SoLoader.init(this, OpenSourceMergedSoMapping)
3839
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
3940
// If you opted-in for the New Architecture, we load the native entry point for this app.
4041
load()

examples/SampleApp/android/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import org.apache.tools.ant.taskdefs.condition.Os
33

44
buildscript {
55
ext {
6-
buildToolsVersion = "34.0.0"
7-
minSdkVersion = 23
8-
compileSdkVersion = 34
6+
buildToolsVersion = "35.0.0"
7+
minSdkVersion = 24
8+
compileSdkVersion = 35
99
targetSdkVersion = 34
1010
ndkVersion = "26.1.10909125"
1111
kotlinVersion = "1.9.24"

examples/SampleApp/android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
3232
# your application. You should enable this flag either if you want
3333
# to write custom TurboModules/Fabric components OR use libraries that
3434
# are providing them.
35-
newArchEnabled=false
35+
newArchEnabled=true
3636

3737
# Use this property to enable or disable the Hermes JS engine.
3838
# If set to false, you will be using JSC instead.

examples/SampleApp/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

examples/SampleApp/android/gradlew

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -84,7 +86,8 @@ done
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
8688
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90+
' "$PWD" ) || exit
8891

8992
# Use the maximum available, or set MAX_FD != -1 to use that value.
9093
MAX_FD=maximum

examples/SampleApp/android/gradlew.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@rem See the License for the specific language governing permissions and
1414
@rem limitations under the License.
1515
@rem
16+
@rem SPDX-License-Identifier: Apache-2.0
17+
@rem
1618

1719
@if "%DEBUG%"=="" @echo off
1820
@rem ##########################################################################

0 commit comments

Comments
 (0)