Skip to content

Commit 4bbe059

Browse files
Merge pull request #1838 from flexn-io/feat/update_RN_0.76.5
Feat/update rn 0.76.5
2 parents c2dff4a + 6435f39 commit 4bbe059

File tree

91 files changed

+6701
-6424
lines changed

Some content is hidden

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

91 files changed

+6701
-6424
lines changed

.github/workflows/rnvUnitTest.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,23 @@ jobs:
88

99
strategy:
1010
matrix:
11-
node-version: [18.x]
11+
node-version: [20.x, 22.x]
1212

1313
steps:
1414
- uses: actions/checkout@master
15+
16+
- name: install system dependencies for canvas
17+
run: |
18+
sudo apt-get update
19+
sudo apt-get install -y \
20+
pkg-config \
21+
libcairo2-dev \
22+
libpango1.0-dev \
23+
libpng-dev \
24+
libjpeg-dev \
25+
libgif-dev \
26+
librsvg2-dev
27+
1528
- name: Use Node.js ${{ matrix.node-version }}
1629
uses: actions/setup-node@v3
1730
with:

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,12 @@
119119
"typescript-coverage-report": "0.8.0"
120120
},
121121
"engines": {
122-
"node": ">=18.0.0",
122+
"node": "20 || >=22",
123123
"npm": ">=9.0.0"
124124
},
125125
"private": true,
126126
"resolutions": {
127-
"@react-native-community/cli-platform-ios": "12.3.6"
127+
"@react-native-community/cli-platform-ios": "15.0.1"
128128
},
129129
"title": "ReNative",
130130
"husky": {

packages/app-harness/Gemfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ source 'https://rubygems.org'
33
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
44
ruby ">= 2.6.10"
55

6-
gem 'cocoapods', '~> 1.13', '< 1.15'
7-
gem 'activesupport', '~> 7.0', '<= 7.0.8'
8-
gem 'cocoapods-user-defined-build-types'
9-
6+
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
7+
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
8+
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
9+
gem 'xcodeproj', '< 1.26.0'
10+
gem 'cocoapods-user-defined-build-types'

packages/app-harness/Gemfile.lock

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,10 @@ PLATFORMS
9191
ruby
9292

9393
DEPENDENCIES
94-
activesupport (~> 7.0, <= 7.0.8)
95-
cocoapods (~> 1.13, < 1.15)
94+
activesupport (>= 6.1.7.5, != 7.1.0)
95+
cocoapods (>= 1.13, != 1.15.1, != 1.15.0)
9696
cocoapods-user-defined-build-types
97+
xcodeproj (< 1.26.0)
9798

9899
RUBY VERSION
99100
ruby 3.0.2p107

packages/app-harness/package.json

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
"build:ios-test": "npx rnv build -p ios -s test -c harness --packageManager yarn --ci -r",
2222
"build:macos-test": "npx rnv build -p macos -s test -c harness --packageManager yarn --ci -r",
2323
"build:tvos-test": "npx rnv build -p tvos -s test -c harness --packageManager yarn --ci -r",
24-
"e2e:android": "APPIUM_HOME=./ PLATFORM=android JAVA_HOME=$(/usr/libexec/java_home) wdio wdio.conf.cjs",
25-
"e2e:androidtv": "APPIUM_HOME=./ PLATFORM=androidtv JAVA_HOME=$(/usr/libexec/java_home) wdio wdio.conf.cjs",
26-
"e2e:ios": "APPIUM_HOME=./ PLATFORM=ios wdio wdio.conf.cjs",
27-
"e2e:macos": "PLATFORM=macos ENGINE=electron wdio wdio.conf.cjs",
28-
"e2e:tvos": "APPIUM_HOME=./ PLATFORM=tvos wdio wdio.conf.cjs",
29-
"e2e:web": "PLATFORM=web wdio wdio.conf.cjs",
24+
"e2e:android": "APPIUM_HOME=./ PLATFORM=android JAVA_HOME=$(/usr/libexec/java_home) wdio wdio.conf.js",
25+
"e2e:androidtv": "APPIUM_HOME=./ PLATFORM=androidtv JAVA_HOME=$(/usr/libexec/java_home) wdio wdio.conf.js",
26+
"e2e:ios": "APPIUM_HOME=./ PLATFORM=ios wdio wdio.conf.js",
27+
"e2e:macos": "PLATFORM=macos ENGINE=electron wdio wdio.conf.js",
28+
"e2e:tvos": "APPIUM_HOME=./ PLATFORM=tvos wdio wdio.conf.js",
29+
"e2e:web": "PLATFORM=web wdio wdio.conf.js",
3030
"report": "yarn report:generate && yarn report:open",
3131
"report:generate": "npx allure generate --clean reporting/allure-results -o reporting/allure-report",
3232
"report:open": "npx allure open reporting/allure-report",
@@ -42,6 +42,7 @@
4242
"dependencies": {
4343
"@lightningjs/cli": "2.13.0",
4444
"@lightningjs/sdk": "5.5.1",
45+
"@react-native-community/cli": "15.0.1",
4546
"@react-native-community/push-notification-ios": "1.11.0",
4647
"@react-native-firebase/app": "20.0.0",
4748
"@rnv/renative": "1.10.0-rc.0",
@@ -51,17 +52,17 @@
5152
"react": "18.3.1",
5253
"react-art": "18.3.1",
5354
"react-dom": "18.3.1",
54-
"react-native": "0.73.4",
55+
"react-native": "0.76.5",
5556
"react-native-carplay": "2.3.0",
5657
"react-native-fs": "2.20.0",
57-
"react-native-gesture-handler": "2.16.2",
58-
"react-native-google-cast": "4.8.0",
58+
"react-native-gesture-handler": "2.21.2",
59+
"react-native-google-cast": "4.8.3",
5960
"react-native-orientation-locker": "1.7.0",
60-
"react-native-permissions": "4.1.5",
61+
"react-native-permissions": "5.2.1",
6162
"react-native-photo-editor": "github:AppGyver/react-native-photo-editor#v0.1.2",
62-
"react-native-safe-area-context": "4.10.3",
63+
"react-native-safe-area-context": "5.0.0",
6364
"react-native-splash-screen": "3.3.0",
64-
"react-native-tvos": "0.73.6-0",
65+
"react-native-tvos": "0.76.5-0",
6566
"react-native-web": "0.19.12",
6667
"rn-fetch-blob": "0.12.0"
6768
},

packages/app-harness/renative.json

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
}
8989
},
9090
"android": {
91+
"enableJetifier": true,
9192
"templateAndroid": {
9293
"build_gradle": {
9394
"buildscript": {
@@ -163,38 +164,7 @@
163164
}
164165
},
165166
"react-native-photo-editor": {
166-
"android": {
167-
"templateAndroid": {
168-
"AndroidManifest_xml": {
169-
"tag": "manifest",
170-
"children": [
171-
{
172-
"tag": "uses-permission ",
173-
"android:name": "android.permission.WRITE_EXTERNAL_STORAGE",
174-
"children": []
175-
},
176-
{
177-
"tag": "application",
178-
"android:name": ".MainApplication",
179-
"children": [
180-
{
181-
"tag": "activity",
182-
"android:name": "com.ahmedadeltito.photoeditor.PhotoEditorActivity",
183-
"children": []
184-
}
185-
]
186-
}
187-
]
188-
}
189-
},
190-
"package": "ui.photoeditor.RNPhotoEditorPackage"
191-
},
192-
"androidtv": {
193-
"package": "ui.photoeditor.RNPhotoEditorPackage"
194-
},
195-
"firetv": {
196-
"package": "ui.photoeditor.RNPhotoEditorPackage"
197-
},
167+
"supportedPlatforms": ["ios"],
198168
"ios": {
199169
"podName": "iOSPhotoEditor",
200170
"git": "https://github.com/prscX/photo-editor",
@@ -217,9 +187,6 @@
217187
}
218188
}
219189
},
220-
"tvos": {
221-
"disabled": true
222-
},
223190
"pluginDependencies": null,
224191
"version": "github:AppGyver/react-native-photo-editor#v0.1.2"
225192
},

packages/app-harness/src/app/index.tsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ const App = () => (
5454
);
5555

5656
const AppContent = () => {
57-
const orientationBtnRef = useRef<TouchableOpacity>(null);
58-
const permissionBtnRef = useRef<TouchableOpacity>(null);
59-
const splashBtnRef = useRef<TouchableOpacity>(null);
60-
const photoEditorBtnRef = useRef<TouchableOpacity>(null);
61-
const nativeModuleBtnRef = useRef<TouchableOpacity>(null);
57+
const orientationBtnRef = useRef<React.ElementRef<typeof TouchableOpacity>>(null);
58+
const permissionBtnRef = useRef<React.ElementRef<typeof TouchableOpacity>>(null);
59+
const splashBtnRef = useRef<React.ElementRef<typeof TouchableOpacity>>(null);
60+
const photoEditorBtnRef = useRef<React.ElementRef<typeof TouchableOpacity>>(null);
61+
const nativeModuleBtnRef = useRef<React.ElementRef<typeof TouchableOpacity>>(null);
6262
const [showVideo, setShowVideo] = useState(false);
6363
const [logsFocused, setLogsFocused] = useState(false);
6464
const { logDebug, logs } = useLoggerContext();
@@ -72,10 +72,7 @@ const AppContent = () => {
7272
if (isWebBased && isFactorTv && focusableRefs[0]?.current) {
7373
focusableRefs[0].current.focus();
7474
setFocusedIndex(0);
75-
} else if (!isWebBased) {
76-
// Set the initial AndroidTV and tvOS focus to be on the button
77-
focusableRefs[0]?.current?.setNativeProps({ hasTVPreferredFocus: true });
78-
}
75+
}
7976
return () => {
8077
removeNotificationListeners(handleNotification);
8178
};
@@ -161,6 +158,7 @@ const AppContent = () => {
161158
focusedIndex === 0 && styles.buttonFocused,
162159
isWebBased && isFactorTv && { outline: 'none' },
163160
]}
161+
hasTVPreferredFocus={!isWebBased && isFactorTv}
164162
/>
165163
</TestCase>
166164
<TestCase id={3} title="Orientation support ">

packages/app-harness/src/components/NewModuleButton/index.native.tsx

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,30 @@ import styles from '../../styles';
55
import { testProps } from '../../config';
66

77
type ButtonProps = TouchableOpacityProps;
8-
export const NewModuleButton = forwardRef<TouchableOpacity, ButtonProps>(({ onBlur, onFocus, style }, ref) => {
9-
const { TestNativeModule } = NativeModules;
10-
const { logDebug } = useLoggerContext();
11-
const callback = (error: any, result: string) => {
12-
if (error) {
13-
logDebug(error);
14-
} else {
15-
logDebug(result);
16-
}
17-
};
18-
const onPress = () => {
19-
if (TestNativeModule) {
20-
TestNativeModule.createTestEvent('testName', 'testLocation', callback);
21-
} else {
22-
logDebug('NativeModules not supported for this platform');
23-
}
24-
};
25-
return (
26-
<TouchableOpacity ref={ref} onPress={onPress} onFocus={onFocus} onBlur={onBlur} style={style}>
27-
<Text style={styles.buttonTitle} {...testProps('app-harness-home-native-call-button')}>
28-
Click to invoke native module!
29-
</Text>
30-
</TouchableOpacity>
31-
);
32-
});
8+
export const NewModuleButton = forwardRef<React.ElementRef<typeof TouchableOpacity>, ButtonProps>(
9+
({ onBlur, onFocus, style,hasTVPreferredFocus }, ref) => {
10+
const { TestNativeModule } = NativeModules;
11+
const { logDebug } = useLoggerContext();
12+
const callback = (error: any, result: string) => {
13+
if (error) {
14+
logDebug(error);
15+
} else {
16+
logDebug(result);
17+
}
18+
};
19+
const onPress = () => {
20+
if (TestNativeModule) {
21+
TestNativeModule.createTestEvent('testName', 'testLocation', callback);
22+
} else {
23+
logDebug('NativeModules not supported for this platform');
24+
}
25+
};
26+
return (
27+
<TouchableOpacity ref={ref} onPress={onPress} onFocus={onFocus} onBlur={onBlur} style={style} hasTVPreferredFocus={hasTVPreferredFocus}>
28+
<Text style={styles.buttonTitle} {...testProps('app-harness-home-native-call-button')}>
29+
Click to invoke native module!
30+
</Text>
31+
</TouchableOpacity>
32+
);
33+
}
34+
);

packages/app-harness/src/components/NewModuleButton/index.tsx

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@ import styles from '../../styles';
55
import { testProps } from '../../config';
66

77
type ButtonProps = TouchableOpacityProps;
8-
export const NewModuleButton = forwardRef<TouchableOpacity, ButtonProps>(({ onBlur, onFocus, style }, ref) => {
9-
const { logDebug } = useLoggerContext();
10-
const onPress = () => {
11-
logDebug('NativeModules not supported in web');
12-
};
13-
return (
14-
<TouchableOpacity ref={ref} onPress={onPress} onFocus={onFocus} onBlur={onBlur} style={style}>
15-
<Text style={styles.buttonTitle} {...testProps('app-harness-home-native-call-button')}>
16-
Click to invoke native module!
17-
</Text>
18-
</TouchableOpacity>
19-
);
20-
});
8+
export const NewModuleButton = forwardRef<React.ElementRef<typeof TouchableOpacity>, ButtonProps>(
9+
({ onBlur, onFocus, style }, ref) => {
10+
const { logDebug } = useLoggerContext();
11+
const onPress = () => {
12+
logDebug('NativeModules not supported in web');
13+
};
14+
return (
15+
<TouchableOpacity ref={ref} onPress={onPress} onFocus={onFocus} onBlur={onBlur} style={style}>
16+
<Text style={styles.buttonTitle} {...testProps('app-harness-home-native-call-button')}>
17+
Click to invoke native module!
18+
</Text>
19+
</TouchableOpacity>
20+
);
21+
}
22+
);
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import React, { forwardRef, useEffect } from 'react';
2+
import { Text, Image, TouchableOpacity, TouchableOpacityProps } from 'react-native';
3+
import { RNPhotoEditor } from 'react-native-photo-editor';
4+
import RNFS from 'react-native-fs';
5+
import RNFetchBlob from 'rn-fetch-blob';
6+
import { useLoggerContext } from '../../context';
7+
import { ICON_LOGO } from '../../config';
8+
import styles from '../../styles';
9+
10+
type ButtonProps = TouchableOpacityProps;
11+
export const PhotoEditorButton = forwardRef<React.ElementRef<typeof TouchableOpacity>, ButtonProps>(
12+
({ onBlur, onFocus, style }, ref) => {
13+
const { logDebug } = useLoggerContext();
14+
const photoPath = RNFS.DocumentDirectoryPath + ICON_LOGO;
15+
useEffect(() => {
16+
const fetchAndMovePhoto = async () => {
17+
const binaryFile = Image.resolveAssetSource(ICON_LOGO);
18+
try {
19+
const resp = await RNFetchBlob.config({ fileCache: true }).fetch('GET', binaryFile.uri);
20+
if (await RNFS.exists(photoPath)) {
21+
await RNFS.unlink(photoPath);
22+
}
23+
await RNFS.moveFile(resp.path(), photoPath);
24+
logDebug('FILE WRITTEN!');
25+
} catch (error) {
26+
logDebug(`${error}`);
27+
}
28+
};
29+
fetchAndMovePhoto();
30+
}, []);
31+
const handlePhotoEditor = () => {
32+
RNPhotoEditor.Edit({
33+
path: photoPath,
34+
onDone: () => {
35+
logDebug('on done');
36+
},
37+
onCancel: () => {
38+
logDebug('on cancel');
39+
},
40+
});
41+
};
42+
return (
43+
<TouchableOpacity ref={ref} onPress={handlePhotoEditor} onFocus={onFocus} onBlur={onBlur} style={style}>
44+
<Text style={styles.buttonTitle}>Show PhotoEditor</Text>
45+
</TouchableOpacity>
46+
);
47+
}
48+
);

0 commit comments

Comments
 (0)