Skip to content

Commit 6f59551

Browse files
authored
Merge pull request #556 from GetStream/upgrades
CRNS-282: RN 0.64, Expo 41 - upgrade packages and make corresponding changes
2 parents 3444423 + d4887be commit 6f59551

File tree

402 files changed

+14966
-23842
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

402 files changed

+14966
-23842
lines changed

.eslintrc.json

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
"browser": true,
44
"es6": true
55
},
6-
"extends": [
7-
"eslint:recommended",
8-
"plugin:react/recommended",
9-
"plugin:jest/recommended"
10-
],
6+
"extends": ["eslint:recommended", "plugin:react/recommended", "plugin:jest/recommended"],
117
"parser": "babel-eslint",
128
"parserOptions": {
139
"ecmaFeatures": {
@@ -51,10 +47,7 @@
5147
"react/prop-types": 0,
5248
"require-await": 2,
5349
"semi": [1, "always"],
54-
"sort-destructure-keys/sort-destructure-keys": [
55-
2,
56-
{ "caseSensitive": false }
57-
],
50+
"sort-destructure-keys/sort-destructure-keys": [2, { "caseSensitive": false }],
5851
"sort-imports": [
5952
"error",
6053
{
@@ -65,11 +58,7 @@
6558
"memberSyntaxSortOrder": ["none", "all", "multiple", "single"]
6659
}
6760
],
68-
"sort-keys": [
69-
"error",
70-
"asc",
71-
{ "caseSensitive": false, "minKeys": 2, "natural": false }
72-
],
61+
"sort-keys": ["error", "asc", { "caseSensitive": false, "minKeys": 2, "natural": false }],
7362
"valid-typeof": 2
7463
},
7564
"settings": {
@@ -107,7 +96,7 @@
10796
"plugin:jest/recommended",
10897
"plugin:prettier/recommended",
10998
"plugin:react/recommended",
110-
"prettier/@typescript-eslint"
99+
"prettier"
111100
],
112101
"files": ["**/*.ts", "**/*.tsx"],
113102
"parser": "@typescript-eslint/parser",
@@ -168,10 +157,7 @@
168157
"react/prop-types": 0,
169158
"require-await": 2,
170159
"semi": [1, "always"],
171-
"sort-destructure-keys/sort-destructure-keys": [
172-
2,
173-
{ "caseSensitive": false }
174-
],
160+
"sort-destructure-keys/sort-destructure-keys": [2, { "caseSensitive": false }],
175161
"sort-imports": [
176162
"error",
177163
{
@@ -182,11 +168,7 @@
182168
"memberSyntaxSortOrder": ["none", "all", "multiple", "single"]
183169
}
184170
],
185-
"sort-keys": [
186-
"error",
187-
"asc",
188-
{ "caseSensitive": false, "minKeys": 2, "natural": false }
189-
],
171+
"sort-keys": ["error", "asc", { "caseSensitive": false, "minKeys": 2, "natural": false }],
190172
"typescript-sort-keys/interface": [
191173
"error",
192174
"asc",

.husky/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
dotgit/hooks/pre-commit-format.sh && dotgit/hooks/pre-commit-reject-binaries.py

.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"arrowParens": "always",
33
"jsxSingleQuote": true,
4+
"printWidth": 100,
45
"singleQuote": true,
56
"tabWidth": 2,
67
"trailingComma": "all"

babel.config.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@ module.exports = (api) => {
2727
],
2828
'module-resolver',
2929
],
30-
presets: [
31-
'@babel/env',
32-
'module:metro-react-native-babel-preset',
33-
'@babel/preset-typescript',
34-
],
30+
presets: ['@babel/env', 'module:metro-react-native-babel-preset', '@babel/preset-typescript'],
3531
};
3632
}
3733

@@ -72,10 +68,6 @@ module.exports = (api) => {
7268
],
7369
'module-resolver',
7470
],
75-
presets: [
76-
'@babel/env',
77-
'module:metro-react-native-babel-preset',
78-
'@babel/preset-typescript',
79-
],
71+
presets: ['@babel/env', 'module:metro-react-native-babel-preset', '@babel/preset-typescript'],
8072
};
8173
};

bin/validate-translations.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ fs.readdir(directoryPath, function (err, files) {
1919
keys.forEach((key) => {
2020
if (!data[key] || data[key] === '') {
2121
countMissingTranslations = countMissingTranslations + 1;
22-
console.error(
23-
'Missing translation for key "' + key + '" in "' + file + '"',
24-
);
22+
console.error('Missing translation for key "' + key + '" in "' + file + '"');
2523
}
2624
});
2725
});
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"f9155ac790fd02fadcdeca367b02581c04a353aa6d5aa84409a59f6804c87acd": true,
33
"89ed26367cdb9b771858e026f2eb95bfdb90e5ae943e716575327ec325f39c44": true
4-
}
4+
}

examples/ExpoMessaging/App.js

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
/* eslint-disable react/display-name */
22
import 'react-native-gesture-handler';
33
import React, { useContext, useEffect, useMemo, useState } from 'react';
4-
import { LogBox, SafeAreaView, useColorScheme, View } from 'react-native';
5-
import {
6-
DarkTheme,
7-
DefaultTheme,
8-
NavigationContainer,
9-
} from '@react-navigation/native';
4+
import { LogBox, SafeAreaView, StatusBar, useColorScheme, View } from 'react-native';
5+
import { DarkTheme, DefaultTheme, NavigationContainer } from '@react-navigation/native';
106
import { createStackNavigator, useHeaderHeight } from '@react-navigation/stack';
11-
import {
12-
SafeAreaProvider,
13-
useSafeAreaInsets,
14-
} from 'react-native-safe-area-context';
7+
import { SafeAreaProvider, useSafeAreaInsets } from 'react-native-safe-area-context';
158
import { StreamChat } from 'stream-chat';
169
import {
1710
Channel,
@@ -89,11 +82,7 @@ const ChannelScreen = ({ navigation }) => {
8982
return (
9083
<SafeAreaView>
9184
<Chat client={chatClient} i18nInstance={streami18n}>
92-
<Channel
93-
channel={channel}
94-
keyboardVerticalOffset={headerHeight}
95-
thread={thread}
96-
>
85+
<Channel channel={channel} keyboardVerticalOffset={headerHeight} thread={thread}>
9786
<View style={{ flex: 1 }}>
9887
<MessageList
9988
onThreadSelect={(thread) => {
@@ -116,11 +105,7 @@ const ThreadScreen = () => {
116105
return (
117106
<SafeAreaView>
118107
<Chat client={chatClient} i18nInstance={streami18n}>
119-
<Channel
120-
channel={channel}
121-
keyboardVerticalOffset={headerHeight}
122-
thread={thread}
123-
>
108+
<Channel channel={channel} keyboardVerticalOffset={headerHeight} thread={thread}>
124109
<View
125110
style={{
126111
flex: 1,
@@ -172,6 +157,7 @@ const App = () => {
172157
<OverlayProvider
173158
bottomInset={bottom}
174159
i18nInstance={streami18n}
160+
translucentStatusBar
175161
value={{ style: theme }}
176162
>
177163
{clientReady && (
@@ -211,9 +197,7 @@ const App = () => {
211197
export default () => {
212198
const theme = useStreamChatTheme();
213199
return (
214-
<SafeAreaProvider
215-
style={{ backgroundColor: theme.colors?.white_snow || '#FCFCFC' }}
216-
>
200+
<SafeAreaProvider style={{ backgroundColor: theme.colors?.white_snow || '#FCFCFC' }}>
217201
<App />
218202
</SafeAreaProvider>
219203
);

examples/ExpoMessaging/app.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
"name": "ExpoMessaging",
44
"slug": "ExpoMessaging",
55
"privacy": "public",
6-
"platforms": [
7-
"ios",
8-
"android",
9-
"web"
10-
],
6+
"platforms": ["ios", "android", "web"],
117
"version": "1.0.0",
128
"orientation": "portrait",
139
"icon": "./assets/icon.png",
@@ -19,9 +15,7 @@
1915
"updates": {
2016
"fallbackToCacheTimeout": 0
2117
},
22-
"assetBundlePatterns": [
23-
"**/*"
24-
],
18+
"assetBundlePatterns": ["**/*"],
2519
"ios": {
2620
"supportsTablet": true,
2721
"usesIcloudStorage": true

examples/ExpoMessaging/metro.config.js

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -50,31 +50,28 @@ function buildFullModuleMap(
5050

5151
alreadyVisited[moduleRoot] = true;
5252

53-
listDirectories(
54-
moduleRoot,
55-
({ fileName, fullFileName, symbolic, external }) => {
56-
if (symbolic)
57-
return buildFullModuleMap(
58-
resolvePath(fullFileName, 'node_modules'),
59-
mainModuleMap,
60-
externalModuleMap,
61-
alreadyVisited,
62-
);
63-
64-
const moduleMap = external ? externalModuleMap : mainModuleMap,
65-
moduleName = prefix ? PATH.join(prefix, fileName) : fileName;
66-
67-
if (fileName.charAt(0) !== '@') moduleMap[moduleName] = fullFileName;
68-
else
69-
return buildFullModuleMap(
70-
fullFileName,
71-
mainModuleMap,
72-
externalModuleMap,
73-
alreadyVisited,
74-
fileName,
75-
);
76-
},
77-
);
53+
listDirectories(moduleRoot, ({ fileName, fullFileName, symbolic, external }) => {
54+
if (symbolic)
55+
return buildFullModuleMap(
56+
resolvePath(fullFileName, 'node_modules'),
57+
mainModuleMap,
58+
externalModuleMap,
59+
alreadyVisited,
60+
);
61+
62+
const moduleMap = external ? externalModuleMap : mainModuleMap,
63+
moduleName = prefix ? PATH.join(prefix, fileName) : fileName;
64+
65+
if (fileName.charAt(0) !== '@') moduleMap[moduleName] = fullFileName;
66+
else
67+
return buildFullModuleMap(
68+
fullFileName,
69+
mainModuleMap,
70+
externalModuleMap,
71+
alreadyVisited,
72+
fileName,
73+
);
74+
});
7875
}
7976

8077
function buildModuleResolutionMap() {
@@ -87,11 +84,7 @@ function buildModuleResolutionMap() {
8784
return Object.assign({}, externalModuleMap, moduleMap);
8885
}
8986

90-
function findAlternateRoots(
91-
moduleRoot = baseModulePath,
92-
alternateRoots = [],
93-
_alreadyVisited,
94-
) {
87+
function findAlternateRoots(moduleRoot = baseModulePath, alternateRoots = [], _alreadyVisited) {
9588
const alreadyVisited = _alreadyVisited || {};
9689
if (alreadyVisited && alreadyVisited.hasOwnProperty(moduleRoot)) return;
9790

0 commit comments

Comments
 (0)