Skip to content

Commit

Permalink
Update Relay to flow 0.22.0
Browse files Browse the repository at this point in the history
Summary: Closes #926

Reviewed By: josephsavona

Differential Revision: D3029431

Pulled By: kassens

fb-gh-sync-id: 3a4b8b3e1af8ccc6321fd3abddfd21a5bb1841e8
shipit-source-id: 3a4b8b3e1af8ccc6321fd3abddfd21a5bb1841e8
  • Loading branch information
kassens authored and Facebook Github Bot 7 committed Mar 9, 2016
1 parent 56122f4 commit 5dca2bb
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 22 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"eslint": "^1.3.1",
"eslint-plugin-react": "^3.3.1",
"fbjs-scripts": "^0.5.0",
"flow-bin": "0.21.0",
"flow-bin": "0.22.0",
"graphql": "0.4.13",
"gulp": "^3.9.0",
"gulp-babel": "^5.1.0",
Expand Down
2 changes: 1 addition & 1 deletion scripts/babel-relay-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"babel-preset-jest": "^1.0.0",
"eslint": "^1.3.1",
"fbjs-scripts": "^0.6.0-alpha.3",
"flow-bin": "0.21.0",
"flow-bin": "0.22.0",
"glob": "^7.0.3",
"jest-cli": "^0.9.0",
"minimist": "^1.1.3",
Expand Down
3 changes: 2 additions & 1 deletion scripts/babel-relay-plugin/src/.flowconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[ignore]
.*/__fixtures__/.*
.*/__tests__/.*
.*\.json

[include]
../node_modules/
Expand All @@ -13,4 +14,4 @@
[options]

[version]
0.21.0
0.22.0
6 changes: 3 additions & 3 deletions src/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FixMe

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

[version]
0.21.0
0.22.0
14 changes: 7 additions & 7 deletions src/container/RelayContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,12 @@ function createContainerComponent(
containerName
);

this.forceFetch = this.forceFetch.bind(this);
this.getPendingTransactions = this.getPendingTransactions.bind(this);
this.hasFragmentData = this.hasFragmentData.bind(this);
this.hasOptimisticUpdate = this.hasOptimisticUpdate.bind(this);
this.hasPartialData = this.hasPartialData.bind(this);
this.setVariables = this.setVariables.bind(this);
(this: any).forceFetch = this.forceFetch.bind(this);
(this: any).getPendingTransactions = this.getPendingTransactions.bind(this);
(this: any).hasFragmentData = this.hasFragmentData.bind(this);
(this: any).hasOptimisticUpdate = this.hasOptimisticUpdate.bind(this);
(this: any).hasPartialData = this.hasPartialData.bind(this);
(this: any).setVariables = this.setVariables.bind(this);

this._didShowFakeDataWarning = false;
this._fragmentPointers = {};
Expand Down Expand Up @@ -724,7 +724,7 @@ function createContainerComponent(
);
}

render(): ReactElement {
render(): React.Element {
const relayProps: RelayProp = {
forceFetch: this.forceFetch,
getPendingTransactions: this.getPendingTransactions,
Expand Down
4 changes: 2 additions & 2 deletions src/container/RelayRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type RelayRendererProps = {
render?: ?RelayRendererRenderCallback;
};
export type RelayRendererRenderCallback =
(renderArgs: RelayRendererRenderArgs) => ?ReactElement;
(renderArgs: RelayRendererRenderArgs) => ?React.Element;
type RelayRendererRenderArgs = {
done: boolean;
error: ?Error;
Expand Down Expand Up @@ -342,7 +342,7 @@ class RelayRenderer extends React.Component {
this.mounted = false;
}

render(): ?ReactElement {
render(): ?React.Element {
let children;
let shouldUpdate = this._shouldUpdate();
if (shouldUpdate) {
Expand Down
8 changes: 4 additions & 4 deletions src/container/RelayRootContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ type RootContainerProps = {
Component: RelayContainer;
forceFetch?: ?boolean;
onReadyStateChange?: ?(readyState: ReadyState) => void;
renderFailure?: ?(error: Error, retry: ?() => void) => ReactElement;
renderFailure?: ?(error: Error, retry: ?() => void) => React.Element;
renderFetched?: ?(
data: Object,
fetchState: ComponentFetchState
) => ReactElement;
renderLoading?: ?() => ReactElement;
) => React.Element;
renderLoading?: ?() => React.Element;
route: RelayQueryConfigSpec;
};

Expand Down Expand Up @@ -103,7 +103,7 @@ function RelayRootContainer({
renderFetched,
renderLoading,
route,
}: RootContainerProps): ReactElement {
}: RootContainerProps): React.Element {
return (
<RelayRenderer
Container={Component}
Expand Down
6 changes: 3 additions & 3 deletions src/network-layer/default/RelayDefaultNetworkLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ class RelayDefaultNetworkLayer {
this._init = {...init};

// Facilitate reuse when creating custom network layers.
this.sendMutation = this.sendMutation.bind(this);
this.sendQueries = this.sendQueries.bind(this);
this.supports = this.supports.bind(this);
(this: any).sendMutation = this.sendMutation.bind(this);
(this: any).sendQueries = this.sendQueries.bind(this);
(this: any).supports = this.supports.bind(this);
}

sendMutation(request: RelayMutationRequest): ?Promise {
Expand Down

0 comments on commit 5dca2bb

Please sign in to comment.