Skip to content

Commit 5875af6

Browse files
committed
react-native 0.54.2 & react-native-code-push 5.3.1
1 parent f5f139a commit 5875af6

File tree

19 files changed

+279
-146
lines changed

19 files changed

+279
-146
lines changed

.flowconfig

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,19 @@
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
1414
.*/Libraries/react-native/React.js
15-
.*/Libraries/react-native/ReactNative.js
15+
16+
; Ignore polyfills
17+
.*/Libraries/polyfills/.*
18+
19+
; Ignore metro
20+
.*/node_modules/metro/.*
1621

1722
[include]
1823

1924
[libs]
2025
node_modules/react-native/Libraries/react-native/react-native-interface.js
21-
node_modules/react-native/flow
22-
flow/
26+
node_modules/react-native/flow/
27+
node_modules/react-native/flow-github/
2328

2429
[options]
2530
emoji=true
@@ -30,16 +35,20 @@ munge_underscores=true
3035

3136
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'
3237

38+
module.file_ext=.js
39+
module.file_ext=.jsx
40+
module.file_ext=.json
41+
module.file_ext=.native.js
42+
3343
suppress_type=$FlowIssue
3444
suppress_type=$FlowFixMe
35-
suppress_type=$FixMe
45+
suppress_type=$FlowFixMeProps
46+
suppress_type=$FlowFixMeState
3647

37-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
38-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
48+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
49+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
3950
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
4051
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
4152

42-
unsafe.enable_getters_and_setters=true
43-
4453
[version]
45-
^0.49.1
54+
^0.65.0

.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ buck-out/
4646
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
4747
# screenshots whenever they are needed.
4848
# For more information about the recommended setup visit:
49-
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
49+
# https://docs.fastlane.tools/best-practices/source-control/
5050

51-
fastlane/report.xml
52-
fastlane/Preview.html
53-
fastlane/screenshots
51+
*/fastlane/report.xml
52+
*/fastlane/Preview.html
53+
*/fastlane/screenshots

demo.js renamed to App.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { Component } from "react";
1+
import React, { Component } from 'react';
22
import {
33
AppRegistry,
44
Dimensions,
@@ -7,11 +7,11 @@ import {
77
Text,
88
TouchableOpacity,
99
View,
10-
} from "react-native";
10+
} from 'react-native';
1111

1212
import CodePush from "react-native-code-push";
1313

14-
class CodePushDemoApp extends Component {
14+
class App extends Component<{}> {
1515
constructor() {
1616
super();
1717
this.state = { restartAllowed: true };
@@ -157,6 +157,6 @@ const styles = StyleSheet.create({
157157
*/
158158
let codePushOptions = { checkFrequency: CodePush.CheckFrequency.MANUAL };
159159

160-
CodePushDemoApp = CodePush(codePushOptions)(CodePushDemoApp);
160+
App = CodePush(codePushOptions)(App);
161161

162-
AppRegistry.registerComponent("CodePushDemoApp", () => CodePushDemoApp);
162+
export default App;

README.md

Lines changed: 0 additions & 33 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import 'react-native';
22
import React from 'react';
3-
import Index from '../index.ios.js';
3+
import App from '../App';
44

55
// Note: test renderer must be required after react-native.
66
import renderer from 'react-test-renderer';
77

88
it('renders correctly', () => {
99
const tree = renderer.create(
10-
<Index />
10+
<App />
1111
);
1212
});

__tests__/index.android.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

android/app/build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ import com.android.build.OutputFile
7272
* ]
7373
*/
7474

75+
project.ext.react = [
76+
entryFile: "index.js"
77+
]
78+
7579
apply from: "../../node_modules/react-native/react.gradle"
7680
apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"
7781

@@ -99,7 +103,7 @@ android {
99103
minSdkVersion 16
100104
targetSdkVersion 22
101105
versionCode 1
102-
versionName "2.0.0"
106+
versionName "2.1.0"
103107
ndk {
104108
abiFilters "armeabi-v7a", "x86"
105109
}

android/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
22
package="com.codepushdemoapp"
33
android:versionCode="1"
4-
android:versionName="2.0.0">
4+
android:versionName="2.1.0">
55

66
<uses-permission android:name="android.permission.INTERNET" />
77
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
88

9-
<uses-sdk
10-
android:minSdkVersion="16"
11-
android:targetSdkVersion="22" />
12-
139
<application
1410
android:name=".MainApplication"
15-
android:allowBackup="true"
1611
android:label="@string/app_name"
1712
android:icon="@mipmap/ic_launcher"
13+
android:allowBackup="false"
1814
android:theme="@style/AppTheme">
1915
<activity
2016
android:name=".MainActivity"

android/app/src/main/java/com/codepushdemoapp/MainApplication.java

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package com.codepushdemoapp;
22

33
import android.app.Application;
4+
import android.util.Log;
45

56
import com.facebook.react.ReactApplication;
67
import com.microsoft.codepush.react.CodePush;
8+
import com.microsoft.codepush.react.CodePushBuilder;
79
import com.facebook.react.ReactNativeHost;
810
import com.facebook.react.ReactPackage;
911
import com.facebook.react.shell.MainReactPackage;
@@ -16,11 +18,11 @@ public class MainApplication extends Application implements ReactApplication {
1618

1719
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
1820

19-
@Override
20-
protected String getJSBundleFile() {
21-
return CodePush.getJSBundleFile();
22-
}
23-
21+
@Override
22+
protected String getJSBundleFile() {
23+
return CodePush.getJSBundleFile();
24+
}
25+
2426
@Override
2527
public boolean getUseDeveloperSupport() {
2628
return BuildConfig.DEBUG;
@@ -30,9 +32,17 @@ public boolean getUseDeveloperSupport() {
3032
protected List<ReactPackage> getPackages() {
3133
return Arrays.<ReactPackage>asList(
3234
new MainReactPackage(),
33-
new CodePush(getResources().getString(R.string.reactNativeCodePush_androidDeploymentKey), getApplicationContext(), BuildConfig.DEBUG, "http://api.code-push.com/")
35+
new CodePushBuilder(getResources().getString(R.string.reactNativeCodePush_androidDeploymentKey),getApplicationContext())
36+
.setIsDebugMode(BuildConfig.DEBUG)
37+
.setServerUrl(getResources().getString(R.string.reactNativeCodePush_androidServerURL))
38+
.build()
3439
);
3540
}
41+
42+
@Override
43+
protected String getJSMainModuleName() {
44+
return "index";
45+
}
3646
};
3747

3848
@Override
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<resources>
22
<string moduleConfig="true" name="reactNativeCodePush_androidDeploymentKey">BPPCDEeergFkpHur4YNXCjqXVjR6qLF160UDg</string>
3+
<string moduleConfig="true" name="reactNativeCodePush_androidServerURL">http://api.code-push.com/</string>
34
<string name="app_name">CodePushDemoApp</string>
45
</resources>

0 commit comments

Comments
 (0)