Skip to content

Commit fb628e9

Browse files
committed
Update to RN 0.59.10
1 parent 802c396 commit fb628e9

Some content is hidden

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

42 files changed

+2782
-2587
lines changed

StaticServerExample/.flowconfig

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,27 @@
2424
[libs]
2525
node_modules/react-native/Libraries/react-native/react-native-interface.js
2626
node_modules/react-native/flow/
27-
node_modules/react-native/flow-github/
2827

2928
[options]
3029
emoji=true
3130

31+
esproposal.optional_chaining=enable
32+
esproposal.nullish_coalescing=enable
33+
3234
module.system=haste
35+
module.system.haste.use_name_reducers=true
36+
# get basename
37+
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
38+
# strip .js or .js.flow suffix
39+
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
40+
# strip .ios suffix
41+
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
42+
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
43+
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
44+
module.system.haste.paths.blacklist=.*/__tests__/.*
45+
module.system.haste.paths.blacklist=.*/__mocks__/.*
46+
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
47+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
3348

3449
munge_underscores=true
3550

@@ -51,4 +66,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
5166
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
5267

5368
[version]
54-
^0.65.0
69+
^0.92.0

StaticServerExample/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,5 @@ buck-out/
5252
*/fastlane/Preview.html
5353
*/fastlane/screenshots
5454

55-
my-release-key.keystore
55+
# Bundle artifact
56+
*.jsbundle

StaticServerExample/App.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ import {
1010
StyleSheet,
1111
Text,
1212
View,
13-
WebView,
1413
Image,
1514
NativeModules
1615
} from 'react-native';
1716

1817
import StaticServer from 'react-native-static-server';
19-
import RNFS from 'react-native-fs';
18+
import RNFetchBlob from "rn-fetch-blob";
19+
import { WebView } from 'react-native-webview';
2020

2121
type Props = {};
2222
export default class App extends Component<Props> {
@@ -38,29 +38,32 @@ export default class App extends Component<Props> {
3838
let html = require('./index.html');
3939
let {uri} = Image.resolveAssetSource(html);
4040

41-
let path = RNFS.DocumentDirectoryPath + "/" + this.root;
41+
let path = RNFetchBlob.fs.dirs.DocumentDir + "/" + this.root;
4242
let dest = path + this.file;
4343

4444
// Add the directory
45-
RNFS.mkdir(path, { NSURLIsExcludedFromBackupKey: true });
45+
RNFetchBlob.fs.mkdir(path, { NSURLIsExcludedFromBackupKey: true });
4646

4747
// Fetch the file
4848
let added;
4949

5050
if (uri.indexOf("file://") > -1) {
5151
// Copy file in release
52-
added = RNFS.exists(dest).then((e) => {
52+
added = RNFetchBlob.fs.exists(dest).then((e) => {
5353
if (!e) {
54-
return RNFS.copyFile(uri, dest);
54+
return RNFetchBlob.fs.cp(uri, dest);
5555
}
5656
});
5757
} else {
5858
// Download for development
59-
let download = RNFS.downloadFile({
60-
fromUrl: uri,
61-
toFile: dest
62-
});
63-
added = download.promise;
59+
added = RNFetchBlob
60+
.config({
61+
fileCache : true,
62+
})
63+
.fetch('GET', uri)
64+
.then((res) => {
65+
return RNFetchBlob.fs.mv(res.path(), dest);
66+
})
6467
}
6568

6669

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/**
2+
* @format
3+
*/
4+
15
import 'react-native';
26
import React from 'react';
37
import App from '../App';
@@ -6,7 +10,5 @@ import App from '../App';
610
import renderer from 'react-test-renderer';
711

812
it('renders correctly', () => {
9-
const tree = renderer.create(
10-
<App />
11-
);
13+
renderer.create(<App />);
1214
});

StaticServerExample/android/app/BUCK

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,13 @@
88
# - `buck install -r android/app` - compile, install and run application
99
#
1010

11+
load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
12+
1113
lib_deps = []
1214

13-
for jarfile in glob(['libs/*.jar']):
14-
name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')]
15-
lib_deps.append(':' + name)
16-
prebuilt_jar(
17-
name = name,
18-
binary_jar = jarfile,
19-
)
15+
create_aar_targets(glob(["libs/*.aar"]))
2016

21-
for aarfile in glob(['libs/*.aar']):
22-
name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')]
23-
lib_deps.append(':' + name)
24-
android_prebuilt_aar(
25-
name = name,
26-
aar = aarfile,
27-
)
17+
create_jar_targets(glob(["libs/*.jar"]))
2818

2919
android_library(
3020
name = "all-libs",

StaticServerExample/android/app/build.gradle

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,24 +95,25 @@ def enableProguardInReleaseBuilds = false
9595

9696
android {
9797
compileSdkVersion rootProject.ext.compileSdkVersion
98-
buildToolsVersion rootProject.ext.buildToolsVersion
98+
99+
compileOptions {
100+
sourceCompatibility JavaVersion.VERSION_1_8
101+
targetCompatibility JavaVersion.VERSION_1_8
102+
}
99103

100104
defaultConfig {
101105
applicationId "com.staticserverexample"
102106
minSdkVersion rootProject.ext.minSdkVersion
103107
targetSdkVersion rootProject.ext.targetSdkVersion
104108
versionCode 1
105109
versionName "1.0"
106-
ndk {
107-
abiFilters "armeabi-v7a", "x86"
108-
}
109110
}
110111
splits {
111112
abi {
112113
reset()
113114
enable enableSeparateBuildPerCPUArchitecture
114115
universalApk false // If true, also generate a universal APK
115-
include "armeabi-v7a", "x86"
116+
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
116117
}
117118
}
118119
buildTypes {
@@ -126,7 +127,7 @@ android {
126127
variant.outputs.each { output ->
127128
// For each separate APK per architecture, set a unique version code as described here:
128129
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
129-
def versionCodes = ["armeabi-v7a":1, "x86":2]
130+
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4]
130131
def abi = output.getFilter(OutputFile.ABI)
131132
if (abi != null) { // null for the universal-debug, universal-release variants
132133
output.versionCodeOverride =
@@ -137,11 +138,12 @@ android {
137138
}
138139

139140
dependencies {
141+
implementation project(':rn-fetch-blob')
142+
implementation project(':react-native-webview')
143+
implementation project(':react-native-static-server')
140144
implementation fileTree(dir: "libs", include: ["*.jar"])
141145
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
142146
implementation "com.facebook.react:react-native:+" // From node_modules
143-
implementation project(':react-native-fs')
144-
implementation project(':react-native-static-server')
145147
}
146148

147149
// Run this once to be able to run the application with BUCK
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"""Helper definitions to glob .aar and .jar targets"""
2+
3+
def create_aar_targets(aarfiles):
4+
for aarfile in aarfiles:
5+
name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
6+
lib_deps.append(":" + name)
7+
android_prebuilt_aar(
8+
name = name,
9+
aar = aarfile,
10+
)
11+
12+
def create_jar_targets(jarfiles):
13+
for jarfile in jarfiles:
14+
name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")]
15+
lib_deps.append(":" + name)
16+
prebuilt_jar(
17+
name = name,
18+
binary_jar = jarfile,
19+
)

StaticServerExample/android/app/proguard-rules.pro

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -15,56 +15,3 @@
1515
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
1616
# public *;
1717
#}
18-
19-
# Disabling obfuscation is useful if you collect stack traces from production crashes
20-
# (unless you are using a system that supports de-obfuscate the stack traces).
21-
-dontobfuscate
22-
23-
# React Native
24-
25-
# Keep our interfaces so they can be used by other ProGuard rules.
26-
# See http://sourceforge.net/p/proguard/bugs/466/
27-
-keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
28-
-keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
29-
-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip
30-
31-
# Do not strip any method/class that is annotated with @DoNotStrip
32-
-keep @com.facebook.proguard.annotations.DoNotStrip class *
33-
-keep @com.facebook.common.internal.DoNotStrip class *
34-
-keepclassmembers class * {
35-
@com.facebook.proguard.annotations.DoNotStrip *;
36-
@com.facebook.common.internal.DoNotStrip *;
37-
}
38-
39-
-keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
40-
void set*(***);
41-
*** get*();
42-
}
43-
44-
-keep class * extends com.facebook.react.bridge.JavaScriptModule { *; }
45-
-keep class * extends com.facebook.react.bridge.NativeModule { *; }
46-
-keepclassmembers,includedescriptorclasses class * { native <methods>; }
47-
-keepclassmembers class * { @com.facebook.react.uimanager.UIProp <fields>; }
48-
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp <methods>; }
49-
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; }
50-
51-
-dontwarn com.facebook.react.**
52-
53-
# TextLayoutBuilder uses a non-public Android constructor within StaticLayout.
54-
# See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details.
55-
-dontwarn android.text.StaticLayout
56-
57-
# okhttp
58-
59-
-keepattributes Signature
60-
-keepattributes *Annotation*
61-
-keep class okhttp3.** { *; }
62-
-keep interface okhttp3.** { *; }
63-
-dontwarn okhttp3.**
64-
65-
# okio
66-
67-
-keep class sun.misc.Unsafe { *; }
68-
-dontwarn java.nio.file.*
69-
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
70-
-dontwarn okio.**
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools">
4+
5+
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
6+
7+
<application android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" />
8+
</manifest>

StaticServerExample/android/app/src/main/AndroidManifest.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.staticserverexample">
2+
package="com.staticserverexample">
33

44
<uses-permission android:name="android.permission.INTERNET" />
5-
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
5+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
66

77
<application
88
android:name=".MainApplication"
99
android:label="@string/app_name"
1010
android:icon="@mipmap/ic_launcher"
11+
android:roundIcon="@mipmap/ic_launcher_round"
1112
android:allowBackup="false"
1213
android:theme="@style/AppTheme">
1314
<activity
@@ -18,6 +19,7 @@
1819
<intent-filter>
1920
<action android:name="android.intent.action.MAIN" />
2021
<category android:name="android.intent.category.LAUNCHER" />
22+
<action android:name="android.intent.action.DOWNLOAD_COMPLETE"/>
2123
</intent-filter>
2224
</activity>
2325
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />

0 commit comments

Comments
 (0)