Skip to content

Commit

Permalink
Merge pull request #1908 from GetStream/develop
Browse files Browse the repository at this point in the history
Next Release
  • Loading branch information
vanGalilea committed Jan 19, 2023
2 parents 12d38bf + 788902d commit c1e7cb7
Show file tree
Hide file tree
Showing 59 changed files with 6,620 additions and 8,581 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/changelog-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@ jobs:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
- name: Installation
run: yarn --frozen-lockfile && yarn bootstrap-ci
run: |
yarn --frozen-lockfile
cd package/
yarn --frozen-lockfile
cd native-package/
yarn --frozen-lockfile
cd ../../examples/SampleApp/
yarn --frozen-lockfile
- name: Generate Changelog
id: generate_changelog
run: |
Expand Down
17 changes: 14 additions & 3 deletions .github/workflows/check-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,30 @@ on:
jobs:
check_pr:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 16.x ]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Installation & Build Package
# installation already takes care of calling prepare which calls build
# for the sdk package
run: yarn --frozen-lockfile && yarn bootstrap-ci
run: |
yarn --frozen-lockfile
cd package/
yarn --frozen-lockfile
cd native-package/
yarn --frozen-lockfile
cd ../../examples/SampleApp/
yarn --frozen-lockfile
- name: Lint
run: yarn lerna-workspaces run lint && cd docusaurus && npx prettier --check '**/*.mdx'
- name: Test
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/next-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,18 @@ jobs:
registry-url: 'https://registry.npmjs.org'
- name: Prepare git
run: |
git config --global user.name "Vishal Narkhede"
git config --global user.email "vishal@getstream.io"
git config --global user.name "Steve Galili"
git config --global user.email "steve.galili@getstream.io"
- name: Installation && Build SDK
run: yarn --frozen-lockfile && yarn bootstrap-ci
run: |
yarn --frozen-lockfile
cd package/
yarn --frozen-lockfile
cd native-package/
yarn --frozen-lockfile
cd ../../examples/SampleApp/
yarn --frozen-lockfile
- name: Lint
run: yarn lerna-workspaces run lint && (cd docusaurus; npx prettier --check '**/*.mdx')
- name: Test
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,15 @@ jobs:
git config --global user.name "Steve Galili"
git config --global user.email "steve.galili@getstream.io"
- name: Installation && Build SDK
run: yarn --frozen-lockfile && yarn bootstrap-ci
run: |
yarn --frozen-lockfile
cd package/
yarn --frozen-lockfile
cd native-package/
yarn --frozen-lockfile
cd ../../examples/SampleApp/
yarn --frozen-lockfile
- name: Lint
run: yarn lerna-workspaces run lint && cd docusaurus && npx prettier --check '**/*.mdx'
- name: Publish Release
Expand Down
22 changes: 16 additions & 6 deletions .github/workflows/sample-distribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,14 @@ jobs:
timeout_minutes: 10
max_attempts: 3
command: |
yarn && yarn bootstrap-ci;
cd package/native-package
yarn;
yarn --frozen-lockfile
cd package/
yarn --frozen-lockfile
cd native-package/
yarn --frozen-lockfile
cd ../../examples/SampleApp/
yarn --frozen-lockfile
- name: Cache iOS pods
uses: actions/cache@v2
with:
Expand Down Expand Up @@ -73,9 +78,14 @@ jobs:
max_attempts: 3
command: |
yarn add global react-native-cli;
yarn && yarn bootstrap-ci;
cd package/native-package
yarn;
yarn --frozen-lockfile
cd package/
yarn --frozen-lockfile
cd native-package/
yarn --frozen-lockfile
cd ../../examples/SampleApp/
yarn --frozen-lockfile
- name: Build
run: |
cd examples/SampleApp
Expand Down
4 changes: 2 additions & 2 deletions docusaurus/docs/reactnative/basics/getting_started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@ Stream Chat for React Native is set up for parity on Expo, expo requires a diffe
### Add Required Dependencies

```bash
expo install stream-chat-expo
expo install @react-native-community/netinfo expo-document-picker expo-file-system expo-haptics expo-image-manipulator expo-image-picker expo-media-library expo-sharing react-native-gesture-handler react-native-reanimated react-native-svg
npx expo install stream-chat-expo
npx expo install @react-native-community/netinfo expo-document-picker expo-file-system expo-haptics expo-image-manipulator expo-image-picker expo-media-library expo-sharing react-native-gesture-handler react-native-reanimated react-native-svg
```

### Additional Steps
Expand Down
11 changes: 5 additions & 6 deletions docusaurus/docs/reactnative/basics/offline_support.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ The offline storage implementation currently offers the following features:
- Access to chat when Internet connection is disabled or low.
- Faster startup times and loading, since initial data is loaded from offline storage before performing any network requests.
- Syncing of the offline database using WebSocket events and Sync API.
- Optimistically update offline database during chat interactions, such as send message, add reaction, etc.

The following features are currently **NOT** implemented. They will be implemented gradually as part of minor releases in v5.

- Optimistically update offline database during chat interactions, such as send message, add reaction, etc.
- Access to threads in offline mode.

## How To Enable Offline Support
Expand All @@ -30,19 +30,18 @@ To enable offline support, please follow the given steps:

1. **Upgrade stream-chat dependency (optional)**

If you have installed `stream-chat` dependency explicitly on your application, then upgrade it to v7:
If you have installed `stream-chat` dependency explicitly on your application, then please make sure to upgrade it to v7 or higher.

```bash
yarn add stream-chat@7.0.0
yarn add stream-chat
```

2. **Add `react-native-quick-sqlite` dependency**

> At the moment, support for only v4 of `react-native-quick-sqlite` is available.
> Support for v5 of `react-native-quick-sqlite` will be introduced in one of the upcoming minor release.
> If you are using v5.5.1 or lower version of `stream-chat-react-native`, then please install v4 of `react-native-quick-sqlite` instead.
```bash
yarn add react-native-quick-sqlite@4.0.8
yarn add react-native-quick-sqlite@5.1.0
npx pod-install
```

Expand Down
16 changes: 16 additions & 0 deletions docusaurus/docs/reactnative/customization/native_handlers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,19 @@ A function to trigger haptic feedback given the type of haptic force desired.
**React Native:** [`react-native-haptic-feedback`](https://github.com/junina-de/react-native-haptic-feedback)

**Expo:** [`expo-haptics`](https://docs.expo.io/versions/latest/sdk/haptics/)

### Sound

A component that renders the Sound/Audio on the message attachment.

**React Native:** [`react-native-video`](https://github.com/react-native-video/react-native-video)

**Expo:** [`expo-av`](https://docs.expo.dev/versions/latest/sdk/av/)

### Video

A component that renders the Video on the ImageGallery when an video attachment is opened.

**React Native:** [`react-native-video`](https://github.com/react-native-video/react-native-video)

**Expo:** [`expo-av`](https://docs.expo.dev/versions/latest/sdk/av/)
3 changes: 2 additions & 1 deletion examples/ExpoMessaging/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import 'react-native-gesture-handler';
import React, { useContext, useEffect, useMemo, useState } from 'react';
import { LogBox, SafeAreaView, StatusBar, useColorScheme, View } from 'react-native';
import { DarkTheme, DefaultTheme, NavigationContainer } from '@react-navigation/native';
import { createStackNavigator, useHeaderHeight } from '@react-navigation/stack';
import { createStackNavigator } from '@react-navigation/stack';
import { useHeaderHeight } from '@react-navigation/elements';
import { SafeAreaProvider, useSafeAreaInsets } from 'react-native-safe-area-context';
import { StreamChat } from 'stream-chat';
import {
Expand Down
44 changes: 15 additions & 29 deletions examples/ExpoMessaging/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
apply plugin: "com.android.application"

import com.android.build.OutputFile
import org.apache.tools.ant.taskdefs.condition.Os

/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
Expand Down Expand Up @@ -151,27 +150,14 @@ android {
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()

if (isNewArchitectureEnabled()) {
// We configure the NDK build only if you decide to opt-in for the New Architecture.
// We configure the CMake build only if you decide to opt-in for the New Architecture.
externalNativeBuild {
ndkBuild {
arguments "APP_PLATFORM=android-21",
"APP_STL=c++_shared",
"NDK_TOOLCHAIN_VERSION=clang",
"GENERATED_SRC_DIR=$buildDir/generated/source",
"PROJECT_BUILD_DIR=$buildDir",
"REACT_ANDROID_DIR=${reactNativeRoot}/ReactAndroid",
"REACT_ANDROID_BUILD_DIR=${reactNativeRoot}/ReactAndroid/build",
"NODE_MODULES_DIR=$rootDir/../node_modules"
cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1"
cppFlags "-std=c++17"
// Make sure this target name is the same you specify inside the
// src/main/jni/Android.mk file for the `LOCAL_MODULE` variable.
targets "expomessaging_appmodules"

// Fix for windows limit on number of character in file paths and in command lines
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
arguments "NDK_APP_SHORT_COMMANDS=true"
}
cmake {
arguments "-DPROJECT_BUILD_DIR=$buildDir",
"-DREACT_ANDROID_DIR=${reactNativeRoot}/ReactAndroid",
"-DREACT_ANDROID_BUILD_DIR=${reactNativeRoot}/ReactAndroid/build",
"-DNODE_MODULES_DIR=$rootDir/../node_modules",
"-DANDROID_STL=c++_shared"
}
}
if (!enableSeparateBuildPerCPUArchitecture) {
Expand All @@ -183,10 +169,10 @@ android {
}

if (isNewArchitectureEnabled()) {
// We configure the NDK build only if you decide to opt-in for the New Architecture.
// We configure the CMake build only if you decide to opt-in for the New Architecture.
externalNativeBuild {
ndkBuild {
path "$projectDir/src/main/jni/Android.mk"
cmake {
path "$projectDir/src/main/jni/CMakeLists.txt"
}
}
def reactAndroidProjectDir = project(':ReactAndroid').projectDir
Expand All @@ -208,15 +194,15 @@ android {
preReleaseBuild.dependsOn(packageReactNdkReleaseLibs)

// Due to a bug inside AGP, we have to explicitly set a dependency
// between configureNdkBuild* tasks and the preBuild tasks.
// between configureCMakeDebug* tasks and the preBuild tasks.
// This can be removed once this is solved: https://issuetracker.google.com/issues/207403732
configureNdkBuildRelease.dependsOn(preReleaseBuild)
configureNdkBuildDebug.dependsOn(preDebugBuild)
configureCMakeRelWithDebInfo.dependsOn(preReleaseBuild)
configureCMakeDebug.dependsOn(preDebugBuild)
reactNativeArchitectures().each { architecture ->
tasks.findByName("configureNdkBuildDebug[${architecture}]")?.configure {
tasks.findByName("configureCMakeDebug[${architecture}]")?.configure {
dependsOn("preDebugBuild")
}
tasks.findByName("configureNdkBuildRelease[${architecture}]")?.configure {
tasks.findByName("configureCMakeRelWithDebInfo[${architecture}]")?.configure {
dependsOn("preReleaseBuild")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</queries>
<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:allowBackup="true" android:theme="@style/AppTheme" android:usesCleartextTraffic="true" android:requestLegacyExternalStorage="true">
<meta-data android:name="expo.modules.updates.ENABLED" android:value="true"/>
<meta-data android:name="expo.modules.updates.EXPO_SDK_VERSION" android:value="46.0.0"/>
<meta-data android:name="expo.modules.updates.EXPO_SDK_VERSION" android:value="47.0.0"/>
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
<meta-data android:name="expo.modules.updates.EXPO_UPDATE_URL" android:value="https://exp.host/@anonymous/ExpoMessaging"/>
Expand Down
13 changes: 3 additions & 10 deletions examples/ExpoMessaging/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import org.apache.tools.ant.taskdefs.condition.Os

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext {
buildToolsVersion = findProperty('android.buildToolsVersion') ?: '31.0.0'
Expand All @@ -25,15 +24,15 @@ buildscript {
mavenCentral()
}
dependencies {
classpath('com.android.tools.build:gradle:7.1.1')
classpath('com.android.tools.build:gradle:7.2.1')
classpath('com.facebook.react:react-native-gradle-plugin')
classpath('de.undercouch:gradle-download-task:5.0.1')
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

def REACT_NATIVE_VERSION = new File(['node', '--print',"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())
def REACT_NATIVE_VERSION = new File(['node', '--print', "JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())

allprojects {
configurations.all {
Expand Down Expand Up @@ -64,9 +63,3 @@ allprojects {
maven { url 'https://www.jitpack.io' }
}
}

configurations.all {
resolutionStrategy {
force 'com.facebook.react:react-native:0.69.6'
}
}
3 changes: 3 additions & 0 deletions examples/ExpoMessaging/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@ expo.webp.enabled=true
# Enable animated webp support (~3.4 MB increase)
# Disabled by default because iOS doesn't support animated webp
expo.webp.animated=false
# disables the check for multiple instances for gesture handler
# this is needed for react-native-gesture-handler to be both a devDep of core and be a dep on the expo sample app
disableMultipleInstancesCheck=true
Binary file modified examples/ExpoMessaging/android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 6 additions & 0 deletions examples/ExpoMessaging/android/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
14 changes: 8 additions & 6 deletions examples/ExpoMessaging/android/gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
Expand All @@ -25,7 +25,7 @@
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand All @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand Down Expand Up @@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal
Expand Down
Loading

0 comments on commit c1e7cb7

Please sign in to comment.