Skip to content

Commit 4d5d6ba

Browse files
committed
feat: upgrade react-native and expo to latest versions
1 parent 01c58f6 commit 4d5d6ba

File tree

18 files changed

+1051
-561
lines changed

18 files changed

+1051
-561
lines changed

templates/common/$package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@
6161
"jest": "^26.0.1",
6262
"pod-install": "^0.1.0",
6363
"prettier": "^2.0.5",
64-
"react": "16.11.0",
65-
"react-native": "0.62.2",
64+
"react": "16.13.1",
65+
"react-native": "0.63.4",
6666
"react-native-builder-bob": "^<%- bob.version %>",
6767
"release-it": "^14.2.2",
6868
"typescript": "^4.1.3"

templates/example/example/$package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
"start": "react-native start"
1010
},
1111
"dependencies": {
12-
"react": "16.11.0",
13-
"react-native": "0.62.2"
12+
"react": "16.13.1",
13+
"react-native": "0.63.4"
1414
},
1515
"devDependencies": {
16-
"@babel/core": "^7.9.6",
17-
"@babel/runtime": "^7.9.6",
16+
"@babel/core": "^7.12.10",
17+
"@babel/runtime": "^7.12.5",
1818
"babel-plugin-module-resolver": "^4.0.0",
1919
"metro-react-native-babel-preset": "^0.64.0"
2020
}

templates/example/example/android/app/build.gradle

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ 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
21+
* // https://reactnative.dev/docs/performance#enable-the-ram-format
2222
* bundleCommand: "ram-bundle",
2323
*
2424
* // whether to bundle JS and assets in debug mode
@@ -155,7 +155,7 @@ android {
155155
}
156156
release {
157157
// Caution! In production, you need to generate your own keystore file.
158-
// see https://facebook.github.io/react-native/docs/signed-apk-android.
158+
// see https://reactnative.dev/docs/signed-apk-android.
159159
signingConfig signingConfigs.debug
160160
minifyEnabled enableProguardInReleaseBuilds
161161
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
@@ -175,13 +175,6 @@ android {
175175

176176
}
177177
}
178-
179-
packagingOptions {
180-
pickFirst "lib/armeabi-v7a/libc++_shared.so"
181-
pickFirst "lib/arm64-v8a/libc++_shared.so"
182-
pickFirst "lib/x86/libc++_shared.so"
183-
pickFirst "lib/x86_64/libc++_shared.so"
184-
}
185178
}
186179

187180
dependencies {
@@ -196,6 +189,7 @@ dependencies {
196189
}
197190
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
198191
exclude group:'com.facebook.flipper'
192+
exclude group:'com.squareup.okhttp3', module:'okhttp'
199193
}
200194
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
201195
exclude group:'com.facebook.flipper'

templates/example/example/android/build.gradle

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

33
buildscript {
44
ext {
5-
buildToolsVersion = "28.0.3"
5+
buildToolsVersion = "29.0.2"
66
minSdkVersion = 16
7-
compileSdkVersion = 28
8-
targetSdkVersion = 28
7+
compileSdkVersion = 29
8+
targetSdkVersion = 29
99
}
1010
repositories {
1111
google()
1212
jcenter()
1313
}
1414
dependencies {
15-
classpath("com.android.tools.build:gradle:3.5.2")
15+
classpath("com.android.tools.build:gradle:3.5.3")
1616

1717
// NOTE: Do not place your application dependencies here; they belong
1818
// in the individual module build.gradle files

templates/example/example/android/gradle.properties

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

2020
android.useAndroidX=true
2121
android.enableJetifier=true
22-
FLIPPER_VERSION=0.33.1
22+
FLIPPER_VERSION=0.54.0
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-6.0.1-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

templates/example/example/android/gradlew

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# you may not use this file except in compliance with the License.
88
# You may obtain a copy of the License at
99
#
10-
# http://www.apache.org/licenses/LICENSE-2.0
10+
# https://www.apache.org/licenses/LICENSE-2.0
1111
#
1212
# Unless required by applicable law or agreed to in writing, software
1313
# distributed under the License is distributed on an "AS IS" BASIS,
@@ -125,7 +125,7 @@ if $darwin; then
125125
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
126126
fi
127127

128-
# For Cygwin, switch paths to Windows format before running java
128+
# For Cygwin or MSYS, switch paths to Windows format before running java
129129
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
130130
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
131131
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
@@ -154,19 +154,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
154154
else
155155
eval `echo args$i`="\"$arg\""
156156
fi
157-
i=$((i+1))
157+
i=`expr $i + 1`
158158
done
159159
case $i in
160-
(0) set -- ;;
161-
(1) set -- "$args0" ;;
162-
(2) set -- "$args0" "$args1" ;;
163-
(3) set -- "$args0" "$args1" "$args2" ;;
164-
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
165-
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
166-
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
167-
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
168-
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
169-
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
160+
0) set -- ;;
161+
1) set -- "$args0" ;;
162+
2) set -- "$args0" "$args1" ;;
163+
3) set -- "$args0" "$args1" "$args2" ;;
164+
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
165+
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
166+
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
167+
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
168+
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
169+
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
170170
esac
171171
fi
172172

@@ -175,14 +175,9 @@ save () {
175175
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
176176
echo " "
177177
}
178-
APP_ARGS=$(save "$@")
178+
APP_ARGS=`save "$@"`
179179

180180
# Collect all arguments for the java command, following the shell quoting and substitution rules
181181
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
182182

183-
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
184-
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
185-
cd "$(dirname "$0")"
186-
fi
187-
188183
exec "$JAVACMD" "$@"

templates/example/example/android/gradlew.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=.
2929
set APP_BASE_NAME=%~n0
3030
set APP_HOME=%DIRNAME%
3131

32+
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
33+
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34+
3235
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
3336
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
3437

templates/example/example/ios/Podfile

Lines changed: 8 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,22 @@
1-
platform :ios, '10.0'
1+
require_relative '../node_modules/react-native/scripts/react_native_pods'
22
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
33

4-
def add_flipper_pods!
5-
version = '~> 0.33.1'
6-
pod 'FlipperKit', version, :configuration => 'Debug'
7-
pod 'FlipperKit/FlipperKitLayoutPlugin', version, :configuration => 'Debug'
8-
pod 'FlipperKit/SKIOSNetworkPlugin', version, :configuration => 'Debug'
9-
pod 'FlipperKit/FlipperKitUserDefaultsPlugin', version, :configuration => 'Debug'
10-
pod 'FlipperKit/FlipperKitReactPlugin', version, :configuration => 'Debug'
11-
end
12-
# Post Install processing for Flipper
13-
def flipper_post_install(installer)
14-
installer.pods_project.targets.each do |target|
15-
if target.name == 'YogaKit'
16-
target.build_configurations.each do |config|
17-
config.build_settings['SWIFT_VERSION'] = '4.1'
18-
end
19-
end
20-
end
21-
end
4+
platform :ios, '10.0'
225

236
target '<%- project.name %>Example' do
24-
# Pods for <%- project.name %>Example
25-
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
26-
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
27-
pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
28-
pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
29-
pod 'React', :path => '../node_modules/react-native/'
30-
pod 'React-Core', :path => '../node_modules/react-native/'
31-
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
32-
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
33-
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
34-
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
35-
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
36-
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
37-
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
38-
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
39-
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
40-
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
41-
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
42-
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
43-
44-
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
45-
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
46-
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
47-
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
48-
pod 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon"
49-
pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
50-
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga', :modular_headers => true
51-
52-
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
53-
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
54-
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
7+
config = use_native_modules!
558

56-
<% if (project.module) { -%>
57-
pod '<%- project.podspec %>', :path => '../..'
58-
<% } -%>
9+
use_react_native!(:path => config["reactNativePath"])
5910

60-
use_native_modules!
11+
<% if (project.module) { -%>
12+
pod '<%- project.podspec %>', :path => '../..'
13+
<% } -%>
6114
6215
# Enables Flipper.
6316
#
6417
# Note that if you have use_frameworks! enabled, Flipper will not work and
6518
# you should disable these next few lines.
66-
add_flipper_pods!
19+
use_flipper!
6720
post_install do |installer|
6821
flipper_post_install(installer)
6922
end

0 commit comments

Comments
 (0)