Skip to content

Commit 1d5b6d7

Browse files
committed
Upgrade for rescript 8.2 and react-native 0.63
1 parent 5daae4d commit 1d5b6d7

20 files changed

+2272
-1349
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
[![Version](https://img.shields.io/npm/v/@reason-react-native/template.svg)](https://www.npmjs.com/@reason-react-native/template)
44
[![Chat](https://img.shields.io/discord/235176658175262720.svg?logo=discord&colorb=blue)](https://reason-react-native.github.io/discord/)
55

6-
> React Native template for application developed in Reason.
6+
> React Native template for application developed with ReScript.
77
8-
Please carefully read instructions below in order to enjoy ReasonML development
8+
Please carefully read instructions below in order to enjoy Rescript development
99
experience.
1010

1111
## Setup

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"!template/ios/Pods"
2525
],
2626
"devDependencies": {
27-
"bs-platform": "^8.0.0",
27+
"bs-platform": "^8.2.0",
2828
"husky": "^4.0.0",
2929
"lint-staged": "^10.0.0",
3030
"npmpub": "^5.0.0",

template/.flowconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ untyped-import
7171
untyped-type-import
7272

7373
[version]
74-
^0.113.0
74+
^0.122.0

template/android/app/build.gradle

+3-9
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import com.android.build.OutputFile
2020
* // default. Can be overridden with ENTRY_FILE environment variable.
2121
* entryFile: "index.android.js",
2222
*
23-
* // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format
23+
* // https://reactnative.dev/docs/performance#enable-the-ram-format
2424
* bundleCommand: "ram-bundle",
2525
*
2626
* // whether to bundle JS and assets in debug mode
@@ -157,20 +157,13 @@ android {
157157
}
158158
release {
159159
// Caution! In production, you need to generate your own keystore file.
160-
// see https://facebook.github.io/react-native/docs/signed-apk-android.
160+
// see https://reactnative.dev/docs/signed-apk-android.
161161
signingConfig signingConfigs.debug
162162
minifyEnabled enableProguardInReleaseBuilds
163163
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
164164
}
165165
}
166166

167-
packagingOptions {
168-
pickFirst "lib/armeabi-v7a/libc++_shared.so"
169-
pickFirst "lib/arm64-v8a/libc++_shared.so"
170-
pickFirst "lib/x86/libc++_shared.so"
171-
pickFirst "lib/x86_64/libc++_shared.so"
172-
}
173-
174167
// applicationVariants are e.g. debug, release
175168
applicationVariants.all { variant ->
176169
variant.outputs.each { output ->
@@ -200,6 +193,7 @@ dependencies {
200193

201194
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
202195
exclude group:'com.facebook.flipper'
196+
exclude group:'com.squareup.okhttp3', module:'okhttp'
203197
}
204198

205199
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {

template/android/build.gradle

+4-5
Original file line numberDiff line numberDiff line change
@@ -2,18 +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
9-
supportLibVersion = "28.0.0"
7+
compileSdkVersion = 29
8+
targetSdkVersion = 29
109
}
1110
repositories {
1211
google()
1312
jcenter()
1413
}
1514
dependencies {
16-
classpath("com.android.tools.build:gradle:3.5.2")
15+
classpath("com.android.tools.build:gradle:3.5.3")
1716

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

template/android/gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ android.useAndroidX=true
2424
# Automatically convert third-party libraries to use AndroidX
2525
android.enableJetifier=true
2626
# Version of flipper SDK to use with React Native
27-
FLIPPER_VERSION=0.33.1
27+
FLIPPER_VERSION=0.54.0
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-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

template/android/gradlew

+14-18
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ if $darwin; then
126126
fi
127127

128128
# For Cygwin or MSYS, switch paths to Windows format before running java
129-
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"`
129+
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
130+
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
130131
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
131132
JAVACMD=`cygpath --unix "$JAVACMD"`
132133

@@ -153,19 +154,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path
153154
else
154155
eval `echo args$i`="\"$arg\""
155156
fi
156-
i=$((i+1))
157+
i=`expr $i + 1`
157158
done
158159
case $i in
159-
(0) set -- ;;
160-
(1) set -- "$args0" ;;
161-
(2) set -- "$args0" "$args1" ;;
162-
(3) set -- "$args0" "$args1" "$args2" ;;
163-
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
164-
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
165-
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
166-
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
167-
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
168-
(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" ;;
169170
esac
170171
fi
171172

@@ -174,14 +175,9 @@ save () {
174175
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
175176
echo " "
176177
}
177-
APP_ARGS=$(save "$@")
178+
APP_ARGS=`save "$@"`
178179

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

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

template/android/gradlew.bat

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
@rem you may not use this file except in compliance with the License.
66
@rem You may obtain a copy of the License at
77
@rem
8-
@rem http://www.apache.org/licenses/LICENSE-2.0
8+
@rem https://www.apache.org/licenses/LICENSE-2.0
99
@rem
1010
@rem Unless required by applicable law or agreed to in writing, software
1111
@rem distributed under the License is distributed on an "AS IS" BASIS,
@@ -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

template/ios/Podfile

+6-52
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,12 @@
1-
platform :ios, '9.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-
13-
# Post Install processing for Flipper
14-
def flipper_post_install(installer)
15-
installer.pods_project.targets.each do |target|
16-
if target.name == 'YogaKit'
17-
target.build_configurations.each do |config|
18-
config.build_settings['SWIFT_VERSION'] = '4.1'
19-
end
20-
end
21-
end
22-
end
4+
platform :ios, '10.0'
235

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

5711
target 'ProjectNameTests' do
5812
inherit! :complete
@@ -65,7 +19,7 @@ target 'ProjectName' do
6519
#
6620
# Note that if you have use_frameworks! enabled, Flipper will not work and
6721
# you should disable these next few lines.
68-
add_flipper_pods!
22+
use_flipper!
6923
post_install do |installer|
7024
flipper_post_install(installer)
7125
end

0 commit comments

Comments
 (0)