Skip to content

Commit 925edd4

Browse files
committed
Update demo to RN 0.42.3
1 parent 88fc3f1 commit 925edd4

File tree

21 files changed

+821
-78
lines changed

21 files changed

+821
-78
lines changed

example/.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["react-native"]
3+
}

example/.flowconfig

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

3-
# We fork some components by platform.
4-
.*/*.android.js
5-
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

@@ -32,27 +22,25 @@ node_modules/react-native/flow
3222
flow/
3323

3424
[options]
35-
module.system=haste
25+
emoji=true
3626

37-
esproposal.class_static_fields=enable
38-
esproposal.class_instance_fields=enable
27+
module.system=haste
3928

4029
experimental.strict_type_args=true
4130

4231
munge_underscores=true
4332

44-
module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub'
4533
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'
4634

4735
suppress_type=$FlowIssue
4836
suppress_type=$FlowFixMe
4937
suppress_type=$FixMe
5038

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

5543
unsafe.enable_getters_and_setters=true
5644

5745
[version]
58-
^0.30.0
46+
^0.38.0

example/.gitattributes

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

example/.gitignore

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,32 @@ 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
#
3435
node_modules/
3536
npm-debug.log
37+
yarn-error.log
3638

3739
# BUCK
3840
buck-out/
3941
\.buckd/
40-
android/app/libs
41-
android/keystores/debug.keystore
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://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
50+
51+
fastlane/report.xml
52+
fastlane/Preview.html
53+
fastlane/screenshots

example/__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+
});

example/__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+
});

example/android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,6 @@ dependencies {
134134
// Run this once to be able to run the application with BUCK
135135
// puts all compile dependencies into folder libs for BUCK to use
136136
task copyDownloadableDepsToLibs(type: Copy) {
137-
from configurations.compile
138-
into 'libs'
137+
from configurations.compile
138+
into 'libs'
139139
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
<activity
2020
android:name=".MainActivity"
2121
android:label="@string/app_name"
22-
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
22+
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
23+
android:windowSoftInputMode="adjustResize">
2324
<intent-filter>
2425
<action android:name="android.intent.action.MAIN" />
2526
<category android:name="android.intent.category.LAUNCHER" />
Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
package com.demo;
22

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

65
import com.facebook.react.ReactApplication;
7-
import com.facebook.react.ReactInstanceManager;
86
import com.facebook.react.ReactNativeHost;
97
import com.facebook.react.ReactPackage;
108
import com.facebook.react.shell.MainReactPackage;
9+
import com.facebook.soloader.SoLoader;
1110

1211
import java.util.Arrays;
1312
import java.util.List;
@@ -16,7 +15,10 @@ public class MainApplication extends Application implements ReactApplication {
1615

1716
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
1817
@Override
19-
protected boolean getUseDeveloperSupport() {
18+
protected String getJSMainModuleName() { return "index"; }
19+
20+
@Override
21+
public boolean getUseDeveloperSupport() {
2022
return BuildConfig.DEBUG;
2123
}
2224

@@ -26,15 +28,16 @@ protected List<ReactPackage> getPackages() {
2628
new MainReactPackage()
2729
);
2830
}
29-
30-
@Override
31-
protected String getJSMainModuleName() {
32-
return "index";
33-
}
3431
};
3532

3633
@Override
3734
public ReactNativeHost getReactNativeHost() {
38-
return mReactNativeHost;
35+
return mReactNativeHost;
36+
}
37+
38+
@Override
39+
public void onCreate() {
40+
super.onCreate();
41+
SoLoader.init(this, /* native exopackage */ false);
3942
}
4043
}

example/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.1.3'
8+
classpath 'com.android.tools.build:gradle:2.2.3'
99

1010
// NOTE: Do not place your application dependencies here; they belong
1111
// in the individual module build.gradle files

example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#Mon Sep 19 15:28:47 CST 2016
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
43
zipStoreBase=GRADLE_USER_HOME

example/app.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "Demo",
3+
"displayName": "Demo"
4+
}

example/ios/Demo-tvOS/Info.plist

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>APPL</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleSignature</key>
20+
<string>????</string>
21+
<key>CFBundleVersion</key>
22+
<string>1</string>
23+
<key>LSRequiresIPhoneOS</key>
24+
<true/>
25+
<key>UILaunchStoryboardName</key>
26+
<string>LaunchScreen</string>
27+
<key>UIRequiredDeviceCapabilities</key>
28+
<array>
29+
<string>armv7</string>
30+
</array>
31+
<key>UISupportedInterfaceOrientations</key>
32+
<array>
33+
<string>UIInterfaceOrientationPortrait</string>
34+
<string>UIInterfaceOrientationLandscapeLeft</string>
35+
<string>UIInterfaceOrientationLandscapeRight</string>
36+
</array>
37+
<key>UIViewControllerBasedStatusBarAppearance</key>
38+
<false/>
39+
<key>NSLocationWhenInUseUsageDescription</key>
40+
<string></string>
41+
<key>NSAppTransportSecurity</key>
42+
<!--See http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/ -->
43+
<dict>
44+
<key>NSExceptionDomains</key>
45+
<dict>
46+
<key>localhost</key>
47+
<dict>
48+
<key>NSExceptionAllowsInsecureHTTPLoads</key>
49+
<true/>
50+
</dict>
51+
</dict>
52+
</dict>
53+
</dict>
54+
</plist>

example/ios/Demo-tvOSTests/Info.plist

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>BNDL</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleSignature</key>
20+
<string>????</string>
21+
<key>CFBundleVersion</key>
22+
<string>1</string>
23+
</dict>
24+
</plist>

0 commit comments

Comments
 (0)