Skip to content

Commit 046cb33

Browse files
committed
update rn to v24
1 parent d570bc7 commit 046cb33

File tree

10 files changed

+142
-16
lines changed

10 files changed

+142
-16
lines changed

Button.android.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const React = require('react');
12
const ReactNative = require('react-native');
23
const {
34
TouchableNativeFeedback,

Button.ios.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const React = require('react');
12
const ReactNative = require('react-native');
23
const {
34
TouchableOpacity,
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
[android]
3+
target = Google Inc.:Google APIs:23
4+
5+
[maven_repositories]
6+
central = https://repo1.maven.org/maven2

examples/FacebookTabsExample/.flowconfig

+37-6
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,8 @@
1515
# Ignore react and fbjs where there are overlaps, but don't ignore
1616
# anything that react-native relies on
1717
.*/node_modules/fbjs/lib/Map.js
18-
.*/node_modules/fbjs/lib/Promise.js
1918
.*/node_modules/fbjs/lib/fetch.js
2019
.*/node_modules/fbjs/lib/ExecutionEnvironment.js
21-
.*/node_modules/fbjs/lib/isEmpty.js
22-
.*/node_modules/fbjs/lib/crc32.js
2320
.*/node_modules/fbjs/lib/ErrorUtils.js
2421

2522
# Flow has a built-in definition for the 'react' module which we prefer to use
@@ -28,6 +25,11 @@
2825
.*/node_modules/react/lib/React.js
2926
.*/node_modules/react/lib/ReactDOM.js
3027

28+
.*/__mocks__/.*
29+
.*/__tests__/.*
30+
31+
.*/commoner/test/source/widget/share.js
32+
3133
# Ignore commoner tests
3234
.*/node_modules/commoner/test/.*
3335

@@ -40,14 +42,43 @@
4042
# Ignore Website
4143
.*/website/.*
4244

45+
# Ignore generators
46+
.*/local-cli/generator.*
47+
48+
# Ignore BUCK generated folders
49+
.*\.buckd/
50+
51+
.*/node_modules/is-my-json-valid/test/.*\.json
52+
.*/node_modules/iconv-lite/encodings/tables/.*\.json
53+
.*/node_modules/y18n/test/.*\.json
54+
.*/node_modules/spdx-license-ids/spdx-license-ids.json
55+
.*/node_modules/spdx-exceptions/index.json
56+
.*/node_modules/resolve/test/subdirs/node_modules/a/b/c/x.json
57+
.*/node_modules/resolve/lib/core.json
58+
.*/node_modules/jsonparse/samplejson/.*\.json
59+
.*/node_modules/json5/test/.*\.json
60+
.*/node_modules/ua-parser-js/test/.*\.json
61+
.*/node_modules/builtin-modules/builtin-modules.json
62+
.*/node_modules/binary-extensions/binary-extensions.json
63+
.*/node_modules/url-regex/tlds.json
64+
.*/node_modules/joi/.*\.json
65+
.*/node_modules/isemail/.*\.json
66+
.*/node_modules/tr46/.*\.json
67+
68+
4369
[include]
4470

4571
[libs]
4672
node_modules/react-native/Libraries/react-native/react-native-interface.js
73+
node_modules/react-native/flow
74+
flow/
4775

4876
[options]
4977
module.system=haste
5078

79+
esproposal.class_static_fields=enable
80+
esproposal.class_instance_fields=enable
81+
5182
munge_underscores=true
5283

5384
module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub'
@@ -57,9 +88,9 @@ suppress_type=$FlowIssue
5788
suppress_type=$FlowFixMe
5889
suppress_type=$FixMe
5990

60-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-1]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
61-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-1]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
91+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-2]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
92+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-2]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
6293
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
6394

6495
[version]
65-
0.21.0
96+
^0.22.0

examples/FacebookTabsExample/.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,9 @@ local.properties
3232
#
3333
node_modules/
3434
npm-debug.log
35+
36+
# BUCK
37+
buck-out/
38+
\.buckd/
39+
android/app/libs
40+
android/keystores/debug.keystore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import re
2+
3+
# To learn about Buck see [Docs](https://buckbuild.com/).
4+
# To run your application with Buck:
5+
# - install Buck
6+
# - `npm start` - to start the packager
7+
# - `cd android`
8+
# - `cp ~/.android/debug.keystore keystores/debug.keystore`
9+
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
10+
# - `buck install -r android/app` - compile, install and run application
11+
#
12+
13+
lib_deps = []
14+
for jarfile in glob(['libs/*.jar']):
15+
name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile)
16+
lib_deps.append(':' + name)
17+
prebuilt_jar(
18+
name = name,
19+
binary_jar = jarfile,
20+
)
21+
22+
for aarfile in glob(['libs/*.aar']):
23+
name = 'aars__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile)
24+
lib_deps.append(':' + name)
25+
android_prebuilt_aar(
26+
name = name,
27+
aar = aarfile,
28+
)
29+
30+
android_library(
31+
name = 'all-libs',
32+
exported_deps = lib_deps
33+
)
34+
35+
android_library(
36+
name = 'app-code',
37+
srcs = glob([
38+
'src/main/java/**/*.java',
39+
]),
40+
deps = [
41+
':all-libs',
42+
':build_config',
43+
':res',
44+
],
45+
)
46+
47+
android_build_config(
48+
name = 'build_config',
49+
package = 'com.facebooktabsexample',
50+
)
51+
52+
android_resource(
53+
name = 'res',
54+
res = 'src/main/res',
55+
package = 'com.facebooktabsexample',
56+
)
57+
58+
android_binary(
59+
name = 'app',
60+
package_type = 'debug',
61+
manifest = 'src/main/AndroidManifest.xml',
62+
keystore = '//android/keystores:debug',
63+
deps = [
64+
':app-code',
65+
],
66+
)

examples/FacebookTabsExample/android/app/build.gradle

+16-8
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
@@ -26,7 +26,9 @@ import com.android.build.OutputFile
2626
*
2727
* // whether to bundle JS and assets in another build variant (if configured).
2828
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
29-
* // The configuration property is in the format 'bundleIn${productFlavor}${buildType}'
29+
* // The configuration property can be in the following formats
30+
* // 'bundleIn${productFlavor}${buildType}'
31+
* // 'bundleIn${buildType}'
3032
* // bundleInFreeDebug: true,
3133
* // bundleInPaidRelease: true,
3234
* // bundleInBeta: true,
@@ -57,11 +59,10 @@ import com.android.build.OutputFile
5759
* ]
5860
*/
5961

60-
apply from: "react.gradle"
62+
apply from: "../../node_modules/react-native/react.gradle"
6163

6264
/**
63-
* Set this to true to create three separate APKs instead of one:
64-
* - A universal APK that works on all devices
65+
* Set this to true to create two separate APKs instead of one:
6566
* - An APK that only works on ARM devices
6667
* - An APK that only works on x86 devices
6768
* The advantage is the size of the APK is reduced by about 4MB.
@@ -91,9 +92,9 @@ android {
9192
}
9293
splits {
9394
abi {
94-
enable enableSeparateBuildPerCPUArchitecture
95-
universalApk false
9695
reset()
96+
enable enableSeparateBuildPerCPUArchitecture
97+
universalApk false // If true, also generate a universal APK
9798
include "armeabi-v7a", "x86"
9899
}
99100
}
@@ -122,5 +123,12 @@ dependencies {
122123
compile project(':react-native-vector-icons')
123124
compile fileTree(dir: "libs", include: ["*.jar"])
124125
compile "com.android.support:appcompat-v7:23.0.1"
125-
compile "com.facebook.react:react-native:0.20.+"
126+
compile "com.facebook.react:react-native:+" // From node_modules
127+
}
128+
129+
// Run this once to be able to run the application with BUCK
130+
// puts all compile dependencies into folder libs for BUCK to use
131+
task copyDownloadableDepsToLibs(type: Copy) {
132+
from configurations.compile
133+
into 'libs'
126134
}

examples/FacebookTabsExample/android/build.gradle

+4
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,9 @@ allprojects {
1616
repositories {
1717
mavenLocal()
1818
jcenter()
19+
maven {
20+
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
21+
url "$projectDir/../../node_modules/react-native/android"
22+
}
1923
}
2024
}

examples/FacebookTabsExample/ios/FacebookTabsExample/AppDelegate.m

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
3636
/**
3737
* OPTION 2
3838
* Load from pre-bundled file on disk. The static bundle is automatically
39-
* generated by "Bundle React Native code and images" build step.
39+
* generated by the "Bundle React Native code and images" build step when
40+
* running the project on an actual device or running the project on the
41+
* simulator in the "Release" build configuration.
4042
*/
4143

4244
// jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];

examples/FacebookTabsExample/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"start": "node_modules/react-native/packager/packager.sh"
77
},
88
"dependencies": {
9-
"react-native": "^0.20.0",
9+
"react": "^0.14.8",
10+
"react-native": "^0.24.1",
1011
"react-native-scrollable-tab-view": "../..",
1112
"react-native-vector-icons": "^1.2.0"
1213
}

0 commit comments

Comments
 (0)