-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add flow-type into the Stack #1
Open
zepod
wants to merge
3
commits into
master
Choose a base branch
from
flow-type
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+348
−123
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[ignore] | ||
.*/node_modules/fbjs/* | ||
|
||
|
||
[include] | ||
./src/browser/App.react.js | ||
|
||
[libs] | ||
|
||
[options] | ||
module.ignore_non_literal_requires=true | ||
esproposal.class_instance_fields=enable | ||
esproposal.class_static_fields=enable | ||
esproposal.decorators=ignore | ||
esproposal.export_star_as=enable | ||
strip_root=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* | ||
If Flow throws "Required module not found", altough module is not missing, | ||
add new "declare module" statement here for that library. | ||
*/ | ||
|
||
declare module 'react-helmet' { | ||
declare module.exports: any; | ||
} | ||
|
||
declare var webpackIsomorphicTools: Object; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
const BrowserProvider = ({ children }) => children; | ||
// @flow | ||
|
||
const BrowserProvider = ({ children } : Object) : Object => children; | ||
export default BrowserProvider; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,24 @@ | ||
// @flow | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import App from './App.react'; | ||
import BrowserProvider from './BrowserProvider.react'; | ||
|
||
type Module = { | ||
hot: { accept: (Component: Function, callback: (updatedComponent: Function) => void) => void } | ||
} | Object; | ||
|
||
const renderApp = () => { | ||
ReactDOM.render( | ||
<BrowserProvider> | ||
<App /> | ||
</BrowserProvider>, | ||
window.document.getElementById('app') | ||
window.document.getElementById('app'), | ||
); | ||
}; | ||
|
||
if (module && module.hot && module.hot.accept) { | ||
module.hot.accept(App, renderApp); | ||
(module: Module).hot.accept(App, renderApp); | ||
} | ||
|
||
renderApp(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
// @flow | ||
import React, { PropTypes as RPT } from 'react'; | ||
|
||
const Script = ({ src }) => (<script src={src} type="text/javascript" />); | ||
const Script = (props: { src: string }) => ( | ||
<script src={props.src} type="text/javascript" /> | ||
); | ||
|
||
Script.propTypes = { | ||
src: RPT.string.isRequired | ||
src: RPT.string.isRequired, | ||
}; | ||
|
||
export default Script; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
// @flow | ||
import React, { PropTypes as RPT } from 'react'; | ||
|
||
const NotFound = ({ path }) => ( | ||
const NotFound = ({ path }: { path: string }) => ( | ||
<div> | ||
<h1>404: Needle ({path}) not found in Haystack :(</h1> | ||
You can redirect to <a href="/">home</a>. | ||
</div> | ||
); | ||
|
||
NotFound.propTypes = { | ||
path: RPT.string.isRequired | ||
path: RPT.string.isRequired, | ||
}; | ||
|
||
export default NotFound; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zepod https://github.com/flowtype/flow-typed is nice lib which is adding existing type definition instead of you. You can just run
flow-typed install
and It installs exist declared types or creates new (with "any") for not existing.