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

[react-native] Upgrade to 0.62.2 #8310

Merged
merged 22 commits into from May 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
6438ac4
[react-native-lab] Upgrade react-native submodule
sjchmiela May 14, 2020
f672330
[workspace] Upgrade react{,-native,-dom} to new versions
sjchmiela May 14, 2020
71ede33
[ios] Add required supportedEvents method override
sjchmiela May 14, 2020
439be21
[ios] Install pods
sjchmiela May 14, 2020
43d167c
[home] Publish dev home
sjchmiela May 14, 2020
526d1c3
[expo] Fix symbolicateStackTrace usage
sjchmiela May 14, 2020
1005ad3
[android] Upgrade React Native with `et update-rn`
sjchmiela May 15, 2020
b056240
[expoview] Update ExponentDevBundleDownloadListener to the new interf…
sjchmiela May 15, 2020
c1850d0
[android] Upgrade Gradle across the repository
sjchmiela May 15, 2020
0d8edd8
[android] Add swiperefreshlayout dependency as per facebook/react-nat…
sjchmiela May 15, 2020
9c0e571
[android] Add uiMode config change to Main and ExperienceActivities
sjchmiela May 15, 2020
21c3b5b
[android] Upgrade SoLoader across the project
sjchmiela May 15, 2020
41e0083
[versioned-react-native] Copy updated files to versioned-react-native
sjchmiela May 15, 2020
73abab2
[expotools] Version TurboModules' specs too
sjchmiela May 15, 2020
c701206
[android] Upgrade SoLoader to 0.8.2
sjchmiela May 15, 2020
6640c79
[expoview] As NetworkingModule is now a TurboModule, fetch it like one
sjchmiela May 15, 2020
dfa2af6
[tools] Do not version com.facebook.jni
sjchmiela May 19, 2020
9928af7
[repo] Remove custom resolution for @react-native-community/cli-platf…
sjchmiela May 19, 2020
875526b
[bare-expo] Install pods
sjchmiela May 19, 2020
75c652f
[expotools] Prepare versioning for SDK38
sjchmiela May 19, 2020
aa72d06
[expo] Update LogSerialization tests (0-indexed columns, new symbolic…
sjchmiela May 22, 2020
adc6747
[expo] Do not remove the SourceCode native module when preparing bare…
sjchmiela May 22, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion android/ReactAndroid/DevExperience.md
Expand Up @@ -8,7 +8,7 @@ Make sure you have the following installed:
- SDK build tools version 23
- Android Support Repository 17 (for Android Support Library)

Follow steps on https://github.com/facebook/react-native/blob/master/react-native-cli/CONTRIBUTING.md, but be sure to bump the version of react-native in package.json to some version > 0.9 (latest published npm version) or set up proxying properly for react-native
Follow steps on https://github.com/react-native-community/cli/blob/master/CONTRIBUTING.md, but be sure to bump the version of react-native in package.json to some version > 0.9 (latest published npm version) or set up proxying properly for react-native

- From the react-native-android repo:
- `./gradlew :ReactAndroid:installArchives`
Expand Down
65 changes: 50 additions & 15 deletions android/ReactAndroid/build.gradle
@@ -1,7 +1,9 @@
// Copyright (c) Facebook, Inc. and its affiliates.

// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

plugins {
id("com.android.library")
Expand Down Expand Up @@ -294,7 +296,8 @@ def getNdkBuildFullPath() {
}

def buildReactNdkLib = tasks.register("buildReactNdkLib", Exec) {
dependsOn(prepareJSC, prepareHermes, prepareBoost, prepareDoubleConversion, prepareFolly, prepareGlog)
dependsOn(prepareJSC, prepareHermes, prepareBoost, prepareDoubleConversion, prepareFolly, prepareGlog, extractAARHeaders, extractJNIFiles)

inputs.dir("$projectDir/../ReactCommon")
inputs.dir("src/main/jni")
inputs.dir("src/main/java/com/facebook/react/modules/blob")
Expand Down Expand Up @@ -342,6 +345,34 @@ def packageReactNdkLibsForBuck = tasks.register("packageReactNdkLibsForBuck", Co
into("src/main/jni/prebuilt/lib")
}

task extractAARHeaders {
doLast {
configurations.extractHeaders.files.each {
def file = it.absoluteFile
def packageName = file.name.tokenize('-')[0]
copy {
from zipTree(file)
into "$projectDir/src/main/jni/first-party/$packageName/headers"
include "**/*.h"
}
}
}
}

task extractJNIFiles {
doLast {
configurations.extractJNI.files.each {
def file = it.absoluteFile
def packageName = file.name.tokenize('-')[0]
copy {
from zipTree(file)
into "$projectDir/src/main/jni/first-party/$packageName/"
include "jni/**/*"
}
}
}
}

android {
compileSdkVersion 28

Expand Down Expand Up @@ -386,22 +417,30 @@ android {
}

tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn(packageReactNdkLibs)
compileTask ->
compileTask.dependsOn(packageReactNdkLibs)
}

clean.dependsOn(cleanReactNdkLib)

lintOptions {
abortOnError(false)
}

packagingOptions {
exclude("META-INF/NOTICE")
exclude("META-INF/LICENSE")
}

configurations {
extractHeaders
extractJNI
}
}

dependencies {
api("com.facebook.infer.annotation:infer-annotation:0.11.2")
api("com.facebook.yoga:proguard-annotations:1.14.1")
api("javax.inject:javax.inject:1")
api("androidx.appcompat:appcompat:1.0.2")
api("com.facebook.fresco:fresco:${FRESCO_VERSION}")
Expand All @@ -411,6 +450,9 @@ dependencies {
api("com.squareup.okhttp3:okhttp:${OKHTTP_VERSION}")
api("com.squareup.okhttp3:okhttp-urlconnection:${OKHTTP_VERSION}")
api("com.squareup.okio:okio:1.15.0")
api("com.facebook.fbjni:fbjni-java-only:0.0.3")
extractHeaders("com.facebook.fbjni:fbjni:0.0.2:headers")
extractJNI("com.facebook.fbjni:fbjni:0.0.2")

testImplementation("junit:junit:${JUNIT_VERSION}")
testImplementation("org.powermock:powermock-api-mockito:${POWERMOCK_VERSION}")
Expand All @@ -421,16 +463,9 @@ dependencies {
testImplementation("org.robolectric:robolectric:${ROBOLECTRIC_VERSION}")

androidTestImplementation(fileTree(dir: "src/main/third-party/java/buck-android-support/", include: ["*.jar"]))
//TODO: Refactor to extract versions of androidx dependencies
androidTestImplementation("androidx.test:runner:1.1.0")
androidTestImplementation("androidx.test:rules:1.1.0")
androidTestImplementation("androidx.test:runner:${ANDROIDX_TEST_VERSION}")
androidTestImplementation("androidx.test:rules:${ANDROIDX_TEST_VERSION}")
androidTestImplementation("org.mockito:mockito-core:${MOCKITO_CORE_VERSION}")

debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.yoga'
exclude group:'com.facebook.flipper', module: 'fbjni'
exclude group:'com.facebook.litho', module: 'litho-annotations'
}
}

apply(from: "release.gradle")
7 changes: 3 additions & 4 deletions android/ReactAndroid/gradle.properties
@@ -1,4 +1,4 @@
VERSION_NAME=0.61.4
VERSION_NAME=0.62.2
GROUP=com.facebook.react

POM_NAME=ReactNative
Expand All @@ -11,16 +11,15 @@ ROBOLECTRIC_VERSION=3.0
JUNIT_VERSION=4.12
FEST_ASSERT_CORE_VERSION=2.0M10

ANDROID_SUPPORT_TEST_VERSION=1.0.2
ANDROIDX_TEST_VERSION=1.1.0
FRESCO_VERSION=2.0.0
OKHTTP_VERSION=3.12.1
SO_LOADER_VERSION=0.6.0
SO_LOADER_VERSION=0.8.2

BOOST_VERSION=1_63_0
DOUBLE_CONVERSION_VERSION=1.1.6
FOLLY_VERSION=2018.10.22.00
GLOG_VERSION=0.3.5
FLIPPER_VERSION=0.23.4

android.useAndroidX=true
android.enableJetifier=true
Expand Down
7 changes: 5 additions & 2 deletions android/ReactAndroid/proguard-rules.pro
Expand Up @@ -25,22 +25,25 @@
-keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
-keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip
-keep,allowobfuscation @interface com.facebook.jni.annotations.DoNotStrip

# Do not strip any method/class that is annotated with @DoNotStrip
-keep @com.facebook.proguard.annotations.DoNotStrip class *
-keep @com.facebook.common.internal.DoNotStrip class *
-keep @com.facebook.jni.annotations.DoNotStrip class *
-keepclassmembers class * {
@com.facebook.proguard.annotations.DoNotStrip *;
@com.facebook.common.internal.DoNotStrip *;
@com.facebook.jni.annotations.DoNotStrip *;
}

-keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
void set*(***);
*** get*();
}

-keep class * extends com.facebook.react.bridge.JavaScriptModule { *; }
-keep class * extends com.facebook.react.bridge.NativeModule { *; }
-keep class * implements com.facebook.react.bridge.JavaScriptModule { *; }
-keep class * implements com.facebook.react.bridge.NativeModule { *; }
-keepclassmembers,includedescriptorclasses class * { native <methods>; }
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp <methods>; }
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; }
Expand Down
12 changes: 7 additions & 5 deletions android/ReactAndroid/release.gradle
@@ -1,7 +1,9 @@
// Copyright (c) Facebook, Inc. and its affiliates.

// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

apply(plugin: "maven")
apply(plugin: "signing")
Expand Down Expand Up @@ -102,7 +104,7 @@ afterEvaluate { project ->
archives(androidJavadocJar)
}

version = '37.0.0'
version = '38.0.0'
group = 'com.facebook.react'

signing {
Expand Down
@@ -0,0 +1,96 @@
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

package com.facebook.react.bridge;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;

import androidx.annotation.NonNull;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.runner.AndroidJUnit4;

import com.facebook.soloader.SoLoader;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

import static com.facebook.react.bridge.Arguments.fromBundle;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

@RunWith(AndroidJUnit4.class)
public class ArgumentsTest {

@Before
public void setUp() {
Context context = InstrumentationRegistry.getInstrumentation().getTargetContext();
SoLoader.init(context, false);
}

@Test
public void testFromBundle() {
verifyBundle(createBundle());
}

/**
* When passing a bundle via {@link Intent} extras, it gets parceled and unparceled.
* Any array of bundles will return as an array of {@link Parcelable} instead. This test
* verifies that {@link Arguments#fromArray} handles this situation correctly.
*/
@Test
public void testFromMarshaledBundle() {
verifyBundle(marshalAndUnmarshalBundle(createBundle()));
}

private void verifyBundle(@NonNull Bundle bundle) {
WritableMap map = fromBundle(bundle);
assertNotNull(map);

assertEquals(ReadableType.Array, map.getType("children"));
ReadableArray children = map.getArray("children");
assertNotNull(children);
assertEquals(1, children.size());

assertEquals(ReadableType.Map, children.getType(0));
ReadableMap child = children.getMap(0);
assertNotNull(child);
assertEquals("exampleChild", child.getString("exampleChildKey"));
}

@NonNull
private Bundle marshalAndUnmarshalBundle(@NonNull Bundle bundle) {
Parcel parcel = null;
try {
parcel = Parcel.obtain();
bundle.writeToParcel(parcel, 0);

byte[] bytes = parcel.marshall();
parcel.unmarshall(bytes, 0, bytes.length);
parcel.setDataPosition(0);
return Bundle.CREATOR.createFromParcel(parcel);
} finally {
if (parcel != null) {
parcel.recycle();
}
}
}

@NonNull
private Bundle createBundle() {
Bundle bundle = new Bundle();
Bundle[] children = new Bundle[1];
children[0] = new Bundle();
children[0].putString("exampleChildKey", "exampleChild");
bundle.putSerializable("children", children);
return bundle;
}
}
@@ -1,9 +1,10 @@
/**
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

package com.facebook.react.testing;

import com.facebook.react.bridge.BaseJavaModule;
Expand Down
@@ -1,9 +1,10 @@
/**
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

package com.facebook.react.testing;

import static junit.framework.Assert.assertFalse;
Expand Down
@@ -1,9 +1,10 @@
/**
* Copyright (c) 2014-present, Facebook, Inc.
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

package com.facebook.react.testing;

import com.facebook.react.bridge.JavaScriptContextHolder;
Expand Down
@@ -1,9 +1,10 @@
/**
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

package com.facebook.react.testing;

import com.facebook.react.bridge.Arguments;
Expand Down
@@ -1,9 +1,10 @@
/**
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

package com.facebook.react.testing;

import androidx.annotation.Nullable;
Expand Down
@@ -1,9 +1,10 @@
/**
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

package com.facebook.react.testing;

import com.facebook.react.ReactPackage;
Expand Down