Skip to content

Commit 9ab6f52

Browse files
committed
update react-native to 0.39.2
1 parent 5852b0d commit 9ab6f52

File tree

14 files changed

+317
-148
lines changed

14 files changed

+317
-148
lines changed

.babelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"presets": ["react-native-stage-0/decorator-support"]
2+
"presets": ["react-native", "react-native-stage-0/decorator-support"]
33
}

.flowconfig

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,18 @@
11
[ignore]
2-
3-
# We fork some components by platform.
2+
; We fork some components by platform
43
.*/*[.]android.js
54

6-
# Ignore templates with `@flow` in header
7-
.*/local-cli/generator.*
8-
9-
# Ignore malformed json
10-
.*/node_modules/y18n/test/.*\.json
11-
12-
# Ignore the website subdir
13-
<PROJECT_ROOT>/website/.*
14-
15-
# Ignore BUCK generated dirs
5+
; Ignore "BUCK" generated dirs
166
<PROJECT_ROOT>/\.buckd/
177

18-
# Ignore unexpected extra @providesModule
19-
.*/node_modules/commoner/test/source/widget/share.js
8+
; Ignore unexpected extra "@providesModule"
9+
.*/node_modules/.*/node_modules/fbjs/.*
2010

21-
# Ignore duplicate module providers
22-
# For RN Apps installed via npm, "Libraries" folder is inside node_modules/react-native but in the source repo it is in the root
11+
; Ignore duplicate module providers
12+
; For RN Apps installed via npm, "Libraries" folder is inside
13+
; "node_modules/react-native" but in the source repo it is in the root
2314
.*/Libraries/react-native/React.js
2415
.*/Libraries/react-native/ReactNative.js
25-
.*/node_modules/jest-runtime/build/__tests__/.*
2616

2717
[include]
2818

@@ -34,9 +24,6 @@ flow/
3424
[options]
3525
module.system=haste
3626

37-
esproposal.class_static_fields=enable
38-
esproposal.class_instance_fields=enable
39-
4027
experimental.strict_type_args=true
4128

4229
munge_underscores=true
@@ -48,11 +35,11 @@ suppress_type=$FlowIssue
4835
suppress_type=$FlowFixMe
4936
suppress_type=$FixMe
5037

51-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-2]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
52-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-2]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
38+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-5]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
39+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-5]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
5340
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
5441

5542
unsafe.enable_getters_and_setters=true
5643

5744
[version]
58-
^0.32.0
45+
^0.35.0

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.pbxproj -text

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@ DerivedData
2222
*.xcuserstate
2323
project.xcworkspace
2424

25-
# Android/IJ
25+
# Android/IntelliJ
2626
#
27-
*.iml
27+
build/
2828
.idea
2929
.gradle
3030
local.properties
31+
*.iml
3132

3233
# node.js
3334
#
@@ -38,4 +39,4 @@ npm-debug.log
3839
buck-out/
3940
\.buckd/
4041
android/app/libs
41-
android/keystores/debug.keystore
42+
*.keystore

__tests__/index.android.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import 'react-native';
2+
import React from 'react';
3+
import Index from '../index.android.js';
4+
5+
// Note: test renderer must be required after react-native.
6+
import renderer from 'react-test-renderer';
7+
8+
it('renders correctly', () => {
9+
const tree = renderer.create(
10+
<Index />
11+
);
12+
});

__tests__/index.ios.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import 'react-native';
2+
import React from 'react';
3+
import Index from '../index.ios.js';
4+
5+
// Note: test renderer must be required after react-native.
6+
import renderer from 'react-test-renderer';
7+
8+
it('renders correctly', () => {
9+
const tree = renderer.create(
10+
<Index />
11+
);
12+
});

android/app/build.gradle

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ android {
9292
minSdkVersion 16
9393
targetSdkVersion 22
9494
versionCode 1
95-
versionName "1.0.2"
95+
versionName "1.0"
9696
ndk {
9797
abiFilters "armeabi-v7a", "x86"
9898
}
@@ -105,19 +105,10 @@ android {
105105
include "armeabi-v7a", "x86"
106106
}
107107
}
108-
signingConfigs {
109-
release {
110-
keyAlias "androiddebugkey"
111-
keyPassword "android"
112-
storeFile file("../keystores/debug.keystore")
113-
storePassword "android"
114-
}
115-
}
116108
buildTypes {
117109
release {
118110
minifyEnabled enableProguardInReleaseBuilds
119111
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
120-
signingConfig signingConfigs.release
121112
}
122113
}
123114
// applicationVariants are e.g. debug, release
@@ -145,6 +136,6 @@ dependencies {
145136
// Run this once to be able to run the application with BUCK
146137
// puts all compile dependencies into folder libs for BUCK to use
147138
task copyDownloadableDepsToLibs(type: Copy) {
148-
from configurations.compile
149-
into 'libs'
139+
from configurations.compile
140+
into 'libs'
150141
}

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
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.facebook.react.ReactInstanceManager;
79
import com.facebook.react.ReactNativeHost;
810
import com.facebook.react.ReactPackage;
911
import com.facebook.react.shell.MainReactPackage;
12+
import com.facebook.soloader.SoLoader;
1013

1114
import java.util.Arrays;
1215
import java.util.List;
@@ -29,18 +32,19 @@ protected boolean getUseDeveloperSupport() {
2932
protected List<ReactPackage> getPackages() {
3033
return Arrays.<ReactPackage>asList(
3134
new MainReactPackage(),
32-
new CodePush(
33-
"BPPCDEeergFkpHur4YNXCjqXVjR6qLF160UDg",
34-
getApplicationContext(),
35-
BuildConfig.DEBUG,
36-
"http://codepush.19910225.com:8080/"
37-
)
35+
new CodePush(getResources().getString(R.string.reactNativeCodePush_androidDeploymentKey), getApplicationContext(), BuildConfig.DEBUG, "http://codepush.19910225.com:8080/")
3836
);
3937
}
4038
};
4139

4240
@Override
4341
public ReactNativeHost getReactNativeHost() {
44-
return mReactNativeHost;
42+
return mReactNativeHost;
43+
}
44+
45+
@Override
46+
public void onCreate() {
47+
super.onCreate();
48+
SoLoader.init(this, /* native exopackage */ false);
4549
}
4650
}
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<resources>
22
<string moduleConfig="true" name="reactNativeCodePush_androidDeploymentKey">BPPCDEeergFkpHur4YNXCjqXVjR6qLF160UDg</string>
3-
<string moduleConfig="true" name="reactNativeCodePush_androidDeploymentURL">http://codepush.19910225.com:8080/</string>
43
<string name="app_name">CodePushDemoApp</string>
54
</resources>

android/settings.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
rootProject.name = 'CodePushDemoApp'
2-
3-
include ':app'
42
include ':react-native-code-push'
53
project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-code-push/android/app')
4+
5+
include ':app'

0 commit comments

Comments
 (0)