Skip to content

Commit cfdc6a2

Browse files
friederbluemleaksonov
authored andcommitted
Update react-native to 0.60.5 (#3544)
1 parent d144db3 commit cfdc6a2

File tree

34 files changed

+2831
-2795
lines changed

34 files changed

+2831
-2795
lines changed

examples/react-native/.eslintrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
root: true,
3+
extends: '@react-native-community',
4+
};

examples/react-native/.flowconfig

Lines changed: 44 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,20 @@
1111
; Ignore duplicate module providers
1212
; For RN Apps installed via npm, "Libraries" folder is inside
1313
; "node_modules/react-native" but in the source repo it is in the root
14-
.*/Libraries/react-native/React.js
14+
node_modules/react-native/Libraries/react-native/React.js
1515

1616
; Ignore polyfills
17-
.*/Libraries/polyfills/.*
17+
node_modules/react-native/Libraries/polyfills/.*
1818

19-
; Ignore metro
20-
.*/node_modules/metro/.*
19+
; These should not be required directly
20+
; require from fbjs/lib instead: require('fbjs/lib/warning')
21+
node_modules/warning/.*
22+
23+
; Flow doesn't support platforms
24+
.*/Libraries/Utilities/HMRLoadingView.js
25+
26+
[untyped]
27+
.*/node_modules/@react-native-community/cli/.*/.*
2128

2229
[include]
2330

@@ -31,6 +38,10 @@ emoji=true
3138
esproposal.optional_chaining=enable
3239
esproposal.nullish_coalescing=enable
3340

41+
module.file_ext=.js
42+
module.file_ext=.json
43+
module.file_ext=.ios.js
44+
3445
module.system=haste
3546
module.system.haste.use_name_reducers=true
3647
# get basename
@@ -43,27 +54,46 @@ module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
4354
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
4455
module.system.haste.paths.blacklist=.*/__tests__/.*
4556
module.system.haste.paths.blacklist=.*/__mocks__/.*
46-
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
4757
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
58+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/RNTester/.*
59+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/IntegrationTests/.*
60+
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/react-native/react-native-implementation.js
61+
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
4862

4963
munge_underscores=true
5064

5165
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
5266

53-
module.file_ext=.js
54-
module.file_ext=.jsx
55-
module.file_ext=.json
56-
module.file_ext=.native.js
57-
5867
suppress_type=$FlowIssue
5968
suppress_type=$FlowFixMe
6069
suppress_type=$FlowFixMeProps
6170
suppress_type=$FlowFixMeState
6271

63-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
64-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
65-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
72+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
73+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
6674
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
6775

76+
[lints]
77+
sketchy-null-number=warn
78+
sketchy-null-mixed=warn
79+
sketchy-number=warn
80+
untyped-type-import=warn
81+
nonstrict-import=warn
82+
deprecated-type=warn
83+
unsafe-getters-setters=warn
84+
inexact-spread=warn
85+
unnecessary-invariant=warn
86+
signature-verification-failure=warn
87+
deprecated-utility=error
88+
89+
[strict]
90+
deprecated-type
91+
nonstrict-import
92+
sketchy-null
93+
unclear-type
94+
unsafe-getters-setters
95+
untyped-import
96+
untyped-type-import
97+
6898
[version]
69-
^0.92.0
99+
^0.98.0

examples/react-native/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ yarn-error.log
4040
buck-out/
4141
\.buckd/
4242
*.keystore
43+
!debug.keystore
4344

4445
# fastlane
4546
#
@@ -54,3 +55,6 @@ buck-out/
5455

5556
# Bundle artifact
5657
*.jsbundle
58+
59+
# CocoaPods
60+
/ios/Pods/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
bracketSpacing: false,
3+
jsxBracketSameLine: true,
4+
singleQuote: true,
5+
trailingComma: 'all',
6+
};
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{}
1+
{}

examples/react-native/__tests__/App-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import 'react-native';
66
import React from 'react';
7-
import App from '../App';
7+
// import App from '../App';
88

99
// Note: test renderer must be required after react-native.
1010
import renderer from 'react-test-renderer';

examples/react-native/android/.project

Lines changed: 0 additions & 17 deletions
This file was deleted.

examples/react-native/android/app/build.gradle

Lines changed: 63 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ import com.android.build.OutputFile
1818
* // the entry file for bundle generation
1919
* entryFile: "index.android.js",
2020
*
21+
* // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format
22+
* bundleCommand: "ram-bundle",
23+
*
2124
* // whether to bundle JS and assets in debug mode
2225
* bundleInDebug: false,
2326
*
@@ -73,7 +76,8 @@ import com.android.build.OutputFile
7376
*/
7477

7578
project.ext.react = [
76-
entryFile: "index.js"
79+
entryFile: "index.js",
80+
enableHermes: false, // clean and rebuild if changing
7781
]
7882

7983
apply from: "../../node_modules/react-native/react.gradle"
@@ -93,6 +97,28 @@ def enableSeparateBuildPerCPUArchitecture = false
9397
*/
9498
def enableProguardInReleaseBuilds = false
9599

100+
/**
101+
* The preferred build flavor of JavaScriptCore.
102+
*
103+
* For example, to use the international variant, you can use:
104+
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
105+
*
106+
* The international variant includes ICU i18n library and necessary data
107+
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
108+
* give correct results when using with locales other than en-US. Note that
109+
* this variant is about 6MiB larger per architecture than default.
110+
*/
111+
def jscFlavor = 'org.webkit:android-jsc:+'
112+
113+
/**
114+
* Whether to enable the Hermes VM.
115+
*
116+
* This should be set on project.ext.react and mirrored here. If it is not set
117+
* on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
118+
* and the benefits of using Hermes will therefore be sharply reduced.
119+
*/
120+
def enableHermes = project.ext.react.get("enableHermes", false);
121+
96122
android {
97123
compileSdkVersion rootProject.ext.compileSdkVersion
98124

@@ -116,8 +142,22 @@ android {
116142
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
117143
}
118144
}
145+
signingConfigs {
146+
debug {
147+
storeFile file('debug.keystore')
148+
storePassword 'android'
149+
keyAlias 'androiddebugkey'
150+
keyPassword 'android'
151+
}
152+
}
119153
buildTypes {
154+
debug {
155+
signingConfig signingConfigs.debug
156+
}
120157
release {
158+
// Caution! In production, you need to generate your own keystore file.
159+
// see https://facebook.github.io/react-native/docs/signed-apk-android.
160+
signingConfig signingConfigs.debug
121161
minifyEnabled enableProguardInReleaseBuilds
122162
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
123163
}
@@ -126,22 +166,38 @@ android {
126166
applicationVariants.all { variant ->
127167
variant.outputs.each { output ->
128168
// For each separate APK per architecture, set a unique version code as described here:
129-
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
130-
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4]
169+
// https://developer.android.com/studio/build/configure-apk-splits.html
170+
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
131171
def abi = output.getFilter(OutputFile.ABI)
132172
if (abi != null) { // null for the universal-debug, universal-release variants
133173
output.versionCodeOverride =
134174
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
135175
}
176+
136177
}
137178
}
179+
180+
packagingOptions {
181+
pickFirst '**/armeabi-v7a/libc++_shared.so'
182+
pickFirst '**/x86/libc++_shared.so'
183+
pickFirst '**/arm64-v8a/libc++_shared.so'
184+
pickFirst '**/x86_64/libc++_shared.so'
185+
pickFirst '**/x86/libjsc.so'
186+
pickFirst '**/armeabi-v7a/libjsc.so'
187+
}
138188
}
139189

140190
dependencies {
141-
implementation project(':react-native-gesture-handler')
142191
implementation fileTree(dir: "libs", include: ["*.jar"])
143-
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
144192
implementation "com.facebook.react:react-native:+" // From node_modules
193+
194+
if (enableHermes) {
195+
def hermesPath = "../../node_modules/hermesvm/android/";
196+
debugImplementation files(hermesPath + "hermes-debug.aar")
197+
releaseImplementation files(hermesPath + "hermes-release.aar")
198+
} else {
199+
implementation jscFlavor
200+
}
145201
}
146202

147203
// Run this once to be able to run the application with BUCK
@@ -150,3 +206,5 @@ task copyDownloadableDepsToLibs(type: Copy) {
150206
from configurations.compile
151207
into 'libs'
152208
}
209+
210+
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
2.2 KB
Binary file not shown.

examples/react-native/android/app/proguard-rules.pro

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,3 @@
88
# http://developer.android.com/guide/developing/tools/proguard.html
99

1010
# Add any project specific keep options here:
11-
12-
# If your project uses WebView with JS, uncomment the following
13-
# and specify the fully qualified class name to the JavaScript interface
14-
# class:
15-
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16-
# public *;
17-
#}

0 commit comments

Comments
 (0)