Skip to content

Commit 5489f9e

Browse files
authored
feat: Upgrade to React Native 0.60.0 / CocoaPods / Android X. (#513)
BREAKING CHANGE: You should upgrade React Native. See https://facebook.github.io/react-native/blog/2019/07/03/version-60
1 parent df76905 commit 5489f9e

File tree

221 files changed

+3853
-15592
lines changed

Some content is hidden

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

221 files changed

+3853
-15592
lines changed

.gitmodules

-9
This file was deleted.

.npmignore

+2-14
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,9 @@ android/build
66
ios/build
77
react-native-fast-image-*.tgz
88

9-
# We need to ignore some things in submodules.
10-
# This probably isn't everything we'd like to ignore but it's good enough.
11-
.git*
12-
*.png
13-
ios/Vendor/SDWebImage/Examples
14-
ios/Vendor/SDWebImage/Tests
15-
ios/Vendor/SDWebImage/Docs
16-
ios/Vendor/SDWebImage/Vendors/FLAnimatedImage/FLAnimatedImageDemo
17-
ios/Vendor/SDWebImage/Vendors/FLAnimatedImage/images
18-
ios/Vendor/SDWebImage/Vendors/libwebp/examples
19-
209
# Examples
21-
react-native-fast-image-example
22-
react-native-fast-image-example-cocoapods
23-
react-native-fast-image-example-server
10+
ReactNativeFastImageExample
11+
ReactNativeFastImageExampleServer
2412

2513
# Tests
2614
.circleci

.prettierignore

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
/ios/Vendor/
2-
/react-native-fast-image-example/
3-
/react-native-fast-image-example-cocoapods/
1+
/ReactNativeFastImageExample/
2+
/ReactNativeFastImageExampleServer/
43
node_modules
54
coverage

README.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,11 @@ const YourImage = () => (
8181
)
8282
```
8383

84-
## Other Linking Methods
84+
## Are you using Glide already using an AppGlideModule?
8585

86-
- [Manual](docs/installation-manual.md) (might be needed if something went wrong with `react-native link`)
87-
- [CocoaPods (iOS)](docs/installation-cocoapods.md) (you may wish to use this if you are already using CocoaPods)
8886
- [Are you using Glide already using an AppGlideModule?](docs/app-glide-module.md) (you might have problems if you don't read this)
8987

90-
## Proguard
88+
## Are you using Proguard?
9189

9290
If you use Proguard you will need to add these lines to `android/app/proguard-rules.pro`:
9391

RNFastImage.podspec

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
require 'json'
2+
3+
Pod::Spec.new do |s|
4+
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
5+
6+
s.name = "RNFastImage"
7+
s.version = package['version']
8+
s.summary = package['description']
9+
s.authors = { "Dylan Vann" => "[email protected]" }
10+
s.homepage = "https://github.com/DylanVann/react-native-fast-image#readme"
11+
s.license = "MIT"
12+
s.platforms = { :ios => "8.0", :tvos => "9.0" }
13+
s.framework = 'UIKit'
14+
s.requires_arc = true
15+
s.source = { :git => "https://github.com/DylanVann/react-native-fast-image.git" }
16+
s.source_files = "ios/**/*.{h,m}"
17+
18+
s.dependency 'React'
19+
s.dependency 'SDWebImage', '~> 5.0'
20+
s.dependency 'SDWebImageWebPCoder', '~> 0.2.3'
21+
end
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
root: true,
3+
extends: '@react-native-community',
4+
};

react-native-fast-image-example-cocoapods/.flowconfig ReactNativeFastImageExample/.flowconfig

+44-14
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

react-native-fast-image-example/.gitignore ReactNativeFastImageExample/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,6 @@ buck-out/
5454

5555
# Bundle artifact
5656
*.jsbundle
57+
58+
# CocoaPods
59+
/ios/Pods/

react-native-fast-image-example/android/app/build.gradle ReactNativeFastImageExample/android/app/build.gradle

+38-7
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
*
@@ -93,6 +96,15 @@ def enableSeparateBuildPerCPUArchitecture = false
9396
*/
9497
def enableProguardInReleaseBuilds = false
9598

99+
/**
100+
* Use international variant JavaScriptCore
101+
* International variant includes ICU i18n library and necessary data allowing to use
102+
* e.g. Date.toLocaleString and String.localeCompare that give correct results
103+
* when using with locales other than en-US.
104+
* Note that this variant is about 6MiB larger per architecture than default.
105+
*/
106+
def useIntlJsc = false
107+
96108
android {
97109
compileSdkVersion rootProject.ext.compileSdkVersion
98110

@@ -116,8 +128,22 @@ android {
116128
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
117129
}
118130
}
131+
signingConfigs {
132+
debug {
133+
storeFile file('debug.keystore')
134+
storePassword 'android'
135+
keyAlias 'androiddebugkey'
136+
keyPassword 'android'
137+
}
138+
}
119139
buildTypes {
140+
debug {
141+
signingConfig signingConfigs.debug
142+
}
120143
release {
144+
// Caution! In production, you need to generate your own keystore file.
145+
// see https://facebook.github.io/react-native/docs/signed-apk-android.
146+
signingConfig signingConfigs.debug
121147
minifyEnabled enableProguardInReleaseBuilds
122148
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
123149
}
@@ -126,8 +152,8 @@ android {
126152
applicationVariants.all { variant ->
127153
variant.outputs.each { output ->
128154
// 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]
155+
// https://developer.android.com/studio/build/configure-apk-splits.html
156+
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
131157
def abi = output.getFilter(OutputFile.ABI)
132158
if (abi != null) { // null for the universal-debug, universal-release variants
133159
output.versionCodeOverride =
@@ -138,13 +164,15 @@ android {
138164
}
139165

140166
dependencies {
141-
implementation project(':react-native-gesture-handler')
142-
implementation project(':react-native-vector-icons')
143-
implementation project(':react-native-image-picker')
144-
implementation project(':react-native-fast-image')
145167
implementation fileTree(dir: "libs", include: ["*.jar"])
146-
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
147168
implementation "com.facebook.react:react-native:+" // From node_modules
169+
170+
// JSC from node_modules
171+
if (useIntlJsc) {
172+
implementation 'org.webkit:android-jsc-intl:+'
173+
} else {
174+
implementation 'org.webkit:android-jsc:+'
175+
}
148176
}
149177

150178
// Run this once to be able to run the application with BUCK
@@ -153,3 +181,6 @@ task copyDownloadableDepsToLibs(type: Copy) {
153181
from configurations.compile
154182
into 'libs'
155183
}
184+
185+
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
186+
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

react-native-fast-image-example/android/app/proguard-rules.pro ReactNativeFastImageExample/android/app/proguard-rules.pro

-7
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-
#}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
package com.reactnativefastimageexamplecocoapods;
1+
package com.reactnativefastimageexample;
22

33
import android.app.Application;
44

5+
import com.facebook.react.PackageList;
56
import com.facebook.react.ReactApplication;
67
import com.facebook.react.ReactNativeHost;
78
import com.facebook.react.ReactPackage;
8-
import com.facebook.react.shell.MainReactPackage;
99
import com.facebook.soloader.SoLoader;
1010

11-
import java.util.Arrays;
1211
import java.util.List;
1312

1413
public class MainApplication extends Application implements ReactApplication {
@@ -21,9 +20,11 @@ public boolean getUseDeveloperSupport() {
2120

2221
@Override
2322
protected List<ReactPackage> getPackages() {
24-
return Arrays.<ReactPackage>asList(
25-
new MainReactPackage()
26-
);
23+
@SuppressWarnings("UnnecessaryLocalVariable")
24+
List<ReactPackage> packages = new PackageList(this).getPackages();
25+
// Packages that cannot be autolinked yet can be added manually here, for example:
26+
// packages.add(new MyReactNativePackage());
27+
return packages;
2728
}
2829

2930
@Override

react-native-fast-image-example/android/app/src/main/res/values/styles.xml ReactNativeFastImageExample/android/app/src/main/res/values/styles.xml

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<!-- Base application theme. -->
44
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
55
<!-- Customize your theme here. -->
6+
<item name="android:textColor">#000000</item>
67
</style>
78

89
</resources>

react-native-fast-image-example-cocoapods/android/build.gradle ReactNativeFastImageExample/android/build.gradle

+9-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ buildscript {
1313
jcenter()
1414
}
1515
dependencies {
16-
classpath 'com.android.tools.build:gradle:3.3.1'
16+
classpath("com.android.tools.build:gradle:3.4.1")
1717

1818
// NOTE: Do not place your application dependencies here; they belong
1919
// in the individual module build.gradle files
@@ -23,11 +23,16 @@ buildscript {
2323
allprojects {
2424
repositories {
2525
mavenLocal()
26-
google()
27-
jcenter()
2826
maven {
2927
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
30-
url "$rootDir/../node_modules/react-native/android"
28+
url("$rootDir/../node_modules/react-native/android")
29+
}
30+
maven {
31+
// Android JSC is installed from npm
32+
url("$rootDir/../node_modules/jsc-android/dist")
3133
}
34+
35+
google()
36+
jcenter()
3237
}
3338
}

react-native-fast-image-example-cocoapods/android/gradle.properties ReactNativeFastImageExample/android/gradle.properties

+3
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@
1616
# This option should only be used with decoupled projects. More details, visit
1717
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1818
# org.gradle.parallel=true
19+
20+
android.useAndroidX=true
21+
android.enableJetifier=true
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
34
zipStoreBase=GRADLE_USER_HOME
45
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip

react-native-fast-image-example/android/gradlew ReactNativeFastImageExample/android/gradlew

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
#!/usr/bin/env sh
22

3+
#
4+
# Copyright 2015 the original author or authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
319
##############################################################################
420
##
521
## Gradle start up script for UN*X
@@ -28,7 +44,7 @@ APP_NAME="Gradle"
2844
APP_BASE_NAME=`basename "$0"`
2945

3046
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31-
DEFAULT_JVM_OPTS=""
47+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
3248

3349
# Use the maximum available, or set MAX_FD != -1 to use that value.
3450
MAX_FD="maximum"

0 commit comments

Comments
 (0)