Commit 4be9241ac020dd0ea3d099282362a686f9d0fa15
dx: update react-native to 0.60.5
Andre Staltz committed on 9/16/2019, 3:17:40 PMParent: 496ad89c2da6c3e808d630dc664581eb611e2c3c
Files changed
.flowconfig | ||
---|---|---|
@@ -10,16 +10,23 @@ | ||
10 | 10 | |
11 | 11 | ; Ignore duplicate module providers |
12 | 12 | ; For RN Apps installed via npm, "Libraries" folder is inside |
13 | 13 | ; "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 | |
15 | 15 | |
16 | 16 | ; Ignore polyfills |
17 | -.*/Libraries/polyfills/.* | |
17 | +node_modules/react-native/Libraries/polyfills/.* | |
18 | 18 | |
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/.* | |
21 | 22 | |
23 | +; Flow doesn't support platforms | |
24 | +.*/Libraries/Utilities/HMRLoadingView.js | |
25 | + | |
26 | +[untyped] | |
27 | +.*/node_modules/@react-native-community/cli/.*/.* | |
28 | + | |
22 | 29 | [include] |
23 | 30 | |
24 | 31 | [libs] |
25 | 32 | node_modules/react-native/Libraries/react-native/react-native-interface.js |
@@ -30,8 +37,12 @@ | ||
30 | 37 | |
31 | 38 | esproposal.optional_chaining=enable |
32 | 39 | esproposal.nullish_coalescing=enable |
33 | 40 | |
41 | +module.file_ext=.js | |
42 | +module.file_ext=.json | |
43 | +module.file_ext=.ios.js | |
44 | + | |
34 | 45 | module.system=haste |
35 | 46 | module.system.haste.use_name_reducers=true |
36 | 47 | # get basename |
37 | 48 | module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1' |
@@ -42,28 +53,47 @@ | ||
42 | 53 | module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1' |
43 | 54 | module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1' |
44 | 55 | module.system.haste.paths.blacklist=.*/__tests__/.* |
45 | 56 | module.system.haste.paths.blacklist=.*/__mocks__/.* |
57 | +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 | |
46 | 61 | 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/.* | |
48 | 62 | |
49 | 63 | munge_underscores=true |
50 | 64 | |
51 | 65 | 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' |
52 | 66 | |
53 | -module.file_ext=.js | |
54 | -module.file_ext=.jsx | |
55 | -module.file_ext=.json | |
56 | -module.file_ext=.native.js | |
57 | - | |
58 | 67 | suppress_type=$FlowIssue |
59 | 68 | suppress_type=$FlowFixMe |
60 | 69 | suppress_type=$FlowFixMeProps |
61 | 70 | suppress_type=$FlowFixMeState |
62 | 71 | |
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]+ | |
66 | 74 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError |
67 | 75 | |
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 | + | |
68 | 98 | [version] |
69 | -^0.92.0 | |
99 | +^0.98.0 |
.gitignore | ||
---|---|---|
@@ -69,7 +69,10 @@ | ||
69 | 69 | /nodejs-assets |
70 | 70 | /android/app/src/main/res/raw/rnnodebundle |
71 | 71 | *.jsbundle |
72 | 72 | |
73 | +# CocoaPods | |
74 | +/ios/Pods/ | |
75 | + | |
73 | 76 | # Misc |
74 | 77 | # |
75 | 78 | /gitignored/ |
android/app/build.gradle | ||
---|---|---|
@@ -17,8 +17,11 @@ | ||
17 | 17 | * |
18 | 18 | * // the entry file for bundle generation |
19 | 19 | * entryFile: "index.android.js", |
20 | 20 | * |
21 | + * // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format | |
22 | + * bundleCommand: "ram-bundle", | |
23 | + * | |
21 | 24 | * // whether to bundle JS and assets in debug mode |
22 | 25 | * bundleInDebug: false, |
23 | 26 | * |
24 | 27 | * // whether to bundle JS and assets in release mode |
@@ -75,9 +78,11 @@ | ||
75 | 78 | project.ext.vectoricons = [ |
76 | 79 | iconFontNames: [ 'MaterialIcons.ttf', 'MaterialCommunityIcons.ttf' ] |
77 | 80 | ] |
78 | 81 | project.ext.react = [ |
79 | - entryFile: "index.android.js" | |
82 | + entryFile: "index.android.js", | |
83 | + enableHermes: true, // clean and rebuild if changing | |
84 | + hermesCommand: "../../node_modules/hermes-engine/%OS-BIN%/hermes", | |
80 | 85 | ] |
81 | 86 | apply from: "../../node_modules/react-native-vector-icons/fonts.gradle" |
82 | 87 | apply from: "../../node_modules/react-native/react.gradle" |
83 | 88 | |
@@ -95,8 +100,30 @@ | ||
95 | 100 | * Run Proguard to shrink the Java bytecode in release builds. |
96 | 101 | */ |
97 | 102 | def enableProguardInReleaseBuilds = false |
98 | 103 | |
104 | +/** | |
105 | + * The preferred build flavor of JavaScriptCore. | |
106 | + * | |
107 | + * For example, to use the international variant, you can use: | |
108 | + * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` | |
109 | + * | |
110 | + * The international variant includes ICU i18n library and necessary data | |
111 | + * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that | |
112 | + * give correct results when using with locales other than en-US. Note that | |
113 | + * this variant is about 6MiB larger per architecture than default. | |
114 | + */ | |
115 | +def jscFlavor = 'org.webkit:android-jsc:+' | |
116 | + | |
117 | +/** | |
118 | + * Whether to enable the Hermes VM. | |
119 | + * | |
120 | + * This should be set on project.ext.react and mirrored here. If it is not set | |
121 | + * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode | |
122 | + * and the benefits of using Hermes will therefore be sharply reduced. | |
123 | + */ | |
124 | +def enableHermes = project.ext.react.get("enableHermes", false); | |
125 | + | |
99 | 126 | android { |
100 | 127 | compileSdkVersion rootProject.ext.compileSdkVersion |
101 | 128 | |
102 | 129 | compileOptions { |
@@ -111,9 +138,9 @@ | ||
111 | 138 | versionName "0.1909.11-beta" |
112 | 139 | applicationId "se.manyver" |
113 | 140 | minSdkVersion rootProject.ext.minSdkVersion |
114 | 141 | targetSdkVersion rootProject.ext.targetSdkVersion |
115 | - missingDimensionStrategy "RNN.reactNativeVersion", "reactNative57_5" | |
142 | + missingDimensionStrategy "RNN.reactNativeVersion", "reactNative60" | |
116 | 143 | ndk { |
117 | 144 | abiFilters "armeabi-v7a", "arm64-v8a" // , "x86", "x86_64" |
118 | 145 | } |
119 | 146 | aaptOptions { |
@@ -122,8 +149,14 @@ | ||
122 | 149 | vectorDrawables.useSupportLibrary = true |
123 | 150 | } |
124 | 151 | |
125 | 152 | signingConfigs { |
153 | + // debug { | |
154 | + // storeFile file('debug.keystore') | |
155 | + // storePassword 'android' | |
156 | + // keyAlias 'androiddebugkey' | |
157 | + // keyPassword 'android' | |
158 | + // } | |
126 | 159 | release { |
127 | 160 | if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) { |
128 | 161 | storeFile file(MYAPP_RELEASE_STORE_FILE) |
129 | 162 | storePassword MYAPP_RELEASE_STORE_PASSWORD |
@@ -142,9 +175,15 @@ | ||
142 | 175 | } |
143 | 176 | } |
144 | 177 | |
145 | 178 | buildTypes { |
179 | + debug { | |
180 | + signingConfig signingConfigs.debug | |
181 | + } | |
146 | 182 | release { |
183 | + // Caution! In production, you need to generate your own keystore file. | |
184 | + // see https://facebook.github.io/react-native/docs/signed-apk-android. | |
185 | + // signingConfig signingConfigs.debug | |
147 | 186 | minifyEnabled enableProguardInReleaseBuilds |
148 | 187 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" |
149 | 188 | if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) { |
150 | 189 | signingConfig signingConfigs.release |
@@ -155,17 +194,26 @@ | ||
155 | 194 | // applicationVariants are e.g. debug, release |
156 | 195 | applicationVariants.all { variant -> |
157 | 196 | variant.outputs.each { output -> |
158 | 197 | // For each separate APK per architecture, set a unique version code as described here: |
159 | - // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits | |
160 | - def versionCodes = ["armeabi-v7a":1, "arm64-v8a":2] //, "x86":3, "x86_64":4] | |
198 | + // https://developer.android.com/studio/build/configure-apk-splits.html | |
199 | + def versionCodes = ["armeabi-v7a": 1, "arm64-v8a": 2] //, "x86":3, "x86_64":4] | |
161 | 200 | def abi = output.getFilter(OutputFile.ABI) |
162 | 201 | if (abi != null) { // null for the universal-debug, universal-release variants |
163 | 202 | output.versionCodeOverride = |
164 | 203 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode |
165 | 204 | } |
166 | 205 | } |
167 | 206 | } |
207 | + | |
208 | + packagingOptions { | |
209 | + pickFirst '**/armeabi-v7a/libc++_shared.so' | |
210 | + pickFirst '**/x86/libc++_shared.so' | |
211 | + pickFirst '**/arm64-v8a/libc++_shared.so' | |
212 | + pickFirst '**/x86_64/libc++_shared.so' | |
213 | + pickFirst '**/x86/libjsc.so' | |
214 | + pickFirst '**/armeabi-v7a/libjsc.so' | |
215 | + } | |
168 | 216 | } |
169 | 217 | |
170 | 218 | def acraVersion = '5.3.0' |
171 | 219 | |
@@ -186,31 +234,42 @@ | ||
186 | 234 | implementation project(':react-native-android-local-notification') |
187 | 235 | implementation project(':react-native-android-wifi') |
188 | 236 | implementation project(':react-native-has-internet') |
189 | 237 | implementation fileTree(dir: "libs", include: ["*.jar"]) |
190 | - implementation("com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}") { | |
191 | - force = true | |
192 | - } | |
193 | - implementation("com.android.support:recyclerview-v7:${rootProject.ext.supportLibVersion}") { | |
194 | - force = true | |
195 | - } | |
196 | - implementation("com.android.support:support-v4:${rootProject.ext.supportLibVersion}") { | |
197 | - force = true | |
198 | - } | |
199 | - implementation("com.android.support:design:${rootProject.ext.supportLibVersion}") { | |
200 | - force = true | |
201 | - } | |
202 | - implementation("com.android.support:support-fragment:${rootProject.ext.supportLibVersion}") { | |
203 | - force = true | |
204 | - } | |
238 | + implementation 'androidx.appcompat:appcompat:1.0.2' | |
239 | + // implementation("com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}") { | |
240 | + // force = true | |
241 | + // } | |
242 | + // implementation("com.android.support:recyclerview-v7:${rootProject.ext.supportLibVersion}") { | |
243 | + // force = true | |
244 | + // } | |
245 | + // implementation("com.android.support:support-v4:${rootProject.ext.supportLibVersion}") { | |
246 | + // force = true | |
247 | + // } | |
248 | + // implementation("com.android.support:design:${rootProject.ext.supportLibVersion}") { | |
249 | + // force = true | |
250 | + // } | |
251 | + // implementation("com.android.support:support-fragment:${rootProject.ext.supportLibVersion}") { | |
252 | + // force = true | |
253 | + // } | |
205 | 254 | implementation("com.facebook.react:react-native:+") { |
206 | - force = true | |
255 | + force = true | |
207 | 256 | } |
208 | 257 | implementation 'com.facebook.fresco:animated-gif:1.3.0' |
258 | + | |
259 | + if (enableHermes) { | |
260 | + def hermesPath = "../../node_modules/hermes-engine/android/"; | |
261 | + debugImplementation files(hermesPath + "hermes-debug.aar") | |
262 | + releaseImplementation files(hermesPath + "hermes-release.aar") | |
263 | + } else { | |
264 | + implementation jscFlavor | |
265 | + } | |
209 | 266 | } |
210 | 267 | |
211 | 268 | // Run this once to be able to run the application with BUCK |
212 | 269 | // puts all compile dependencies into folder libs for BUCK to use |
213 | 270 | task copyDownloadableDepsToLibs(type: Copy) { |
214 | 271 | from configurations.compile |
215 | 272 | into 'libs' |
216 | 273 | } |
274 | + | |
275 | +apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) |
android/app/proguard-rules.pro | ||
---|---|---|
@@ -7,11 +7,5 @@ | ||
7 | 7 | # For more details, see |
8 | 8 | # http://developer.android.com/guide/developing/tools/proguard.html |
9 | 9 | |
10 | 10 | # 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 | -#} | |
11 | +-keep class com.facebook.hermes.unicode.** { *; } |
android/app/src/main/java/se/manyver/MainActivity.java | ||
---|---|---|
@@ -10,9 +10,9 @@ | ||
10 | 10 | import android.content.Context; |
11 | 11 | import android.graphics.Color; |
12 | 12 | import android.os.Bundle; |
13 | 13 | import android.os.Handler; |
14 | -import android.support.annotation.Nullable; | |
14 | +import androidx.annotation.Nullable; | |
15 | 15 | import android.util.Log; |
16 | 16 | import android.view.View; |
17 | 17 | import android.view.inputmethod.InputMethodManager; |
18 | 18 | import android.widget.LinearLayout; |
android/app/src/main/java/se/manyver/MainApplication.java | ||
---|---|---|
@@ -6,8 +6,9 @@ | ||
6 | 6 | |
7 | 7 | package se.manyver; |
8 | 8 | |
9 | 9 | import android.content.Context; |
10 | +import androidx.annotation.Nullable; | |
10 | 11 | |
11 | 12 | import com.janeasystems.rn_nodejs_mobile.RNNodeJsMobilePackage; |
12 | 13 | import com.aakashns.reactnativedialogs.ReactNativeDialogsPackage; |
13 | 14 | import com.oblador.vectoricons.VectorIconsPackage; |
@@ -30,8 +31,9 @@ | ||
30 | 31 | import com.reactnative.ivpusic.imagepicker.PickerPackage; |
31 | 32 | import org.acra.*; |
32 | 33 | import org.acra.annotation.*; |
33 | 34 | |
35 | +import java.util.ArrayList; | |
34 | 36 | import java.util.Arrays; |
35 | 37 | import java.util.List; |
36 | 38 | import java.util.UUID; |
37 | 39 | |
@@ -52,43 +54,45 @@ | ||
52 | 54 | SoLoader.init(this, /* native exopackage */ false); |
53 | 55 | } |
54 | 56 | |
55 | 57 | |
56 | - protected ReactGateway createReactGateway() { | |
57 | - ReactNativeHost host = new NavigationReactNativeHost(this, isDebug(), createAdditionalReactPackages()) { | |
58 | - | |
59 | - protected String getJSMainModuleName() { | |
60 | - return "index.android"; | |
61 | - } | |
62 | - }; | |
63 | - return new ReactGateway(this, isDebug(), host); | |
58 | + protected ReactNativeHost createReactNativeHost() { | |
59 | + return new NavigationReactNativeHost(this) { | |
60 | + | |
61 | + protected String getJSMainModuleName() { | |
62 | + return "index.android"; | |
63 | + } | |
64 | + }; | |
64 | 65 | } |
65 | 66 | |
66 | 67 | |
67 | 68 | public boolean isDebug() { |
68 | 69 | // Make sure you are using BuildConfig from your own application |
69 | 70 | return BuildConfig.DEBUG; |
70 | 71 | } |
71 | 72 | |
72 | - protected List<ReactPackage> getPackages() { | |
73 | - | |
73 | + | |
74 | + | |
75 | + public List<ReactPackage> createAdditionalReactPackages() { | |
74 | 76 | String socketDir = this.getApplicationInfo().dataDir + "/files"; |
75 | 77 | |
76 | 78 | UUID uuid = UUID.fromString("b0b2e90d-0cda-4bb0-8e4b-fb165cd17d48"); |
77 | 79 | |
78 | 80 | BluetoothSocketBridgeConfiguration bluetoothConfig = new BluetoothSocketBridgeConfiguration(socketDir, |
79 | 81 | "manyverse_bt_incoming.sock", "manyverse_bt_outgoing.sock", "manyverse_bt_control.sock", "scuttlebutt", uuid); |
80 | 82 | |
81 | - // Add additional packages you require here | |
82 | - // No need to add RnnPackage and MainReactPackage | |
83 | - return Arrays.<ReactPackage>asList(new MainReactPackage(), new RNBluetoothManagerPackage(), | |
84 | - new BluetoothSocketBridgePackage(bluetoothConfig), new PickerPackage(), new HasInternetPackage(), | |
85 | - new AndroidWifiPackage(), new RNFSPackage(), new RandomBytesPackage(), new RNNodeJsMobilePackage(), | |
86 | - new ReactNativeDialogsPackage(), new VectorIconsPackage(), new RNOSModule(), new NotificationPackage()); | |
83 | + List<ReactPackage> packages = new ArrayList<>(); | |
84 | + packages.add(new RNBluetoothManagerPackage()); | |
85 | + packages.add(new BluetoothSocketBridgePackage(bluetoothConfig)); | |
86 | + packages.add(new PickerPackage()); | |
87 | + packages.add(new HasInternetPackage()); | |
88 | + packages.add(new AndroidWifiPackage()); | |
89 | + packages.add(new RNFSPackage()); | |
90 | + packages.add(new RandomBytesPackage()); | |
91 | + packages.add(new RNNodeJsMobilePackage()); | |
92 | + packages.add(new ReactNativeDialogsPackage()); | |
93 | + packages.add(new VectorIconsPackage()); | |
94 | + packages.add(new RNOSModule()); | |
95 | + packages.add(new NotificationPackage()); | |
96 | + return packages; | |
87 | 97 | } |
88 | - | |
89 | - | |
90 | - public List<ReactPackage> createAdditionalReactPackages() { | |
91 | - return getPackages(); | |
92 | - } | |
93 | - | |
94 | 98 | } |
android/app/src/main/res/values/styles.xml | ||
---|---|---|
@@ -9,7 +9,8 @@ | ||
9 | 9 | <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> |
10 | 10 | <item name="android:statusBarColor">#364fc7</item> |
11 | 11 | <item name="colorPrimary">#3b5bdb</item> |
12 | 12 | <item name="android:colorPrimaryDark">#364fc7</item> |
13 | + <item name="android:textColor">#212529</item> | |
13 | 14 | </style> |
14 | 15 | |
15 | 16 | </resources> |
android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf | ||
---|---|---|
The diff is too large to show. Use a local git client to view these changes. Old file size: 416232 bytes New file size: 0 bytes |
android/app/src/main/assets/fonts/MaterialIcons.ttf | ||
---|---|---|
@@ -1,443 +1,0 @@ | ||
1 | - � pGDEF S � $GPOS�� �, 6GSUB�ҩQ �d iPOS/2 | |
2 | -s"c x `cmap��1� x cvt D | gasp�� � glyfD}� rHheadڋf � 6hhea 4 $hmtxj�iF � �loca;)�� � �maxp' � X name5� �d zpost�� 2 �� �O�"�_<� �ޣ� �ޣ� �� � � @ . � Lf GLf � � � 0�� + + + @ + @ @ U @ U 5 + @ @ U k k @ + + + + + � + + � + + + + @ + @ @ U U � � + � + + + @ + k � @ @ + @ " |