Skip to content

Commit 53f2ac9

Browse files
NaturalclarMoOx
authored andcommitted
Upgrade Template to RN 0.61.5 and RRN to 0.61.1 (#2)
* feat: upgrade template to RN 0.61 * feat: add debug.keystore
1 parent 18b3db8 commit 53f2ac9

File tree

11 files changed

+144
-125
lines changed

11 files changed

+144
-125
lines changed

template/.flowconfig

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@
55
; Ignore "BUCK" generated dirs
66
<PROJECT_ROOT>/\.buckd/
77

8-
; Ignore unexpected extra "@providesModule"
9-
.*/node_modules/.*/node_modules/fbjs/.*
10-
11-
; Ignore duplicate module providers
12-
; For RN Apps installed via npm, "Libraries" folder is inside
13-
; "node_modules/react-native" but in the source repo it is in the root
14-
node_modules/react-native/Libraries/react-native/React.js
15-
168
; Ignore polyfills
179
node_modules/react-native/Libraries/polyfills/.*
1810

@@ -21,7 +13,7 @@ node_modules/react-native/Libraries/polyfills/.*
2113
node_modules/warning/.*
2214

2315
; Flow doesn't support platforms
24-
.*/Libraries/Utilities/HMRLoadingView.js
16+
.*/Libraries/Utilities/LoadingView.js
2517

2618
[untyped]
2719
.*/node_modules/@react-native-community/cli/.*/.*
@@ -42,27 +34,11 @@ module.file_ext=.js
4234
module.file_ext=.json
4335
module.file_ext=.ios.js
4436

45-
module.system=haste
46-
module.system.haste.use_name_reducers=true
47-
# get basename
48-
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
49-
# strip .js or .js.flow suffix
50-
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
51-
# strip .ios suffix
52-
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
53-
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
54-
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
55-
module.system.haste.paths.blacklist=.*/__tests__/.*
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
61-
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
62-
6337
munge_underscores=true
6438

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'
39+
module.name_mapper='^react-native$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/react-native/react-native-implementation'
40+
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1'
41+
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\)$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/Image/RelativeImageStub'
6642

6743
suppress_type=$FlowIssue
6844
suppress_type=$FlowFixMe
@@ -96,4 +72,4 @@ untyped-import
9672
untyped-type-import
9773

9874
[version]
99-
^0.98.0
75+
^0.105.0

template/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ DerivedData
2020
*.hmap
2121
*.ipa
2222
*.xcuserstate
23-
project.xcworkspace
2423

2524
# Android/IntelliJ
2625
#
@@ -40,6 +39,7 @@ yarn-error.log
4039
buck-out/
4140
\.buckd/
4241
*.keystore
42+
!debug.keystore
4343

4444
# fastlane
4545
#

template/.prettierrc.js

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+
};
2.2 KB
Binary file not shown.

template/android/app/src/main/java/com/projectname/MainApplication.java

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
import android.app.Application;
44
import android.util.Log;
5-
5+
import android.content.Context;
66
import com.facebook.react.PackageList;
77
import com.facebook.hermes.reactexecutor.HermesExecutorFactory;
88
import com.facebook.react.bridge.JavaScriptExecutorFactory;
99
import com.facebook.react.ReactApplication;
1010
import com.facebook.react.ReactNativeHost;
1111
import com.facebook.react.ReactPackage;
1212
import com.facebook.soloader.SoLoader;
13-
13+
import java.lang.reflect.InvocationTargetException;
1414
import java.util.List;
1515

1616
public class MainApplication extends Application implements ReactApplication {
@@ -45,5 +45,32 @@ public ReactNativeHost getReactNativeHost() {
4545
public void onCreate() {
4646
super.onCreate();
4747
SoLoader.init(this, /* native exopackage */ false);
48+
initializeFlipper(this); // Remove this line if you don't want Flipper enabled
49+
}
50+
51+
/**
52+
* Loads Flipper in React Native templates.
53+
*
54+
* @param context
55+
*/
56+
private static void initializeFlipper(Context context) {
57+
if (BuildConfig.DEBUG) {
58+
try {
59+
/*
60+
We use reflection here to pick up the class that initializes Flipper,
61+
since Flipper library is not available in release mode
62+
*/
63+
Class<?> aClass = Class.forName("com.facebook.flipper.ReactNativeFlipper");
64+
aClass.getMethod("initializeFlipper", Context.class).invoke(null, context);
65+
} catch (ClassNotFoundException e) {
66+
e.printStackTrace();
67+
} catch (NoSuchMethodException e) {
68+
e.printStackTrace();
69+
} catch (IllegalAccessException e) {
70+
e.printStackTrace();
71+
} catch (InvocationTargetException e) {
72+
e.printStackTrace();
73+
}
74+
}
4875
}
4976
}

template/android/build.gradle

Lines changed: 2 additions & 1 deletion
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.4.1")
16+
classpath("com.android.tools.build:gradle:3.4.2")
1717

1818
// NOTE: Do not place your application dependencies here; they belong
1919
// in the individual module build.gradle files
@@ -34,5 +34,6 @@ allprojects {
3434

3535
google()
3636
jcenter()
37+
maven { url 'https://jitpack.io' }
3738
}
3839
}
Lines changed: 1 addition & 1 deletion
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
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

template/ios/Podfile

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@ require_relative '../node_modules/@react-native-community/cli-platform-ios/nativ
33

44
target 'ProjectName' do
55
# Pods for ProjectName
6+
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
7+
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
8+
pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
9+
pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
610
pod 'React', :path => '../node_modules/react-native/'
7-
pod 'React-Core', :path => '../node_modules/react-native/React'
8-
pod 'React-DevSupport', :path => '../node_modules/react-native/React'
11+
pod 'React-Core', :path => '../node_modules/react-native/'
12+
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
13+
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
914
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
1015
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
1116
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
@@ -15,13 +20,15 @@ target 'ProjectName' do
1520
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
1621
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
1722
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
18-
pod 'React-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'
23+
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
1924

2025
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
2126
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
2227
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
2328
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
24-
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
29+
pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
30+
pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
31+
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
2532

2633
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
2734
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'

0 commit comments

Comments
 (0)