Skip to content

Commit d653f0e

Browse files
steveluscherFacebook Github Bot 9
authored andcommitted
Polish the doorknobs for 0.9.0
Summary: Closes #1174 Reviewed By: kassens Differential Revision: D3357437 Pulled By: steveluscher fbshipit-source-id: 450f3aea9c14c1638841732ec0d13a1a5a7b8c7c
1 parent 1ae9c3e commit d653f0e

File tree

37 files changed

+1143
-392
lines changed

37 files changed

+1143
-392
lines changed

examples/TodoMVC/.buckconfig

Lines changed: 6 additions & 0 deletions
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/TodoMVC/.flowconfig

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@
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
19-
.*/node_modules/fbjs/lib/fetch.js
20-
.*/node_modules/fbjs/lib/ExecutionEnvironment.js
21-
.*/node_modules/fbjs/lib/isEmpty.js
22-
.*/node_modules/fbjs/lib/crc32.js
2318
.*/node_modules/fbjs/lib/ErrorUtils.js
2419

2520
# Flow has a built-in definition for the 'react' module which we prefer to use
@@ -28,6 +23,11 @@
2823
.*/node_modules/react/lib/React.js
2924
.*/node_modules/react/lib/ReactDOM.js
3025

26+
.*/__mocks__/.*
27+
.*/__tests__/.*
28+
29+
.*/commoner/test/source/widget/share.js
30+
3131
# Ignore commoner tests
3232
.*/node_modules/commoner/test/.*
3333

@@ -40,25 +40,54 @@
4040
# Ignore Website
4141
.*/website/.*
4242

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

4569
[libs]
4670
node_modules/react-native/Libraries/react-native/react-native-interface.js
71+
node_modules/react-native/flow
72+
flow/
4773

4874
[options]
4975
module.system=haste
5076

77+
esproposal.class_static_fields=enable
78+
esproposal.class_instance_fields=enable
79+
5180
munge_underscores=true
5281

5382
module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub'
54-
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'
83+
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'
5584

5685
suppress_type=$FlowIssue
5786
suppress_type=$FlowFixMe
5887
suppress_type=$FixMe
5988

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]+
89+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-4]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
90+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-4]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
6291
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
6392

6493
[version]

examples/TodoMVC/.gitignore

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

examples/TodoMVC/android/app/build.gradle

Lines changed: 9 additions & 2 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
@@ -59,7 +59,7 @@ import com.android.build.OutputFile
5959
* ]
6060
*/
6161

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

6464
/**
6565
* Set this to true to create two separate APKs instead of one:
@@ -124,3 +124,10 @@ dependencies {
124124
compile "com.android.support:appcompat-v7:23.0.1"
125125
compile "com.facebook.react:react-native:+" // From node_modules
126126
}
127+
128+
// Run this once to be able to run the application with BUCK
129+
// puts all compile dependencies into folder libs for BUCK to use
130+
task copyDownloadableDepsToLibs(type: Copy) {
131+
from configurations.compile
132+
into 'libs'
133+
}

examples/TodoMVC/android/app/proguard-rules.pro

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,3 @@
6161
-dontwarn java.nio.file.*
6262
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
6363
-dontwarn okio.**
64-
65-
# stetho
66-
67-
-dontwarn com.facebook.stetho.**

examples/TodoMVC/components/TodoList.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ class TodoList extends Component {
138138
</View>
139139
<ListView
140140
dataSource={this.state.todosDataSource}
141+
enableEmptySections={true}
141142
initialListSize={this.state.initialListSize}
142143
renderRow={this.renderTodoEdge}
143144
renderSeparator={this.renderSeparator}
@@ -162,14 +163,16 @@ export default Relay.createContainer(TodoList, {
162163
}
163164
return {
164165
status: nextStatus,
165-
limit: 2147483647, // GraphQLInt
166166
};
167167
},
168168
fragments: {
169169
viewer: () => Relay.QL`
170170
fragment on User {
171171
completedCount
172-
todos(status: $status, first: $limit) {
172+
todos(
173+
status: $status,
174+
first: 2147483647 # max GraphQLInt
175+
) {
173176
edges {
174177
node {
175178
id

examples/TodoMVC/components/TodoListFooter.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,14 @@ export default Relay.createContainer(TodoListFooter, {
6464
initialVariables: {
6565
status: 'any',
6666
},
67-
prepareVariables(prevVars) {
68-
return {
69-
...prevVars,
70-
limit: 2147483647, // GraphQLInt
71-
};
72-
},
7367
fragments: {
7468
viewer: () => Relay.QL`
7569
fragment on User {
7670
completedCount
77-
todos(status: $status, first: $limit) {
71+
todos(
72+
status: $status,
73+
first: 2147483647 # max GraphQLInt
74+
) {
7875
${RemoveCompletedTodosMutation.getFragment('todos')}
7976
}
8077
totalCount

examples/TodoMVC/data/schema.graphql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
schema {
2+
query: Root
3+
mutation: Mutation
4+
}
5+
16
input AddTodoInput {
27
text: String!
38
clientMutationId: String!

0 commit comments

Comments
 (0)