Skip to content

Commit 0e32587

Browse files
OnestarLeebang9
andauthored
feat: updated sample React version to 0.74.3
* chore: migrate react version to 0.74.3 Co-authored-by: bang9 <[email protected]>
1 parent 066d4a4 commit 0e32587

Some content is hidden

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

55 files changed

+6631
-4535
lines changed

Diff for: .circleci/config.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,15 @@ jobs:
8989

9090
deploy-android:
9191
docker:
92-
- image: cimg/android:2022.03-node
92+
- image: cimg/android:2023.10-node
9393
resource_class: xlarge
9494
environment:
9595
APP_VERSION: << pipeline.parameters.version >>
9696
steps:
9797
- checkout
98+
- run:
99+
name: Install Ninja
100+
command: sudo apt-get update && sudo apt-get install -y ninja-build
98101
- ruby/install:
99102
version: '2.7.6'
100103
- ruby/install-deps:

Diff for: .github/workflows/ci.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: ubuntu-latest
1818
strategy:
1919
matrix:
20-
node-version: [16.x]
20+
node-version: [18.x]
2121
steps:
2222
- uses: actions/checkout@v4
2323
- name: Use Node.js ${{ matrix.node-version }}
@@ -47,7 +47,7 @@ jobs:
4747
runs-on: ubuntu-latest
4848
strategy:
4949
matrix:
50-
node-version: [16.x]
50+
node-version: [18.x]
5151
steps:
5252
- uses: actions/checkout@v4
5353
- name: Use Node.js ${{ matrix.node-version }}
@@ -69,7 +69,7 @@ jobs:
6969
runs-on: ubuntu-latest
7070
strategy:
7171
matrix:
72-
node-version: [16.x, 18.x]
72+
node-version: [18.x]
7373
steps:
7474
- uses: actions/checkout@v4
7575
- name: Use Node.js ${{ matrix.node-version }}
@@ -91,7 +91,7 @@ jobs:
9191
runs-on: ubuntu-latest
9292
strategy:
9393
matrix:
94-
node-version: [16.x]
94+
node-version: [18.x]
9595
steps:
9696
- uses: actions/checkout@v4
9797
- name: Use Node.js ${{ matrix.node-version }}
@@ -119,7 +119,7 @@ jobs:
119119
runs-on: ubuntu-latest
120120
strategy:
121121
matrix:
122-
node-version: [16.x]
122+
node-version: [18.x]
123123
steps:
124124
- uses: actions/checkout@v4
125125
- name: Use Node.js ${{ matrix.node-version }}

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
.classpath
55
.project
66
.DS_Store
7+
.watchman-cookie-*
78

89
yarn-error.log
910
node_modules

Diff for: docs-validation/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
"@react-navigation/native": "^6.0.6",
1717
"@react-navigation/native-stack": "^6.7.0",
1818
"@sendbird/chat": "^4.10.7",
19-
"react": "17.0.2",
20-
"react-native": "0.67.5",
21-
"react-native-create-thumbnail": "^1.5.1",
19+
"react": "18.2.0",
20+
"react-native": "0.74.3",
21+
"react-native-create-thumbnail": "^2.0.0",
2222
"react-native-document-picker": "^8.0.0",
2323
"react-native-file-access": "^2.5.0",
2424
"react-native-image-picker": "^4.7.3",
@@ -42,7 +42,7 @@
4242
"metro-react-native-babel-preset": "^0.66.2",
4343
"react-dom": "17.0.2",
4444
"react-native-monorepo-tools": "^1.1.4",
45-
"react-test-renderer": "17.0.2",
45+
"react-test-renderer": "18.3.1",
4646
"typescript": "5.2.2"
4747
}
4848
}

Diff for: package.json

+5-6
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"make:feat": "yarn workspace @sendbird/uikit-react-native create-domain"
4040
},
4141
"devDependencies": {
42-
"@testing-library/react-native": "11",
42+
"@testing-library/react-native": "12.5.1",
4343
"@trivago/prettier-plugin-sort-imports": "^4.2.1",
4444
"@types/jest": "^29.4.0",
4545
"@typescript-eslint/eslint-plugin": "^6.9.1",
@@ -57,12 +57,12 @@
5757
"patch-package": "^6.4.7",
5858
"postinstall-postinstall": "^2.1.0",
5959
"prettier": "^2.8.8",
60-
"react": "17.0.2",
61-
"react-native": "0.67.5",
60+
"react": "18.2.0",
61+
"react-native": "0.74.3",
6262
"react-native-builder-bob": "^0.18.2",
6363
"react-native-fast-image": "^8.5.11",
6464
"react-native-safe-area-context": "^3.3.2",
65-
"react-test-renderer": "^17.0.2",
65+
"react-test-renderer": "^18.3.1",
6666
"typedoc": "^0.25.3",
6767
"typescript": "5.2.2",
6868
"yalc": "^1.0.0-pre.53"
@@ -99,7 +99,6 @@
9999
},
100100
"resolutions": {
101101
"@sendbird/chat": "4.11.3",
102-
"@types/react": "^18",
103-
"@types/react-native": "^0.67"
102+
"@types/react": "^18"
104103
}
105104
}

Diff for: packages/uikit-chat-hooks/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"devDependencies": {
5151
"@sendbird/uikit-testing-tools": "3.6.0",
5252
"@types/react": "*",
53-
"react": "17.0.2",
53+
"react": "18.2.0",
5454
"react-native-builder-bob": "^0.18.0",
5555
"typescript": "5.2.2"
5656
},

Diff for: packages/uikit-react-native-foundation/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353
"devDependencies": {
5454
"@types/react": "*",
5555
"@types/react-native": "*",
56-
"react": "17.0.2",
57-
"react-native": "0.67.5",
56+
"react": "18.2.0",
57+
"react-native": "0.74.3",
5858
"react-native-builder-bob": "^0.18.0",
5959
"react-native-fast-image": "^8.5.11",
6060
"react-native-safe-area-context": "^3.3.2",

Diff for: packages/uikit-react-native-foundation/src/components/Image/Image.fastimage.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ function convertSource(source: SendbirdImageProps['source']): Source | number {
2727
}
2828

2929
return {
30-
uri: source.uri,
31-
headers: source.headers,
32-
cache: convertCache(source.cache), //'immutable' | 'web' | 'cacheOnly'
30+
uri: source?.uri,
31+
headers: source?.headers,
32+
cache: convertCache(source?.cache), //'immutable' | 'web' | 'cacheOnly'
3333
};
3434
}
3535
function convertDefaultSource(source?: SendbirdImageProps['defaultSource']): number | undefined {

Diff for: packages/uikit-react-native-foundation/src/components/ImageWithPlaceholder/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ const useRetry = (hasError: boolean, retryCount = 5) => {
4040

4141
type Props = {
4242
source: number | { uri: string };
43-
width?: number | string;
44-
height?: number | string;
43+
width?: number | `${number}%`;
44+
height?: number | `${number}%`;
4545
style?: StyleProp<ViewStyle>;
4646
};
4747
const ImageWithPlaceholder = (props: Props) => {
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,51 @@
11
import { ImageStyle, StyleSheet, TextStyle, ViewStyle } from 'react-native';
2+
import { AnimatableNumericValue, DimensionValue } from 'react-native/Libraries/StyleSheet/StyleSheetTypes';
23

34
import { DEFAULT_SCALE_FACTOR } from './createScaleFactor';
45

56
type Styles = ViewStyle | TextStyle | ImageStyle;
67
type StylePreprocessor<T extends Styles = Styles> = { [key in keyof T]: (val: NonNullable<T[key]>) => typeof val };
78

8-
const SCALE_FACTOR_WITH_STR = (val: string | number) => (typeof val === 'string' ? val : DEFAULT_SCALE_FACTOR(val));
9+
const SCALE_FACTOR_WITH_DIMENSION_VALUE = (
10+
val: NonNullable<DimensionValue | undefined>,
11+
): NonNullable<DimensionValue | undefined> => {
12+
return typeof val === 'number' ? DEFAULT_SCALE_FACTOR(val) : val;
13+
};
14+
15+
const DEFAULT_SCALE_FACTOR_WITH_NUMERIC_VALUE = (
16+
val: NonNullable<AnimatableNumericValue | undefined>,
17+
): NonNullable<AnimatableNumericValue | undefined> => {
18+
return typeof val === 'number' ? DEFAULT_SCALE_FACTOR(val) : val;
19+
};
920

1021
const preProcessor: Partial<StylePreprocessor> = {
1122
'fontSize': DEFAULT_SCALE_FACTOR,
1223
'lineHeight': DEFAULT_SCALE_FACTOR,
13-
'borderRadius': DEFAULT_SCALE_FACTOR,
14-
'minWidth': SCALE_FACTOR_WITH_STR,
15-
'maxWidth': SCALE_FACTOR_WITH_STR,
16-
'minHeight': SCALE_FACTOR_WITH_STR,
17-
'maxHeight': SCALE_FACTOR_WITH_STR,
18-
'height': SCALE_FACTOR_WITH_STR,
19-
'width': SCALE_FACTOR_WITH_STR,
20-
'padding': SCALE_FACTOR_WITH_STR,
21-
'paddingVertical': SCALE_FACTOR_WITH_STR,
22-
'paddingHorizontal': SCALE_FACTOR_WITH_STR,
23-
'paddingTop': SCALE_FACTOR_WITH_STR,
24-
'paddingBottom': SCALE_FACTOR_WITH_STR,
25-
'paddingLeft': SCALE_FACTOR_WITH_STR,
26-
'paddingRight': SCALE_FACTOR_WITH_STR,
27-
'margin': SCALE_FACTOR_WITH_STR,
28-
'marginVertical': SCALE_FACTOR_WITH_STR,
29-
'marginHorizontal': SCALE_FACTOR_WITH_STR,
30-
'marginTop': SCALE_FACTOR_WITH_STR,
31-
'marginBottom': SCALE_FACTOR_WITH_STR,
32-
'marginLeft': SCALE_FACTOR_WITH_STR,
33-
'marginRight': SCALE_FACTOR_WITH_STR,
34-
'left': SCALE_FACTOR_WITH_STR,
35-
'right': SCALE_FACTOR_WITH_STR,
36-
'top': SCALE_FACTOR_WITH_STR,
37-
'bottom': SCALE_FACTOR_WITH_STR,
24+
'borderRadius': DEFAULT_SCALE_FACTOR_WITH_NUMERIC_VALUE,
25+
'minWidth': SCALE_FACTOR_WITH_DIMENSION_VALUE,
26+
'maxWidth': SCALE_FACTOR_WITH_DIMENSION_VALUE,
27+
'minHeight': SCALE_FACTOR_WITH_DIMENSION_VALUE,
28+
'maxHeight': SCALE_FACTOR_WITH_DIMENSION_VALUE,
29+
'height': SCALE_FACTOR_WITH_DIMENSION_VALUE,
30+
'width': SCALE_FACTOR_WITH_DIMENSION_VALUE,
31+
'padding': SCALE_FACTOR_WITH_DIMENSION_VALUE,
32+
'paddingVertical': SCALE_FACTOR_WITH_DIMENSION_VALUE,
33+
'paddingHorizontal': SCALE_FACTOR_WITH_DIMENSION_VALUE,
34+
'paddingTop': SCALE_FACTOR_WITH_DIMENSION_VALUE,
35+
'paddingBottom': SCALE_FACTOR_WITH_DIMENSION_VALUE,
36+
'paddingLeft': SCALE_FACTOR_WITH_DIMENSION_VALUE,
37+
'paddingRight': SCALE_FACTOR_WITH_DIMENSION_VALUE,
38+
'margin': SCALE_FACTOR_WITH_DIMENSION_VALUE,
39+
'marginVertical': SCALE_FACTOR_WITH_DIMENSION_VALUE,
40+
'marginHorizontal': SCALE_FACTOR_WITH_DIMENSION_VALUE,
41+
'marginTop': SCALE_FACTOR_WITH_DIMENSION_VALUE,
42+
'marginBottom': SCALE_FACTOR_WITH_DIMENSION_VALUE,
43+
'marginLeft': SCALE_FACTOR_WITH_DIMENSION_VALUE,
44+
'marginRight': SCALE_FACTOR_WITH_DIMENSION_VALUE,
45+
'left': SCALE_FACTOR_WITH_DIMENSION_VALUE,
46+
'right': SCALE_FACTOR_WITH_DIMENSION_VALUE,
47+
'top': SCALE_FACTOR_WITH_DIMENSION_VALUE,
48+
'bottom': SCALE_FACTOR_WITH_DIMENSION_VALUE,
3849
};
3950

4051
const preProcessorKeys = Object.keys(preProcessor);
@@ -46,7 +57,10 @@ const preProcessorLen = preProcessorKeys.length;
4657
* @param styles
4758
* @returns StyleSheet
4859
* */
49-
const createStyleSheet = <T extends StyleSheet.NamedStyles<T>>(styles: T | StyleSheet.NamedStyles<T>): T => {
60+
/* eslint-disable @typescript-eslint/no-explicit-any */
61+
const createStyleSheet = <T extends StyleSheet.NamedStyles<T> | StyleSheet.NamedStyles<any>>(
62+
styles: T & StyleSheet.NamedStyles<any>,
63+
): T => {
5064
Object.values(styles).forEach((style) => {
5165
// @ts-ignore
5266
const styleKeys = Object.keys(style);
@@ -61,5 +75,6 @@ const createStyleSheet = <T extends StyleSheet.NamedStyles<T>>(styles: T | Style
6175

6276
return StyleSheet.create<T>(styles);
6377
};
78+
/* eslint-enable @typescript-eslint/no-explicit-any */
6479

6580
export default createStyleSheet;

Diff for: packages/uikit-react-native/package.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
"@react-native-community/netinfo": "^9.3.0",
7373
"@react-native-firebase/app": "^14.4.0",
7474
"@react-native-firebase/messaging": "^14.4.0",
75-
"@sendbird/react-native-scrollview-enhancer": "^0.2.1",
7675
"@types/react": "*",
7776
"@types/react-native": "*",
7877
"@types/react-native-video": "^5.0.14",
@@ -89,11 +88,11 @@
8988
"glob": "^7.2.0",
9089
"inquirer": "^8.2.0",
9190
"js-convert-case": "^4.2.0",
92-
"react": "17.0.2",
93-
"react-native": "0.67.5",
91+
"react": "18.2.0",
92+
"react-native": "0.74.3",
9493
"react-native-audio-recorder-player": "^3.6.0",
9594
"react-native-builder-bob": "^0.18.0",
96-
"react-native-create-thumbnail": "^1.5.1",
95+
"react-native-create-thumbnail": "^2.0.0",
9796
"react-native-document-picker": "^8.0.0",
9897
"react-native-file-access": "^2.5.0",
9998
"react-native-image-picker": "^4.7.1",

Diff for: packages/uikit-testing-tools/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
"@types/react": "*",
4646
"@types/react-native": "*",
4747
"jest": "^29.4.3",
48-
"react": "17.0.2",
49-
"react-native": "0.67.5",
48+
"react": "18.2.0",
49+
"react-native": "0.74.3",
5050
"react-native-builder-bob": "^0.18.0",
5151
"typescript": "5.2.2"
5252
},

Diff for: packages/uikit-utils/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
"devDependencies": {
5151
"@types/react": "*",
5252
"@types/react-native": "*",
53-
"react": "17.0.2",
54-
"react-native": "0.67.5",
53+
"react": "18.2.0",
54+
"react-native": "0.74.3",
5555
"react-native-builder-bob": "^0.18.0",
5656
"typescript": "5.2.2"
5757
},

Diff for: patches/react-native+0.67.5.patch

-41
This file was deleted.

Diff for: sample/.buckconfig

-6
This file was deleted.

0 commit comments

Comments
 (0)