Skip to content

Commit 95e32ab

Browse files
committed
react-native 0.56.0 & react-native-code-push 5.4.1
1 parent dd3572f commit 95e32ab

32 files changed

+9933
-267
lines changed

.flowconfig

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,19 @@ node_modules/react-native/flow-github/
3030
emoji=true
3131

3232
module.system=haste
33+
module.system.haste.use_name_reducers=true
34+
# get basename
35+
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
36+
# strip .js or .js.flow suffix
37+
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
38+
# strip .ios suffix
39+
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
40+
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
41+
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
42+
module.system.haste.paths.blacklist=.*/__tests__/.*
43+
module.system.haste.paths.blacklist=.*/__mocks__/.*
44+
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
45+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
3346

3447
munge_underscores=true
3548

@@ -51,4 +64,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
5164
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
5265

5366
[version]
54-
^0.65.0
67+
^0.75.0

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,6 @@ buck-out/
5151
*/fastlane/report.xml
5252
*/fastlane/Preview.html
5353
*/fastlane/screenshots
54+
55+
# Bundle artifact
56+
*.jsbundle

App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class App extends Component<{}> {
106106
<Text style={styles.syncButton}>Press for dialog-driven sync</Text>
107107
</TouchableOpacity>
108108
{progressView}
109-
<Image style={styles.image} resizeMode={Image.resizeMode.contain} source={require("./images/laptop_phone_howitworks.png")}/>
109+
<Image style={styles.image} source={require("./images/laptop_phone_howitworks.png")}/>
110110
<TouchableOpacity onPress={this.toggleAllowRestart.bind(this)}>
111111
<Text style={styles.restartToggleButton}>Restart { this.state.restartAllowed ? "allowed" : "forbidden"}</Text>
112112
</TouchableOpacity>

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@ fork from https://github.com/Microsoft/react-native-code-push examples
55
# iOS eg.
66

77
```shell
8-
$ cd /path/to/code-push-demo-app
8+
$ git clone git@github.com:lisong/code-push-demo-app.git
9+
$ cd code-push-demo-app
910
$ npm install
1011
$ open ios/CodePushDemoApp.xcodeproj
1112
```
1213

1314
# android eg.
1415

1516
```shell
16-
$ cd /path/to/code-push-demo-app
17+
$ git clone git@github.com:lisong/code-push-demo-app.git
18+
$ cd code-push-demo-app
1719
$ npm install
1820
$ cd android
1921
$ ./gradlew assembleRelease
@@ -23,10 +25,10 @@ $ cd app/build/outputs/apk #install app-release.apk into your phone
2325
# codepush 热更新
2426

2527
```shell
26-
$ code-push login http://api.code-push.com:8080 #登录code-push-server
28+
$ code-push login http://api.code-push.com #登录code-push-server
2729
$ code-push app add CodePushReactNativeDemo-ios ios react-native #iOS版
2830
$ code-push app add CodePushReactNativeDemo-android android react-native #android版
29-
$ cd /path/to/code-push-demo-app
31+
$ cd code-push-demo-app
3032
$ npm install
3133
$ code-push release-react CodePushReactNativeDemo-ios ios -d Production #发布到code-push-server ios
3234
$ code-push release-react CodePushReactNativeDemo-android android -d Production #发布code-push-server android

__tests__/App.js

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

android/app/build.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,15 @@ def enableSeparateBuildPerCPUArchitecture = false
9595
def enableProguardInReleaseBuilds = false
9696

9797
android {
98-
compileSdkVersion 23
99-
buildToolsVersion "23.0.1"
98+
compileSdkVersion rootProject.ext.compileSdkVersion
99+
buildToolsVersion rootProject.ext.buildToolsVersion
100100

101101
defaultConfig {
102102
applicationId "com.codepushdemoapp"
103-
minSdkVersion 16
104-
targetSdkVersion 22
105-
versionCode 1
106-
versionName "2.1.0"
103+
minSdkVersion rootProject.ext.minSdkVersion
104+
targetSdkVersion rootProject.ext.targetSdkVersion
105+
versionCode 20180818
106+
versionName "5.6.0"
107107
ndk {
108108
abiFilters "armeabi-v7a", "x86"
109109
}
@@ -149,7 +149,7 @@ android {
149149
dependencies {
150150
compile project(':react-native-code-push')
151151
compile fileTree(dir: "libs", include: ["*.jar"])
152-
compile "com.android.support:appcompat-v7:23.0.1"
152+
compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
153153
compile "com.facebook.react:react-native:+" // From node_modules
154154
}
155155

android/app/proguard-rules.pro

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -15,56 +15,3 @@
1515
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
1616
# public *;
1717
#}
18-
19-
# Disabling obfuscation is useful if you collect stack traces from production crashes
20-
# (unless you are using a system that supports de-obfuscate the stack traces).
21-
-dontobfuscate
22-
23-
# React Native
24-
25-
# Keep our interfaces so they can be used by other ProGuard rules.
26-
# See http://sourceforge.net/p/proguard/bugs/466/
27-
-keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
28-
-keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
29-
-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip
30-
31-
# Do not strip any method/class that is annotated with @DoNotStrip
32-
-keep @com.facebook.proguard.annotations.DoNotStrip class *
33-
-keep @com.facebook.common.internal.DoNotStrip class *
34-
-keepclassmembers class * {
35-
@com.facebook.proguard.annotations.DoNotStrip *;
36-
@com.facebook.common.internal.DoNotStrip *;
37-
}
38-
39-
-keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
40-
void set*(***);
41-
*** get*();
42-
}
43-
44-
-keep class * extends com.facebook.react.bridge.JavaScriptModule { *; }
45-
-keep class * extends com.facebook.react.bridge.NativeModule { *; }
46-
-keepclassmembers,includedescriptorclasses class * { native <methods>; }
47-
-keepclassmembers class * { @com.facebook.react.uimanager.UIProp <fields>; }
48-
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp <methods>; }
49-
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; }
50-
51-
-dontwarn com.facebook.react.**
52-
53-
# TextLayoutBuilder uses a non-public Android constructor within StaticLayout.
54-
# See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details.
55-
-dontwarn android.text.StaticLayout
56-
57-
# okhttp
58-
59-
-keepattributes Signature
60-
-keepattributes *Annotation*
61-
-keep class okhttp3.** { *; }
62-
-keep interface okhttp3.** { *; }
63-
-dontwarn okhttp3.**
64-
65-
# okio
66-
67-
-keep class sun.misc.Unsafe { *; }
68-
-dontwarn java.nio.file.*
69-
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
70-
-dontwarn okio.**

android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.codepushdemoapp"
3-
android:versionCode="1"
4-
android:versionName="2.1.0">
2+
package="com.codepushdemoapp">
53

64
<uses-permission android:name="android.permission.INTERNET" />
75
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

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

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

33
import android.app.Application;
4-
import android.util.Log;
54

65
import com.facebook.react.ReactApplication;
76
import com.microsoft.codepush.react.CodePush;
8-
import com.microsoft.codepush.react.CodePushBuilder;
97
import com.facebook.react.ReactNativeHost;
108
import com.facebook.react.ReactPackage;
119
import com.facebook.react.shell.MainReactPackage;
@@ -32,10 +30,11 @@ public boolean getUseDeveloperSupport() {
3230
protected List<ReactPackage> getPackages() {
3331
return Arrays.<ReactPackage>asList(
3432
new MainReactPackage(),
35-
new CodePushBuilder(getResources().getString(R.string.reactNativeCodePush_androidDeploymentKey),getApplicationContext())
36-
.setIsDebugMode(BuildConfig.DEBUG)
37-
.setServerUrl(getResources().getString(R.string.reactNativeCodePush_androidServerURL))
38-
.build()
33+
new CodePush(
34+
getResources().getString(R.string.reactNativeCodePush_androidDeploymentKey),
35+
getApplicationContext(), BuildConfig.DEBUG,
36+
getResources().getString(R.string.reactNativeCodePush_androidServerURL)
37+
)
3938
);
4039
}
4140

-362 Bytes
Loading

0 commit comments

Comments
 (0)