Skip to content

Commit 7910dd1

Browse files
author
Romain Briche
committed
Upgrade example app to RN 0.51.0
1 parent 57b0d6f commit 7910dd1

File tree

10 files changed

+341
-280
lines changed

10 files changed

+341
-280
lines changed

.gitignore

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
1-
# General
2-
#
3-
node_modules/
4-
5-
# Android
6-
#
7-
build/
8-
.gradle/
9-
local.properties
10-
.idea/
11-
*.iml
12-
.classpath
13-
.project
14-
.settings/
15-
161
# OSX
172
#
183
.DS_Store
@@ -33,5 +18,36 @@ xcuserdata
3318
*.moved-aside
3419
DerivedData
3520
*.hmap
21+
*.ipa
3622
*.xcuserstate
3723
project.xcworkspace
24+
25+
# Android/IntelliJ
26+
#
27+
build/
28+
.idea
29+
.gradle
30+
local.properties
31+
*.iml
32+
33+
# node.js
34+
#
35+
node_modules/
36+
npm-debug.log
37+
yarn-error.log
38+
39+
# BUCK
40+
buck-out/
41+
\.buckd/
42+
*.keystore
43+
44+
# fastlane
45+
#
46+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
47+
# screenshots whenever they are needed.
48+
# For more information about the recommended setup visit:
49+
# https://docs.fastlane.tools/best-practices/source-control/
50+
51+
*/fastlane/report.xml
52+
*/fastlane/Preview.html
53+
*/fastlane/screenshots

example/.flowconfig

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@
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/.*
1618

1719
[include]
1820

1921
[libs]
2022
node_modules/react-native/Libraries/react-native/react-native-interface.js
21-
node_modules/react-native/flow
22-
flow/
23+
node_modules/react-native/flow/
2324

2425
[options]
2526
emoji=true
@@ -32,14 +33,16 @@ module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|we
3233

3334
suppress_type=$FlowIssue
3435
suppress_type=$FlowFixMe
36+
suppress_type=$FlowFixMeProps
37+
suppress_type=$FlowFixMeState
3538
suppress_type=$FixMe
3639

37-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-7]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
38-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-7]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
40+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-7]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
41+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-7]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
3942
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
4043
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
4144

4245
unsafe.enable_getters_and_setters=true
4346

4447
[version]
45-
^0.47.0
48+
^0.57.0

example/android/app/build.gradle

Lines changed: 4 additions & 0 deletions
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

7781
/**

example/android/app/src/main/java/com/leo_pharma/analytics_segment_io/example/MainApplication.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ protected List<ReactPackage> getPackages() {
2727
new AnalyticsPackage()
2828
);
2929
}
30+
31+
@Override
32+
protected String getJSMainModuleName() {
33+
return "index";
34+
}
3035
};
3136

3237
@Override

example/index.android.js

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

example/index.ios.js

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import React, { Component } from 'react';
22
import {
3+
AppRegistry,
34
StyleSheet,
45
Text,
56
View
67
} from 'react-native';
78
import Analytics, { AnalyticsConstants } from 'react-native-analytics-segment-io';
89

9-
export default class example extends Component {
10+
class example extends Component {
1011
componentDidMount() {
1112
Analytics.setup('add-segment-key-here', { [AnalyticsConstants.enableAdvertisingTracking]: true, [AnalyticsConstants.debug]: true })
1213
.then(() => {
@@ -46,3 +47,5 @@ const styles = StyleSheet.create({
4647
margin: 10,
4748
},
4849
})
50+
51+
AppRegistry.registerComponent('example', () => example)

example/ios/example/AppDelegate.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
1818
{
1919
NSURL *jsCodeLocation;
2020

21-
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
21+
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
2222

2323
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
2424
moduleName:@"example"

example/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"postinstall": "rm -rf node_modules/react-native-analytics-segment-io/example"
99
},
1010
"dependencies": {
11-
"react": "16.0.0-alpha.12",
12-
"react-native": "0.48.2",
11+
"react": "16.0.0",
12+
"react-native": "0.51.0",
1313
"react-native-analytics-segment-io": "file:../"
1414
},
1515
"devDependencies": {

0 commit comments

Comments
 (0)