Skip to content

Commit 7cbde94

Browse files
committed
react-native 0.64
1 parent c75c29c commit 7cbde94

38 files changed

+3131
-4487
lines changed

template/.editorconfig

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Windows files
2+
[*.bat]
3+
end_of_line = crlf

template/.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = {
22
root: true,
3-
extends: "@react-native-community",
3+
extends: '@react-native-community',
44
};

template/.flowconfig

+3-11
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
; Ignore polyfills
99
node_modules/react-native/Libraries/polyfills/.*
1010

11-
; These should not be required directly
12-
; require from fbjs/lib instead: require('fbjs/lib/warning')
13-
node_modules/warning/.*
14-
1511
; Flow doesn't support platforms
1612
.*/Libraries/Utilities/LoadingView.js
1713

@@ -30,6 +26,8 @@ emoji=true
3026
esproposal.optional_chaining=enable
3127
esproposal.nullish_coalescing=enable
3228

29+
exact_by_default=true
30+
3331
module.file_ext=.js
3432
module.file_ext=.json
3533
module.file_ext=.ios.js
@@ -44,10 +42,6 @@ suppress_type=$FlowFixMe
4442
suppress_type=$FlowFixMeProps
4543
suppress_type=$FlowFixMeState
4644

47-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
48-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
49-
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
50-
5145
[lints]
5246
sketchy-null-number=warn
5347
sketchy-null-mixed=warn
@@ -56,10 +50,8 @@ untyped-type-import=warn
5650
nonstrict-import=warn
5751
deprecated-type=warn
5852
unsafe-getters-setters=warn
59-
inexact-spread=warn
6053
unnecessary-invariant=warn
6154
signature-verification-failure=warn
62-
deprecated-utility=error
6355

6456
[strict]
6557
deprecated-type
@@ -71,4 +63,4 @@ untyped-import
7163
untyped-type-import
7264

7365
[version]
74-
^0.122.0
66+
^0.137.0

template/.gitattributes

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
# Xcode pbxproj are text
2-
*.pbxproj -text
3-
4-
# .re and .rei files are Reason, sometimes recognized as C/C++ (on GitHub)
5-
*.re linguist-language=Reason
6-
*.rei linguist-language=Reason
7-
8-
# specific for windows script files
1+
# Windows files should use crlf line endings
2+
# https://help.github.com/articles/dealing-with-line-endings/
93
*.bat text eol=crlf

template/.prettierrc.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ module.exports = {
33
jsxBracketSameLine: true,
44
singleQuote: true,
55
trailingComma: 'all',
6-
};
6+
arrowParens: 'avoid',
7+
};

template/__tests__/App-test.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
* @format
33
*/
44

5-
import "react-native";
6-
import React from "react";
7-
import App from "../App";
5+
import 'react-native';
6+
import React from 'react';
7+
import App from '../App';
88

99
// Note: test renderer must be required after react-native.
10-
import renderer from "react-test-renderer";
10+
import renderer from 'react-test-renderer';
1111

12-
it("renders correctly", () => {
12+
it('renders correctly', () => {
1313
renderer.create(<App />);
1414
});
File renamed without changes.

template/android/app/build.gradle

+4-1
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ def jscFlavor = 'org.webkit:android-jsc:+'
121121
def enableHermes = project.ext.react.get("enableHermes", false);
122122

123123
android {
124+
ndkVersion rootProject.ext.ndkVersion
125+
124126
compileSdkVersion rootProject.ext.compileSdkVersion
125127

126128
compileOptions {
@@ -169,11 +171,12 @@ android {
169171
variant.outputs.each { output ->
170172
// For each separate APK per architecture, set a unique version code as described here:
171173
// https://developer.android.com/studio/build/configure-apk-splits.html
174+
// Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
172175
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
173176
def abi = output.getFilter(OutputFile.ABI)
174177
if (abi != null) { // null for the universal-debug, universal-release variants
175178
output.versionCodeOverride =
176-
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
179+
defaultConfig.versionCode * 1000 + versionCodes.get(abi)
177180
}
178181

179182
}

template/android/app/src/debug/AndroidManifest.xml

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,10 @@
44

55
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
66

7-
<application android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" />
7+
<application
8+
android:usesCleartextTraffic="true"
9+
tools:targetApi="28"
10+
tools:ignore="GoogleAppIndexingWarning">
11+
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
12+
</application>
813
</manifest>

template/android/app/src/main/AndroidManifest.xml

-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,5 @@
2121
<category android:name="android.intent.category.LAUNCHER" />
2222
</intent-filter>
2323
</activity>
24-
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
2524
</application>
26-
2725
</manifest>

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

+8-8
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
public class MainActivity extends ReactActivity {
66

7-
/**
8-
* Returns the name of the main component registered from JavaScript.
9-
* This is used to schedule rendering of the component.
10-
*/
11-
@Override
12-
protected String getMainComponentName() {
13-
return "ProjectName";
14-
}
7+
/**
8+
* Returns the name of the main component registered from JavaScript. This is used to schedule
9+
* rendering of the component.
10+
*/
11+
@Override
12+
protected String getMainComponentName() {
13+
return "ProjectName";
14+
}
1515
}

template/android/app/src/main/res/values/styles.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<resources>
22

33
<!-- Base application theme. -->
4-
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
4+
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
55
<!-- Customize your theme here. -->
66
<item name="android:textColor">#000000</item>
77
</style>

template/android/build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
buildscript {
44
ext {
5-
buildToolsVersion = "29.0.2"
6-
minSdkVersion = 16
5+
buildToolsVersion = "29.0.3"
6+
minSdkVersion = 21
77
compileSdkVersion = 29
88
targetSdkVersion = 29
9+
ndkVersion = "20.1.5948944"
910
}
1011
repositories {
1112
google()
1213
jcenter()
1314
}
1415
dependencies {
15-
classpath("com.android.tools.build:gradle:3.5.3")
16-
16+
classpath("com.android.tools.build:gradle:4.1.0")
1717
// NOTE: Do not place your application dependencies here; they belong
1818
// in the individual module build.gradle files
1919
}

template/android/gradle.properties

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@
2323
android.useAndroidX=true
2424
# Automatically convert third-party libraries to use AndroidX
2525
android.enableJetifier=true
26+
2627
# Version of flipper SDK to use with React Native
27-
FLIPPER_VERSION=0.54.0
28+
FLIPPER_VERSION=0.75.1
508 Bytes
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.2-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

template/android/gradlew

+2
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ esac
8282

8383
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
8484

85+
8586
# Determine the Java command to use to start the JVM.
8687
if [ -n "$JAVA_HOME" ] ; then
8788
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@@ -129,6 +130,7 @@ fi
129130
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
130131
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
131132
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133+
132134
JAVACMD=`cygpath --unix "$JAVACMD"`
133135

134136
# We build the pattern for arguments to be converted via cygpath

template/android/gradlew.bat

+4-18
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
4040

4141
set JAVA_EXE=java.exe
4242
%JAVA_EXE% -version >NUL 2>&1
43-
if "%ERRORLEVEL%" == "0" goto init
43+
if "%ERRORLEVEL%" == "0" goto execute
4444

4545
echo.
4646
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -54,7 +54,7 @@ goto fail
5454
set JAVA_HOME=%JAVA_HOME:"=%
5555
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5656

57-
if exist "%JAVA_EXE%" goto init
57+
if exist "%JAVA_EXE%" goto execute
5858

5959
echo.
6060
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -64,28 +64,14 @@ echo location of your Java installation.
6464

6565
goto fail
6666

67-
:init
68-
@rem Get command-line arguments, handling Windows variants
69-
70-
if not "%OS%" == "Windows_NT" goto win9xME_args
71-
72-
:win9xME_args
73-
@rem Slurp the command line arguments.
74-
set CMD_LINE_ARGS=
75-
set _SKIP=2
76-
77-
:win9xME_args_slurp
78-
if "x%~1" == "x" goto execute
79-
80-
set CMD_LINE_ARGS=%*
81-
8267
:execute
8368
@rem Setup the command line
8469

8570
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
8671

72+
8773
@rem Execute Gradle
88-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
74+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
8975

9076
:end
9177
@rem End local scope for the variables with windows NT shell

template/babel.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
presets: ["module:metro-react-native-babel-preset"],
2+
presets: ['module:metro-react-native-babel-preset'],
33
};

template/index.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
* @format
33
*/
44

5-
import { AppRegistry } from "react-native";
6-
import App from "./App";
5+
import {AppRegistry} from 'react-native';
6+
import App from './App';
7+
import {name as appName} from './app.json';
78

8-
const APP_NAME = "ProjectName";
9-
10-
AppRegistry.registerComponent(APP_NAME, () => App);
9+
AppRegistry.registerComponent(appName, () => App);

template/ios/Podfile

+11-17
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,25 @@ platform :ios, '10.0'
55

66
target 'ProjectName' do
77
config = use_native_modules!
8-
9-
use_react_native!(:path => config["reactNativePath"])
8+
9+
use_react_native!(
10+
:path => config[:reactNativePath],
11+
# to enable hermes on iOS, change `false` to `true` and then install pods
12+
:hermes_enabled => false
13+
)
1014

1115
target 'ProjectNameTests' do
1216
inherit! :complete
1317
# Pods for testing
1418
end
1519

16-
use_native_modules!
17-
1820
# Enables Flipper.
1921
#
2022
# Note that if you have use_frameworks! enabled, Flipper will not work and
21-
# you should disable these next few lines.
22-
use_flipper!
23-
post_install do |installer|
24-
flipper_post_install(installer)
25-
end
26-
end
23+
# you should disable the next line.
24+
use_flipper!()
2725

28-
target 'ProjectName-tvOS' do
29-
# Pods for ProjectName-tvOS
30-
31-
target 'ProjectName-tvOSTests' do
32-
inherit! :search_paths
33-
# Pods for testing
26+
post_install do |installer|
27+
react_native_post_install(installer)
3428
end
35-
end
29+
end

0 commit comments

Comments
 (0)