Skip to content

Commit c4c36de

Browse files
[MOO-1762]: dependency update for new rn architecture (#236)
2 parents aefa2d4 + 4b73b98 commit c4c36de

40 files changed

+8730
-6159
lines changed

configs/e2e/native_dependencies.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
{
2-
"react-native-maps": "0.31.1",
2+
"react-native-maps": "1.14.0",
33
"react-native-geocoder": "0.5.0",
44
"react-native-device-info": "13.0.0",
55
"react-native-action-button": "2.8.5",
66
"react-native-material-menu": "1.2.0",
77
"react-native-linear-gradient": "2.5.6",
8-
"@react-native-community/netinfo": "5.9.7",
8+
"@react-native-community/netinfo": "11.4.1",
99
"react-native-svg": "15.7.1",
1010
"react-native-system-navigation-bar": "2.6.3",
1111
"react-native-video": "5.2.1",
1212
"@react-native-async-storage/async-storage": "2.0.0",
1313
"react-native-camera": "3.40.0",
14-
"react-native-view-shot": "3.1.2",
15-
"react-native-blob-util": "0.16.2",
14+
"react-native-view-shot": "4.0.3",
15+
"react-native-blob-util": "0.21.2",
1616
"react-native-file-viewer": "2.1.5",
1717
"react-native-localize": "3.2.1",
18-
"react-native-image-picker": "5.0.1",
18+
"react-native-image-picker": "7.2.3",
1919
"react-native-permissions": "4.1.5",
20-
"react-native-webview": "11.26.1"
20+
"react-native-webview": "13.13.2"
2121
}

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@
100100
"react-dom": "18.2.0",
101101
"react-native": "0.75.4",
102102
"@prettier/plugin-xml": "2.2.0",
103-
"@types/react-native": "0.73.0"
103+
"@types/react-native": "0.73.0",
104+
"cheerio": "1.0.0-rc.12"
104105
},
105106
"packageManager": "[email protected]"
106107
}

packages/jsActions/mobile-resources-native/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
- We migrated from react-native-inappbrowser-reborn to @swan-io/react-native-browser to prevent issues for next rn upgrade.
10+
11+
- We migrated from @react-native-community/cameraroll to @react-native-camera-roll/camera-roll to prevent issues for next rn upgrade.
12+
13+
- We also updated several dependencies such as react-native-blob-util, react-native-image-picker to their latest version.
14+
915
## [9.3.2] Native Mobile Resources - 2025-3-24
1016

1117
## [5.1.1] Maps

packages/jsActions/mobile-resources-native/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@
2626
"release:marketplace": "node ../../../scripts/release/marketplaceRelease.js"
2727
},
2828
"dependencies": {
29-
"@react-native-community/cameraroll": "4.0.1",
29+
"@react-native-camera-roll/camera-roll": "7.4.0",
3030
"@react-native-community/push-notification-ios": "1.10.1",
3131
"@react-native-firebase/messaging": "17.3.0",
32+
"@swan-io/react-native-browser": "^0.4.1",
3233
"fbjs": "3.0.4",
3334
"mime": "3.0.0",
34-
"react-native-blob-util": "0.16.2",
35+
"react-native-blob-util": "0.21.2",
3536
"react-native-device-info": "13.0.0",
3637
"react-native-file-viewer": "2.1.5",
37-
"react-native-image-picker": "5.0.1",
38-
"react-native-inappbrowser-reborn": "3.4.0",
38+
"react-native-image-picker": "7.2.3",
3939
"react-native-localize": "3.2.1",
4040
"react-native-permissions": "4.1.5",
4141
"react-native-push-notification": "8.1.1",

packages/jsActions/mobile-resources-native/src/camera/SaveToPictureLibrary.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// - the code between BEGIN USER CODE and END USER CODE
66
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
77
// Other code you write will be lost the next time you deploy the project.
8-
import { saveToCameraRoll } from "@react-native-community/cameraroll";
8+
import { CameraRoll } from "@react-native-camera-roll/camera-roll";
99

1010
// BEGIN EXTRA CODE
1111
// END EXTRA CODE
@@ -31,7 +31,13 @@ export async function SaveToPictureLibrary(picture?: mendix.lib.MxObject): Promi
3131
const changedDate = picture.get("changedDate") as number;
3232
const url = mx.data.getDocumentUrl(guid, changedDate);
3333

34-
return saveToCameraRoll(url);
34+
// Save the file as a photo to the camera roll.
35+
try {
36+
const savedUri = await CameraRoll.saveToCameraRoll(url, "auto");
37+
return Promise.resolve(savedUri.node.image.uri);
38+
} catch (error) {
39+
return Promise.reject(error);
40+
}
3541

3642
// END USER CODE
3743
}

packages/jsActions/mobile-resources-native/src/camera/TakePicture.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export async function TakePicture(
5656
}
5757

5858
// V3 dropped the feature of providing an action sheet so users can decide on which action to take, camera or library.
59-
const nativeVersionMajor = NativeModules.ImagePickerManager.showImagePicker ? 2 : 4;
59+
const nativeVersionMajor = NativeModules?.ImagePickerManager?.showImagePicker ? 2 : 4;
6060
const RNPermissions = nativeVersionMajor === 4 ? (await import("react-native-permissions")).default : null;
6161

6262
try {

packages/jsActions/mobile-resources-native/src/camera/TakePictureAdvanced.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export async function TakePictureAdvanced(
6262
}
6363

6464
// V3 dropped the feature of providing an action sheet so users can decide on which action to take, camera or library.
65-
const nativeVersionMajor = NativeModules.ImagePickerManager.showImagePicker ? 2 : 4;
65+
const nativeVersionMajor = NativeModules?.ImagePickerManager?.showImagePicker ? 2 : 4;
6666
const RNPermissions = nativeVersionMajor === 4 ? (await import("react-native-permissions")).default : null;
6767
const resultObject = await createMxObject("NativeMobileResources.ImageMetaData");
6868

packages/jsActions/mobile-resources-native/src/platform/OpenInAppBrowser.ts

+13-11
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// - the code between BEGIN USER CODE and END USER CODE
66
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
77
// Other code you write will be lost the next time you deploy the project.
8-
import InAppBrowser, { InAppBrowserOptions } from "react-native-inappbrowser-reborn";
8+
import { openBrowser } from "@swan-io/react-native-browser";
99

1010
// BEGIN EXTRA CODE
1111
// END EXTRA CODE
@@ -25,21 +25,23 @@ export async function OpenInAppBrowser(
2525
): Promise<void> {
2626
// BEGIN USER CODE
2727
// Documentation https://github.com/proyecto26/react-native-inappbrowser
28-
2928
if (!url) {
30-
return Promise.reject(new Error("Input parameter 'Url' is required"));
29+
return Promise.reject(new Error("Input parameter 'url' is required"));
3130
}
3231

33-
const options: InAppBrowserOptions = {
34-
toolbarColor,
35-
preferredBarTintColor: toolbarColor,
36-
dismissButtonStyle: iosDismissButtonStyle,
37-
showTitle: androidShowTitle
32+
const options = {
33+
barTintColor: toolbarColor, // iOS toolbar color
34+
controlTintColor: toolbarColor, // iOS control buttons color
35+
dismissButtonStyle: iosDismissButtonStyle, // iOS dismiss button style
36+
showTitle: androidShowTitle // Android show title
3837
};
3938

40-
await InAppBrowser.open(url, options);
41-
42-
return Promise.resolve();
39+
try {
40+
await openBrowser(url, options);
41+
return Promise.resolve();
42+
} catch (error) {
43+
return Promise.reject(error);
44+
}
4345

4446
// END USER CODE
4547
}

packages/jsActions/nanoflow-actions-native/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@
3636
"mendix": "~10.0.9976",
3737
"rollup": "^2.79.2"
3838
}
39-
}
39+
}

packages/pluggableWidgets/app-events-native/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
### Changed
10+
11+
- Updated @react-native-community/netinfo from version v5.9.7 to v11.4.1.
12+
913
## [4.1.0] - 2024-12-3
1014

1115
### Changed

packages/pluggableWidgets/app-events-native/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "app-events-native",
33
"widgetName": "AppEvents",
4-
"version": "4.1.0",
4+
"version": "5.0.0",
55
"license": "Apache-2.0",
66
"repository": {
77
"type": "git",
@@ -24,7 +24,7 @@
2424
},
2525
"dependencies": {
2626
"@mendix/piw-native-utils-internal": "*",
27-
"@react-native-community/netinfo": "5.9.7"
27+
"@react-native-community/netinfo": "11.4.1"
2828
},
2929
"devDependencies": {
3030
"@mendix/piw-utils-internal": "*",

packages/pluggableWidgets/app-events-native/src/AppEvents.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class AppEvents extends Component<Props> {
3333
}
3434

3535
if (this.props.onOnlineAction || this.props.onOfflineAction) {
36-
this.isConnected = (await NetInfo.fetch()).isConnected;
36+
this.isConnected = Boolean((await NetInfo.fetch()).isConnected);
3737
this.unsubscribeNetworkEventListener = NetInfo.addEventListener(this.onConnectionChangeHandler);
3838
}
3939

@@ -94,7 +94,7 @@ export class AppEvents extends Component<Props> {
9494
this.lastOnOffline = Date.now();
9595
}
9696

97-
this.isConnected = nextState.isConnected;
97+
this.isConnected = Boolean(nextState.isConnected);
9898
}
9999
}
100100

packages/pluggableWidgets/app-events-native/src/package.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<package xmlns="http://www.mendix.com/package/1.0/">
3-
<clientModule name="AppEvents" version="4.1.0" xmlns="http://www.mendix.com/clientModule/1.0/">
3+
<clientModule name="AppEvents" version="5.0.0" xmlns="http://www.mendix.com/clientModule/1.0/">
44
<widgetFiles>
55
<widgetFile path="AppEvents.xml" />
66
</widgetFiles>

packages/pluggableWidgets/bottom-sheet-native/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
### Changed
10+
11+
- Rewrote all bottomsheet widgets (customModalSheet, ExpandingDrawer, and NativeBottomSheet) using @gorhom/bottom-sheet.
12+
913
## [4.0.1] - 2025-2-7
1014

1115
### Changed

packages/pluggableWidgets/bottom-sheet-native/package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "bottom-sheet-native",
33
"widgetName": "BottomSheet",
4-
"version": "4.0.1",
4+
"version": "5.0.0",
55
"license": "Apache-2.0",
66
"repository": {
77
"type": "git",
@@ -19,13 +19,13 @@
1919
"version": "yarn release"
2020
},
2121
"dependencies": {
22+
"@gorhom/bottom-sheet": "5.1.1",
2223
"@mendix/piw-native-utils-internal": "*",
2324
"@mendix/piw-utils-internal": "*",
24-
"react-native-actionsheet": "^2.4.2",
25+
"@shopify/flash-list": "1.7.3",
2526
"react-native-device-info": "13.0.0",
26-
"react-native-modal": "^13.0.1",
27-
"react-native-reanimated": "^1.0.1",
28-
"reanimated-bottom-sheet": "^1.0.0-alpha.19"
27+
"react-native-gesture-handler": "2.24.0",
28+
"react-native-reanimated": "3.16.1"
2929
},
3030
"devDependencies": {
3131
"@mendix/pluggable-widgets-tools": "~10.0.1",

packages/pluggableWidgets/bottom-sheet-native/src/__tests__/BottomSheet.spec.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ jest.mock("react-native/Libraries/Utilities/Platform", () => ({
1515
select: jest.fn(dict => dict.ios)
1616
}));
1717

18-
jest.mock("react-native-reanimated", () => jest.requireActual("react-native-reanimated/mock"));
19-
2018
const defaultProps: BottomSheetProps<BottomSheetStyle> = {
2119
name: "bottom-sheet-test",
2220
style: [],

packages/pluggableWidgets/bottom-sheet-native/src/__tests__/__snapshots__/BottomSheet.spec.tsx.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,4 @@ exports[`Bottom sheet renders a expanding fullscreen with custom styles 1`] = `
103103
</View>
104104
`;
105105

106-
exports[`Bottom sheet renders a native bottom action sheet for ios (Basic modal) 1`] = `null`;
106+
exports[`Bottom sheet renders a native bottom action sheet for ios (Basic modal) 1`] = `<View />`;

0 commit comments

Comments
 (0)