Skip to content

Commit b407bf0

Browse files
committed
RN 0.28.0 -> 0.43.4
1 parent dd92b61 commit b407bf0

26 files changed

Lines changed: 1134 additions & 341 deletions

File tree

.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+
}

.flowconfig

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

3-
# We fork some components by platform.
4-
.*/*.web.js
5-
.*/*.android.js
5+
; Ignore "BUCK" generated dirs
6+
<PROJECT_ROOT>/\.buckd/
67

7-
# Some modules have their own node_modules with overlap
8-
.*/node_modules/node-haste/.*
8+
; Ignore unexpected extra "@providesModule"
9+
.*/node_modules/.*/node_modules/fbjs/.*
910

10-
# Ugh
11-
.*/node_modules/babel.*
12-
.*/node_modules/babylon.*
13-
.*/node_modules/invariant.*
14-
15-
# Ignore react and fbjs where there are overlaps, but don't ignore
16-
# anything that react-native relies on
17-
.*/node_modules/fbjs/lib/Map.js
18-
.*/node_modules/fbjs/lib/fetch.js
19-
.*/node_modules/fbjs/lib/ExecutionEnvironment.js
20-
.*/node_modules/fbjs/lib/ErrorUtils.js
21-
22-
# Flow has a built-in definition for the 'react' module which we prefer to use
23-
# over the currently-untyped source
24-
.*/node_modules/react/react.js
25-
.*/node_modules/react/lib/React.js
26-
.*/node_modules/react/lib/ReactDOM.js
27-
28-
.*/__mocks__/.*
29-
.*/__tests__/.*
30-
31-
.*/commoner/test/source/widget/share.js
32-
33-
# Ignore commoner tests
34-
.*/node_modules/commoner/test/.*
35-
36-
# See https://github.com/facebook/flow/issues/442
37-
.*/react-tools/node_modules/commoner/lib/reader.js
38-
39-
# Ignore jest
40-
.*/node_modules/jest-cli/.*
41-
42-
# Ignore Website
43-
.*/website/.*
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
14+
.*/Libraries/react-native/React.js
15+
.*/Libraries/react-native/ReactNative.js
4416

4517
[include]
4618

4719
[libs]
4820
node_modules/react-native/Libraries/react-native/react-native-interface.js
21+
node_modules/react-native/flow
22+
flow/
4923

5024
[options]
25+
emoji=true
26+
5127
module.system=haste
5228

53-
esproposal.class_static_fields=enable
54-
esproposal.class_instance_fields=enable
29+
experimental.strict_type_args=true
5530

5631
munge_underscores=true
5732

58-
module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub'
59-
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\)$' -> 'RelativeImageStub'
33+
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'
6034

6135
suppress_type=$FlowIssue
6236
suppress_type=$FlowFixMe
6337
suppress_type=$FixMe
6438

65-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-1]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
66-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-1]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
39+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-0]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
40+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-0]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
6741
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
42+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
43+
44+
unsafe.enable_getters_and_setters=true
6845

6946
[version]
70-
0.21.0
47+
^0.40.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: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ DerivedData
2222
*.xcuserstate
2323
project.xcworkspace
2424

25-
# Android/IJ
25+
# Android/IntelliJ
2626
#
27+
build/
2728
.idea
2829
.gradle
2930
local.properties
31+
*.iml
3032

3133
# Web
3234
#
@@ -36,7 +38,20 @@ local.properties
3638
#
3739
node_modules/
3840
npm-debug.log
39-
src/testKey.js
41+
yarn-error.log
42+
43+
# BUCK
44+
buck-out/
45+
\.buckd/
4046
*.keystore
41-
main.jsbundle
42-
ios/noder/build
47+
48+
# fastlane
49+
#
50+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
51+
# screenshots whenever they are needed.
52+
# For more information about the recommended setup visit:
53+
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
54+
55+
fastlane/report.xml
56+
fastlane/Preview.html
57+
fastlane/screenshots

README.md

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Noder - A React-Native Client for [cnodejs.org](http://cnodejs.org)
2-
3-
> A new [cnodejs.org](http://cnodejs.org) mobile app powered by [React-Native](http://facebook.github.io/react-native/) and [Redux](https://github.com/gaearon/redux).
2+
3+
> A new [cnodejs.org](http://cnodejs.org) mobile app powered by [React-Native](http://facebook.github.io/react-native/) and [Redux](https://github.com/gaearon/redux).
44
55

66
## Install
@@ -15,7 +15,8 @@
1515
For local development you need to follow the below commands:
1616

1717
```
18-
git clone https://github.com/soliury/noder-react-native.git
18+
git clone https://github.com/soliury/noder-react-native.git noder
19+
cd noder
1920
npm install
2021
```
2122

@@ -24,23 +25,15 @@ Click the run button in Xcode, if something went wrong, you need to rebuild all
2425

2526
If you want to run it on your iPhone, please follow the [Offical Doc](http://facebook.github.io/react-native/docs/runningondevice.html#content).
2627

27-
If you don't want to update the ip manually, please run:
28-
29-
```
30-
gulp replace
31-
```
32-
33-
BTW, here is a prettier command, just run:
34-
28+
If you want to run it on your Android, please run:
3529
```
30+
npm run android
3631
npm start
3732
```
3833

39-
The ip will be replaced automatically.
40-
4134
If you want to run it on your Browser (localhost:3000), please run:
4235
```
43-
react-web start
36+
npm run web
4437
```
4538

4639

@@ -58,6 +51,7 @@ react-web start
5851
* [react-native-html-render](https://github.com/soliury/react-native-html-render)
5952
* [react-native-scrollable-tab-view](https://github.com/brentvatne/react-native-scrollable-tab-view)
6053
* [react-native-vector-icons](https://github.com/oblador/react-native-vector-icons)
54+
* [react-web](https://github.com/flyskywhy/react-web)
6155

6256
This project is heavily influenced by the above modules.
6357

@@ -68,7 +62,7 @@ This project is heavily influenced by the above modules.
6862
* In ListView, sometime items on the bottom can't be refreshed
6963
* ListView **take too much memory**
7064
* HTML to native View render take too much **memory and CPU time**
71-
* Add Unit testing
65+
* Add Unit testing
7266

7367
## Change log
7468

__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/BUCK

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# To learn about Buck see [Docs](https://buckbuild.com/).
2+
# To run your application with Buck:
3+
# - install Buck
4+
# - `npm start` - to start the packager
5+
# - `cd android`
6+
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
7+
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
8+
# - `buck install -r android/app` - compile, install and run application
9+
#
10+
11+
lib_deps = []
12+
13+
for jarfile in glob(['libs/*.jar']):
14+
name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')]
15+
lib_deps.append(':' + name)
16+
prebuilt_jar(
17+
name = name,
18+
binary_jar = jarfile,
19+
)
20+
21+
for aarfile in glob(['libs/*.aar']):
22+
name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')]
23+
lib_deps.append(':' + name)
24+
android_prebuilt_aar(
25+
name = name,
26+
aar = aarfile,
27+
)
28+
29+
android_library(
30+
name = "all-libs",
31+
exported_deps = lib_deps,
32+
)
33+
34+
android_library(
35+
name = "app-code",
36+
srcs = glob([
37+
"src/main/java/**/*.java",
38+
]),
39+
deps = [
40+
":all-libs",
41+
":build_config",
42+
":res",
43+
],
44+
)
45+
46+
android_build_config(
47+
name = "build_config",
48+
package = "com.noder",
49+
)
50+
51+
android_resource(
52+
name = "res",
53+
package = "com.noder",
54+
res = "src/main/res",
55+
)
56+
57+
android_binary(
58+
name = "app",
59+
keystore = "//android/keystores:debug",
60+
manifest = "src/main/AndroidManifest.xml",
61+
package_type = "debug",
62+
deps = [
63+
":app-code",
64+
],
65+
)

android/app/build.gradle

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import com.android.build.OutputFile
99
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
1010
* bundle directly from the development server. Below you can see all the possible configurations
1111
* and their defaults. If you decide to add a configuration block, make sure to add it before the
12-
* `apply from: "react.gradle"` line.
12+
* `apply from: "../../node_modules/react-native/react.gradle"` line.
1313
*
1414
* project.ext.react = [
1515
* // the name of the generated asset file containing your JS bundle
@@ -55,11 +55,17 @@ import com.android.build.OutputFile
5555
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
5656
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
5757
* // for example, you might want to remove it from here.
58-
* inputExcludes: ["android/**", "ios/**"]
58+
* inputExcludes: ["android/**", "ios/**"],
59+
*
60+
* // override which node gets called and with what additional arguments
61+
* nodeExecutableAndArgs: ["node"]
62+
*
63+
* // supply additional arguments to the packager
64+
* extraPackagerArgs: []
5965
* ]
6066
*/
6167

62-
apply from: "react.gradle"
68+
apply from: "../../node_modules/react-native/react.gradle"
6369

6470
/**
6571
* Set this to true to create two separate APKs instead of one:
@@ -153,3 +159,10 @@ buildscript {
153159
classpath 'com.fivehundredpx:blurringview:1.0.0'
154160
}
155161
}
162+
163+
// Run this once to be able to run the application with BUCK
164+
// puts all compile dependencies into folder libs for BUCK to use
165+
task copyDownloadableDepsToLibs(type: Copy) {
166+
from configurations.compile
167+
into 'libs'
168+
}

android/app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@
66
<uses-permission android:name="android.permission.VIBRATE"/>
77

88
<application
9+
android:name=".MainApplication"
910
android:allowBackup="true"
1011
android:label="@string/app_name"
1112
android:icon="@mipmap/ic_launcher"
1213
android:theme="@style/AppTheme">
1314
<activity
1415
android:name=".MainActivity"
1516
android:label="@string/app_name"
16-
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
17+
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
18+
android:windowSoftInputMode="adjustResize">
1719
<intent-filter>
1820
<action android:name="android.intent.action.MAIN" />
1921
<category android:name="android.intent.category.LAUNCHER" />

0 commit comments

Comments
 (0)