Skip to content

Commit

Permalink
[PR] React React.Suspense maxDuration attribute
Browse files Browse the repository at this point in the history
Summary:
We're replacing this user-specific attribute with an internal heuristic.

Related PR facebook/react#15272

cc jbrown215
Pull Request resolved: #7613

Reviewed By: bvaughn

Differential Revision: D14784577

Pulled By: jbrown215

fbshipit-source-id: c93609a2f095c34fd85242798d4989abffb273a4
  • Loading branch information
Brian Vaughn authored and facebook-github-bot committed Apr 5, 2019
1 parent 875cb7a commit 1769cd8
Show file tree
Hide file tree
Showing 10 changed files with 642 additions and 668 deletions.
3 changes: 1 addition & 2 deletions lib/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,7 @@ declare module react {

declare export var Suspense: React$ComponentType<{
children?: ?React$Node,
fallback?: React$Node,
maxDuration?: number
fallback?: React$Node
}>; // 16.6+

declare export type ElementProps<C> = React$ElementProps<C>;
Expand Down
8 changes: 4 additions & 4 deletions tests/getters_and_setters/getters_and_setters.exp
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,8 @@ References:
react.js:17:13
17| (<Example a="bad" />); // error: number ~> string
^^^^^ [1]
<BUILTINS>/react.js:438:36
438| number: React$PropType$Primitive<number>;
<BUILTINS>/react.js:437:36
437| number: React$PropType$Primitive<number>;
^^^^^^ [2]


Expand All @@ -482,8 +482,8 @@ References:
react.js:18:20
18| (<Example a={0} c={0} />); // error: number ~> string
^ [1]
<BUILTINS>/react.js:440:36
440| string: React$PropType$Primitive<string>;
<BUILTINS>/react.js:439:36
439| string: React$PropType$Primitive<string>;
^^^^^^ [2]


Expand Down
46 changes: 23 additions & 23 deletions tests/new_react/new_react.exp
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ Cannot assign `this.props.x` to `_` because number [1] is incompatible with stri
^^^^^^^^^^^^

References:
<BUILTINS>/react.js:438:36
438| number: React$PropType$Primitive<number>;
<BUILTINS>/react.js:437:36
437| number: React$PropType$Primitive<number>;
^^^^^^ [1]
classes.js:57:12
57| var _: string = this.props.x;
Expand Down Expand Up @@ -420,8 +420,8 @@ Cannot assign `this.props.z` to `qux` because:
^^^^^^^^^^^^

References:
<BUILTINS>/react.js:438:36
438| number: React$PropType$Primitive<number>;
<BUILTINS>/react.js:437:36
437| number: React$PropType$Primitive<number>;
^^^^^^ [1]
new_react.js:19:18
19| var qux: string = this.props.z;
Expand All @@ -437,8 +437,8 @@ Cannot assign `this.props.x` to `w` because string [1] is incompatible with numb
^^^^^^^^^^^^

References:
<BUILTINS>/react.js:440:36
440| string: React$PropType$Primitive<string>;
<BUILTINS>/react.js:439:36
439| string: React$PropType$Primitive<string>;
^^^^^^ [1]
new_react.js:20:15
20| var w:number = this.props.x;
Expand Down Expand Up @@ -472,8 +472,8 @@ References:
new_react.js:29:23
29| var element = <C x = {0}/>;
^ [1]
<BUILTINS>/react.js:440:36
440| string: React$PropType$Primitive<string>;
<BUILTINS>/react.js:439:36
439| string: React$PropType$Primitive<string>;
^^^^^^ [2]


Expand Down Expand Up @@ -530,8 +530,8 @@ Cannot assign `this.props.x` to `a` because:
^^^^^^^^^^^^

References:
<BUILTINS>/react.js:440:36
440| string: React$PropType$Primitive<string>;
<BUILTINS>/react.js:439:36
439| string: React$PropType$Primitive<string>;
^^^^^^ [1]
props.js:14:16
14| var a: number = this.props.x; // error
Expand Down Expand Up @@ -567,8 +567,8 @@ Cannot assign `this.props.z` to `c` because:
^^^^^^^^^^^^

References:
<BUILTINS>/react.js:438:36
438| number: React$PropType$Primitive<number>;
<BUILTINS>/react.js:437:36
437| number: React$PropType$Primitive<number>;
^^^^^^ [1]
props.js:16:16
16| var c: string = this.props.z; // error
Expand All @@ -589,14 +589,14 @@ References:
props.js:20:29
20| var element = <TestProps x={false} y={false} z={false} />; // 3 errors
^^^^^ [1]
<BUILTINS>/react.js:440:36
440| string: React$PropType$Primitive<string>;
<BUILTINS>/react.js:439:36
439| string: React$PropType$Primitive<string>;
^^^^^^ [2]
props.js:20:49
20| var element = <TestProps x={false} y={false} z={false} />; // 3 errors
^^^^^ [3]
<BUILTINS>/react.js:438:36
438| number: React$PropType$Primitive<number>;
<BUILTINS>/react.js:437:36
437| number: React$PropType$Primitive<number>;
^^^^^^ [4]


Expand Down Expand Up @@ -653,8 +653,8 @@ References:
props2.js:9:41
9| getInitialState: function(): { bar: number } {
^^^^^^ [1]
<BUILTINS>/react.js:440:36
440| string: React$PropType$Primitive<string>;
<BUILTINS>/react.js:439:36
439| string: React$PropType$Primitive<string>;
^^^^^^ [2]
props2.js:15:42
15| return <C {...this.state} foo = {0} />;
Expand Down Expand Up @@ -685,12 +685,12 @@ Cannot get `React.PropTypes.string.inRequired` because property `inRequired` is
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

References:
<BUILTINS>/react.js:414:39
<BUILTINS>/react.js:413:39
v
414| type ReactPropsChainableTypeChecker = {
415| isRequired: ReactPropsCheckType;
416| (props: any, propName: string, componentName: string, href?: string): ?Error;
417| };
413| type ReactPropsChainableTypeChecker = {
414| isRequired: ReactPropsCheckType;
415| (props: any, propName: string, componentName: string, href?: string): ?Error;
416| };
^ [1]


Expand Down
Loading

0 comments on commit 1769cd8

Please sign in to comment.