Skip to content

Commit

Permalink
Polish the doorknobs for 0.9.0
Browse files Browse the repository at this point in the history
Summary: Closes #1174

Reviewed By: kassens

Differential Revision: D3357437

Pulled By: steveluscher

fbshipit-source-id: 450f3aea9c14c1638841732ec0d13a1a5a7b8c7c
  • Loading branch information
steveluscher authored and Facebook Github Bot 9 committed May 27, 2016
1 parent 1ae9c3e commit d653f0e
Show file tree
Hide file tree
Showing 37 changed files with 1,143 additions and 392 deletions.
6 changes: 6 additions & 0 deletions examples/TodoMVC/.buckconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

[android]
target = Google Inc.:Google APIs:23

[maven_repositories]
central = https://repo1.maven.org/maven2
45 changes: 37 additions & 8 deletions examples/TodoMVC/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@
# Ignore react and fbjs where there are overlaps, but don't ignore
# anything that react-native relies on
.*/node_modules/fbjs/lib/Map.js
.*/node_modules/fbjs/lib/Promise.js
.*/node_modules/fbjs/lib/fetch.js
.*/node_modules/fbjs/lib/ExecutionEnvironment.js
.*/node_modules/fbjs/lib/isEmpty.js
.*/node_modules/fbjs/lib/crc32.js
.*/node_modules/fbjs/lib/ErrorUtils.js

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

.*/__mocks__/.*
.*/__tests__/.*

.*/commoner/test/source/widget/share.js

# Ignore commoner tests
.*/node_modules/commoner/test/.*

Expand All @@ -40,25 +40,54 @@
# Ignore Website
.*/website/.*

# Ignore generators
.*/local-cli/generator.*

# Ignore BUCK generated folders
.*\.buckd/

.*/node_modules/is-my-json-valid/test/.*\.json
.*/node_modules/iconv-lite/encodings/tables/.*\.json
.*/node_modules/y18n/test/.*\.json
.*/node_modules/spdx-license-ids/spdx-license-ids.json
.*/node_modules/spdx-exceptions/index.json
.*/node_modules/resolve/test/subdirs/node_modules/a/b/c/x.json
.*/node_modules/resolve/lib/core.json
.*/node_modules/jsonparse/samplejson/.*\.json
.*/node_modules/json5/test/.*\.json
.*/node_modules/ua-parser-js/test/.*\.json
.*/node_modules/builtin-modules/builtin-modules.json
.*/node_modules/binary-extensions/binary-extensions.json
.*/node_modules/url-regex/tlds.json
.*/node_modules/joi/.*\.json
.*/node_modules/isemail/.*\.json
.*/node_modules/tr46/.*\.json


[include]

[libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/flow
flow/

[options]
module.system=haste

esproposal.class_static_fields=enable
esproposal.class_instance_fields=enable

munge_underscores=true

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

suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FixMe

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

[version]
Expand Down
6 changes: 6 additions & 0 deletions examples/TodoMVC/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,9 @@ local.properties
#
node_modules/
npm-debug.log

# BUCK
buck-out/
\.buckd/
android/app/libs
android/keystores/debug.keystore
11 changes: 9 additions & 2 deletions examples/TodoMVC/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import com.android.build.OutputFile
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
* bundle directly from the development server. Below you can see all the possible configurations
* and their defaults. If you decide to add a configuration block, make sure to add it before the
* `apply from: "react.gradle"` line.
* `apply from: "../../node_modules/react-native/react.gradle"` line.
*
* project.ext.react = [
* // the name of the generated asset file containing your JS bundle
Expand Down Expand Up @@ -59,7 +59,7 @@ import com.android.build.OutputFile
* ]
*/

apply from: "react.gradle"
apply from: "../../node_modules/react-native/react.gradle"

/**
* Set this to true to create two separate APKs instead of one:
Expand Down Expand Up @@ -124,3 +124,10 @@ dependencies {
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
4 changes: 0 additions & 4 deletions examples/TodoMVC/android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,3 @@
-dontwarn java.nio.file.*
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
-dontwarn okio.**

# stetho

-dontwarn com.facebook.stetho.**
7 changes: 5 additions & 2 deletions examples/TodoMVC/components/TodoList.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ class TodoList extends Component {
</View>
<ListView
dataSource={this.state.todosDataSource}
enableEmptySections={true}
initialListSize={this.state.initialListSize}
renderRow={this.renderTodoEdge}
renderSeparator={this.renderSeparator}
Expand All @@ -162,14 +163,16 @@ export default Relay.createContainer(TodoList, {
}
return {
status: nextStatus,
limit: 2147483647, // GraphQLInt
};
},
fragments: {
viewer: () => Relay.QL`
fragment on User {
completedCount
todos(status: $status, first: $limit) {
todos(
status: $status,
first: 2147483647 # max GraphQLInt
) {
edges {
node {
id
Expand Down
11 changes: 4 additions & 7 deletions examples/TodoMVC/components/TodoListFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,14 @@ export default Relay.createContainer(TodoListFooter, {
initialVariables: {
status: 'any',
},
prepareVariables(prevVars) {
return {
...prevVars,
limit: 2147483647, // GraphQLInt
};
},
fragments: {
viewer: () => Relay.QL`
fragment on User {
completedCount
todos(status: $status, first: $limit) {
todos(
status: $status,
first: 2147483647 # max GraphQLInt
) {
${RemoveCompletedTodosMutation.getFragment('todos')}
}
totalCount
Expand Down
5 changes: 5 additions & 0 deletions examples/TodoMVC/data/schema.graphql
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
schema {
query: Root
mutation: Mutation
}

input AddTodoInput {
text: String!
clientMutationId: String!
Expand Down
Loading

0 comments on commit d653f0e

Please sign in to comment.