Skip to content

Commit

Permalink
[flow] Update the documentation and the example (#9679)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored Dec 31, 2017
1 parent bd42549 commit 60a498d
Show file tree
Hide file tree
Showing 17 changed files with 1,422 additions and 916 deletions.
2 changes: 1 addition & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ module.ignore_non_literal_requires=true
module.system.node.resolve_dirname=node_modules
module.system.node.resolve_dirname=.

suppress_type=$FlowFixMe
suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe
suppress_comment= \\(.\\|\n\\)*\\$FlowExpectedError
suppress_type=$FlowToDo

[lints]

Expand Down
22 changes: 11 additions & 11 deletions docs/src/modules/components/withRoot.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,38 +66,38 @@ const pages = [
title: 'API',
},
{
pathname: '/guides/composition',
pathname: '/guides/minimizing-bundle-size',
},
{
pathname: '/guides/minimizing-bundle-size',
pathname: '/guides/interoperability',
title: 'Style Library Interoperability',
},
{
pathname: '/guides/server-rendering',
pathname: '/guides/migration-v0.x',
title: 'Migration from v0.x',
},
{
pathname: '/guides/testing',
pathname: '/guides/server-rendering',
},
{
pathname: '/guides/migration-v0.x',
title: 'Migration from v0.x',
pathname: '/guides/composition',
},
{
pathname: '/guides/comparison',
},
{
pathname: '/guides/flow',
pathname: '/guides/testing',
},
{
pathname: '/guides/typescript',
title: 'TypeScript',
},
{
pathname: '/guides/right-to-left',
title: 'Right-to-left',
pathname: '/guides/flow',
},
{
pathname: '/guides/interoperability',
title: 'Style Library Interoperability',
pathname: '/guides/right-to-left',
title: 'Right-to-left',
},
],
},
Expand Down
5 changes: 5 additions & 0 deletions docs/src/pages/guides/flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
You can add static typing to JavaScript to improve developer productivity and code quality thanks to [Flow](https://github.com/facebook/flow).
Have a look at the [Create React App with Flow](https://github.com/mui-org/material-ui/tree/v1-beta/examples/create-react-app-with-flow) example.

## flow-typed

[flow-typed](https://github.com/flowtype/flow-typed) is a repository of third-party library interface definitions for use with Flow.
The community is maintaining [the definitions under this project](https://github.com/flowtype/flow-typed/tree/master/definitions/npm/material-ui_v1.x.x).

## Warning

An [existing bug in flow regarding the use of higher order components (HOC)](https://github.com/facebook/flow/issues/5382)
Expand Down
31 changes: 16 additions & 15 deletions examples/create-react-app-with-flow/.flowconfig
Original file line number Diff line number Diff line change
@@ -1,35 +1,36 @@
[ignore]
<PROJECT_ROOT>/build/.*
.*/node_modules/editions
.*/node_modules/babel-plugin-flow-react-proptypes
.*/node_modules/babel-plugin-transform-react-remove-prop-types
.*/node_modules/eslint-plugin-jsx-a11y
.*/node_modules/graphql
.*/node_modules/kefir
.*/node_modules/react-event-listener/src

; Comment this line if you do not use enzyme.
.*/node_modules/material-ui/test-utils

; flow 55

<PROJECT_ROOT>/build
; FIXME: we should be flow checking against jss
.*/node_modules/jss/lib/.*\.js\.flow

[include]

[libs]

# local/custom libdefs
./flow
;./node_modules/jss/flow-typed

[options]

include_warnings=true
esproposal.class_static_fields=enable
esproposal.class_instance_fields=enable
esproposal.export_star_as=enable
esproposal.decorators=ignore

unsafe.enable_getters_and_setters=true

suppress_type=$FlowFixMe
suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe
suppress_comment= \\(.\\|\n\\)*\\$FlowIgnore

[lints]

all=error
sketchy-null-bool=off
sketchy-null-mixed=off
sketchy-null-number=off
sketchy-null-string=off
unclear-type=off
untyped-import=off
untyped-type-import=off
6 changes: 3 additions & 3 deletions examples/create-react-app-with-flow/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Create React App example with Flow

## Warning
An [existing bug in flow regarding the use of higher order components (HOC)](https://github.com/facebook/flow/issues/5382)
limits the usefulness of flow by an application. As of November 27, 2017 we cannot recommend the use of flow
## Warning
An [existing bug in flow regarding the use of higher order components (HOC)](https://github.com/facebook/flow/issues/5382)
limits the usefulness of flow by an application. As of November 27, 2017 we cannot recommend the use of flow
typing in your application in conjunction with `material-ui`.

This issue is under discussion in [#9312](https://github.com/mui-org/material-ui/issues/9312).
Expand Down
249 changes: 0 additions & 249 deletions examples/create-react-app-with-flow/flow-typed/npm/enzyme_vx.x.x.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// flow-typed signature: 80f037b2a5143b759b6803da758cefe8
// flow-typed version: <<STUB>>/jss-preset-default_v^3.0.0/flow_v0.55.0
// flow-typed signature: d802715bad60306334f6654afd9ac46d
// flow-typed version: <<STUB>>/jss-preset-default_v^4.0.0/flow_v0.56.0

/**
* This is an autogenerated libdef stub for:
Expand Down
Loading

0 comments on commit 60a498d

Please sign in to comment.