Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RNMobile] Upgrade compile and target sdk version to Android API 33 #50731

Merged
merged 14 commits into from
May 31, 2023
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
313 changes: 189 additions & 124 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions packages/react-native-aztec/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ buildscript {
jSoupVersion = '1.10.3'
wordpressUtilsVersion = '3.3.0'
espressoVersion = '3.0.1'
aztecVersion = 'v1.6.3'
aztecVersion = 'v1.6.4'
}
}

Expand All @@ -34,11 +34,11 @@ List<String> dirs = [
'template'] // boilerplate code that is generated by the sample template process

android {
compileSdkVersion 31
compileSdkVersion 33

defaultConfig {
minSdkVersion 24
targetSdkVersion 31
targetSdkVersion 33
}

compileOptions {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-aztec/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pluginManagement {
gradle.ext.kotlinVersion = '1.5.32'
gradle.ext.kotlinVersion = '1.6.10'

plugins {
id "com.android.library" version "7.2.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ group='org.wordpress-mobile.gutenberg-mobile'
def buildAssetsFolder = 'build/assets'

android {
compileSdkVersion 31
compileSdkVersion 33

defaultConfig {
minSdkVersion 24
targetSdkVersion 31
targetSdkVersion 33
buildConfigField "boolean", "SHOULD_ATTACH_JS_BUNDLE", willPublishReactNativeBridgeBinary.toString()
}

Expand Down Expand Up @@ -82,7 +82,7 @@ dependencies {

// Published by `wordpress-mobile/react-native-libraries-publisher`
// See the documentation for this value in `build.gradle.kts` of `wordpress-mobile/react-native-libraries-publisher`
def reactNativeLibrariesPublisherVersion = "v1"
def reactNativeLibrariesPublisherVersion = "v2"
def reactNativeLibrariesGroupId = "org.wordpress-mobile.react-native-libraries.$reactNativeLibrariesPublisherVersion"
implementation "$reactNativeLibrariesGroupId:react-native-get-random-values:${extractPackageVersion(packageJson, 'react-native-get-random-values', 'dependencies')}"
implementation "$reactNativeLibrariesGroupId:react-native-safe-area-context:${extractPackageVersion(packageJson, 'react-native-safe-area-context', 'dependencies')}"
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-bridge/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pluginManagement {
gradle.ext.kotlinVersion = '1.5.32'
gradle.ext.kotlinVersion = '1.6.10'

plugins {
id "com.android.library" version "7.2.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-editor/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ dependencies {

// Published by `wordpress-mobile/react-native-libraries-publisher`
// See the documentation for this value in `build.gradle.kts` of `wordpress-mobile/react-native-libraries-publisher`
def reactNativeLibrariesPublisherVersion = "v1"
def reactNativeLibrariesPublisherVersion = "v2"
def reactNativeLibrariesGroupId = "org.wordpress-mobile.react-native-libraries.$reactNativeLibrariesPublisherVersion"
implementation "$reactNativeLibrariesGroupId:react-native-get-random-values:${extractPackageVersion(packageJson, 'react-native-get-random-values', 'dependencies')}"
implementation "$reactNativeLibrariesGroupId:react-native-safe-area-context:${extractPackageVersion(packageJson, 'react-native-safe-area-context', 'dependencies')}"
Expand Down
8 changes: 4 additions & 4 deletions packages/react-native-editor/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import org.apache.tools.ant.taskdefs.condition.Os
buildscript {
ext {
gradlePluginVersion = '7.2.1'
kotlinVersion = '1.5.32'
buildToolsVersion = "31.0.0"
kotlinVersion = '1.6.10'
buildToolsVersion = "33.0.0"
minSdkVersion = 24
compileSdkVersion = 31
targetSdkVersion = 31
compileSdkVersion = 33
targetSdkVersion = 33
supportLibVersion = '28.0.0'
gradleDownloadTask = '5.0.1'

Expand Down
32 changes: 16 additions & 16 deletions packages/react-native-editor/ios/Podfile.lock
fluiddot marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PODS:
- boost (1.76.0)
- BVLinearGradient (2.5.6-wp-3):
- BVLinearGradient (2.5.6-wp-4):
- React-Core
- DoubleConversion (1.1.6)
- FBLazyVector (0.69.4)
Expand Down Expand Up @@ -246,12 +246,12 @@ PODS:
- React-Core
- react-native-slider (3.0.2-wp-3):
- React-Core
- react-native-video (5.2.0-wp-5):
- react-native-video (5.2.0-wp-6):
- React-Core
- react-native-video/Video (= 5.2.0-wp-5)
- react-native-video/Video (5.2.0-wp-5):
- react-native-video/Video (= 5.2.0-wp-6)
- react-native-video/Video (5.2.0-wp-6):
- React-Core
- react-native-webview (11.6.2):
- react-native-webview (11.26.1):
- React-Core
- React-perflogger (0.69.4)
- React-RCTActionSheet (0.69.4):
Expand Down Expand Up @@ -327,9 +327,9 @@ PODS:
- React-Core
- SDWebImage (~> 5.11.1)
- SDWebImageWebPCoder (~> 0.8.4)
- RNGestureHandler (2.3.2-wp-2):
- RNGestureHandler (2.3.2-wp-3):
- React-Core
- RNReanimated (2.9.1-wp-3):
- RNReanimated (2.9.1-wp-4):
- DoubleConversion
- FBLazyVector
- FBReactNativeSpec
Expand Down Expand Up @@ -534,7 +534,7 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
boost: a7c83b31436843459a1961bfd74b96033dc77234
BVLinearGradient: ace34fab72158c068ae989a0ebdbf86cb4ef0e49
BVLinearGradient: f9b5ebce56b36e3e20a433aa271d6dce2c10b06a
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
FBLazyVector: c71b8c429a8af2aff1013934a7152e9d9d0c937d
FBReactNativeSpec: 2ff441cbe6e58c1778d8a5cf3311831a6a8c0809
Expand All @@ -556,13 +556,13 @@ SPEC CHECKSUMS:
React-jsiexecutor: a27badbbdbc0ff781813370736a2d1c7261181d4
React-jsinspector: 8a3d3f5dcd23a91e8c80b1bf0e96902cd1dca999
React-logger: 1088859f145b8f6dd0d3ed051a647ef0e3e80fad
react-native-blur: 3e9c8e8e9f7d17fa1b94e1a0ae9fd816675f5382
react-native-blur: 8cd9b4a8007166ad643f4dff914c3fddd2ff5b9a
react-native-get-random-values: b6fb85e7169b9822976793e467458c151c3e8b69
react-native-safe-area: c9cf765aa2dd96159476a99633e7d462ce5bb94f
react-native-safe-area-context: f0906bf8bc9835ac9a9d3f97e8bde2a997d8da79
react-native-safe-area-context: e471852c5ed67eea4b10c5d9d43c1cebae3b231d
react-native-slider: a433f1c13c5da3c17a587351bff7371f65cc9a07
react-native-video: cc1982bfac4d256fb56302642d968b6e72ffbeb7
react-native-webview: 193d233c29eacce1f42ca2637dab7ba79c25a6de
react-native-video: afb806880af4f6612683ab678a793ae41bc39705
react-native-webview: e3b659a6d614bb37fb12a2de82c91a378c59d84b
React-perflogger: cb386fd44c97ec7f8199c04c12b22066b0f2e1e0
React-RCTActionSheet: f803a85e46cf5b4066c2ac5e122447f918e9c6e5
React-RCTAnimation: 19c80fa950ccce7f4db76a2a7f2cf79baae07fc7
Expand All @@ -575,11 +575,11 @@ SPEC CHECKSUMS:
React-RCTVibration: 9adb4a3cbb598d1bbd46a05256f445e4b8c70603
React-runtimeexecutor: 61ee22a8cdf8b6bb2a7fb7b4ba2cc763e5285196
ReactCommon: 8f67bd7e0a6afade0f20718f859dc8c2275f2e83
RNCClipboard: 99fc8ad669a376b756fbc8098ae2fd05c0ed0668
RNCMaskedView: c298b644a10c0c142055b3ae24d83879ecb13ccd
RNCClipboard: f49f3de56b40d0f4104680dabadc7a1f063f4fd4
RNCMaskedView: d367b2a8df3992114e31b32b091a0c00dc800827
RNFastImage: 1f2cab428712a4baaf78d6169eaec7f622556dd7
RNGestureHandler: 3e0ea0c115175e66680032904339696bab928ca3
RNReanimated: bea6acb5fdcbd8ca27641180579d09e3434f803c
RNGestureHandler: f5c389f7c9947057ee47d16ca1d7d170289b2c2a
RNReanimated: 5740ec9926f80bccd404bacd3e71108e87c94afa
RNScreens: 953633729a42e23ad0c93574d676b361e3335e8b
RNSVG: 36a7359c428dcb7c6bce1cc546fbfebe069809b0
RNTAztecView: 61e0a2f69770f30e01f21991c79861be70a8d8bc
Expand Down
16 changes: 8 additions & 8 deletions packages/react-native-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@babel/runtime": "^7.16.0",
"@react-native-clipboard/clipboard": "1.9.0",
"@react-native-community/blur": "4.2.0",
"@react-native-community/slider": "https://raw.githubusercontent.com/wordpress-mobile/react-native-slider/v3.0.2-wp-3/react-native-community-slider-3.0.2-wp-3.tgz",
"@react-native-community/slider": "https://raw.githubusercontent.com/wordpress-mobile/react-native-slider/v3.0.2-wp-4/react-native-community-slider-3.0.2-wp-4.tgz",
"@react-native-masked-view/masked-view": "0.2.6",
"@react-navigation/core": "5.12.0",
"@react-navigation/native": "5.7.0",
Expand All @@ -58,22 +58,22 @@
"node-fetch": "^2.6.0",
"react-native": "0.69.4",
"react-native-fast-image": "8.5.11",
"react-native-gesture-handler": "https://raw.githubusercontent.com/wordpress-mobile/react-native-gesture-handler/2.3.2-wp-2/react-native-gesture-handler-2.3.2-wp-2.tgz",
"react-native-gesture-handler": "https://raw.githubusercontent.com/wordpress-mobile/react-native-gesture-handler/2.3.2-wp-3/react-native-gesture-handler-2.3.2-wp-3.tgz",
"react-native-get-random-values": "1.4.0",
"react-native-hr": "https://raw.githubusercontent.com/wordpress-mobile/react-native-hr/1.1.3-wp-1/react-native-hr-1.1.3.tgz",
"react-native-hsv-color-picker": "https://raw.githubusercontent.com/wordpress-mobile/react-native-hsv-color-picker/v1.0.1-wp-3/react-native-hsv-color-picker-1.0.1-wp-3.tgz",
"react-native-linear-gradient": "https://raw.githubusercontent.com/wordpress-mobile/react-native-linear-gradient/v2.5.6-wp-3/react-native-linear-gradient-2.5.6-wp-3.tgz",
"react-native-hsv-color-picker": "https://raw.githubusercontent.com/wordpress-mobile/react-native-hsv-color-picker/v1.0.1-wp-4/react-native-hsv-color-picker-1.0.1-wp-4.tgz",
"react-native-linear-gradient": "https://raw.githubusercontent.com/wordpress-mobile/react-native-linear-gradient/v2.5.6-wp-4/react-native-linear-gradient-2.5.6-wp-4.tgz",
"react-native-modal": "^11.10.0",
"react-native-prompt-android": "https://raw.githubusercontent.com/wordpress-mobile/react-native-prompt-android/v1.0.0-wp-3/react-native-prompt-android-1.0.0-wp-3.tgz",
"react-native-reanimated": "https://raw.githubusercontent.com/wordpress-mobile/react-native-reanimated/2.9.1-wp-3/react-native-reanimated-2.9.1-wp-3.tgz",
"react-native-prompt-android": "https://raw.githubusercontent.com/wordpress-mobile/react-native-prompt-android/v1.0.0-wp-4/react-native-prompt-android-1.0.0-wp-4.tgz",
"react-native-reanimated": "https://raw.githubusercontent.com/wordpress-mobile/react-native-reanimated/2.9.1-wp-4/react-native-reanimated-2.9.1-wp-4.tgz",
"react-native-safe-area": "^0.5.0",
"react-native-safe-area-context": "3.2.0",
"react-native-sass-transformer": "^1.1.1",
"react-native-screens": "2.9.0",
"react-native-svg": "9.13.6",
"react-native-url-polyfill": "^1.1.2",
"react-native-video": "https://raw.githubusercontent.com/wordpress-mobile/react-native-video/5.2.0-wp-5/react-native-video-5.2.0-wp-5.tgz",
"react-native-webview": "11.6.2"
"react-native-video": "https://raw.githubusercontent.com/wordpress-mobile/react-native-video/5.2.0-wp-6/react-native-video-5.2.0-wp-6.tgz",
"react-native-webview": "11.26.1"
},
"publishConfig": {
"access": "public"
Expand Down
49 changes: 31 additions & 18 deletions test/native/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import 'react-native-gesture-handler/jestSetup';
import { Image, NativeModules as RNNativeModules } from 'react-native';
import { Image } from 'react-native';

// React Native sets up a global navigator, but that is not executed in the
// testing environment: https://github.com/facebook/react-native/blob/6c19dc3266b84f47a076b647a1c93b3c3b69d2c5/Libraries/Core/setUpNavigator.js#L17
Expand All @@ -19,24 +19,37 @@ global.ReanimatedDataMock = {
now: () => 0,
};

RNNativeModules.UIManager = RNNativeModules.UIManager || {};
RNNativeModules.UIManager.RCTView = RNNativeModules.UIManager.RCTView || {};
RNNativeModules.RNGestureHandlerModule =
RNNativeModules.RNGestureHandlerModule || {
State: {
BEGAN: 'BEGAN',
FAILED: 'FAILED',
ACTIVE: 'ACTIVE',
END: 'END',
},
attachGestureHandler: jest.fn(),
createGestureHandler: jest.fn(),
dropGestureHandler: jest.fn(),
updateGestureHandler: jest.fn(),
jest.mock( 'react-native', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed when mocking the WebView native module that in some tests the mock was restored, leading to failures.
Mocking the native modules this way should prevent this issue.

const ReactNative = jest.requireActual( 'react-native' );
const RNNativeModules = ReactNative.NativeModules;

// Mock React Native modules
RNNativeModules.UIManager = RNNativeModules.UIManager || {};
RNNativeModules.UIManager.RCTView = RNNativeModules.UIManager.RCTView || {};
RNNativeModules.RNGestureHandlerModule =
RNNativeModules.RNGestureHandlerModule || {
State: {
BEGAN: 'BEGAN',
FAILED: 'FAILED',
ACTIVE: 'ACTIVE',
END: 'END',
},
attachGestureHandler: jest.fn(),
createGestureHandler: jest.fn(),
dropGestureHandler: jest.fn(),
updateGestureHandler: jest.fn(),
};
RNNativeModules.PlatformConstants = RNNativeModules.PlatformConstants || {
forceTouchAvailable: false,
};
RNNativeModules.PlatformConstants = RNNativeModules.PlatformConstants || {
forceTouchAvailable: false,
};

// Mock WebView native module from `react-native-webview`
RNNativeModules.RNCWebView = {
isFileUploadSupported: jest.fn(),
};

return ReactNative;
} );

// Mock component to render with props rather than merely a string name so that
// we may assert against it. ...args is used avoid warnings about ignoring
Expand Down