react-relay 0.0.0-main-de25544e → 0.0.0-main-997aecc4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Relay v0.0.0-main-de25544e
2
+ * Relay v0.0.0-main-997aecc4
3
3
  *
4
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
5
5
  *
@@ -54,10 +54,10 @@ class BarComponent extends React.Component<{
54
54
  const reqLen = this.props.requiredProp.length;
55
55
  const optionalProp = this.props.optionalProp;
56
56
 
57
- /** $FlowExpectedError: `optionalProp` might be null **/
57
+ /** $FlowExpectedError[incompatible-use] : `optionalProp` might be null **/
58
58
  const optionalFoo = this.props.optionalProp.foo;
59
59
 
60
- /** $FlowExpectedError: there is no prop `missingProp` **/
60
+ /** $FlowExpectedError[prop-missing] : there is no prop `missingProp` **/
61
61
  const missing = this.props.missingProp;
62
62
 
63
63
  const defLen = this.props.defaultProp.length; // always a valid string, so no error
@@ -78,7 +78,7 @@ const Bar = createFragmentContainer(BarComponent, {
78
78
 
79
79
  module.exports = {
80
80
  checkMissingPropOnFunctionalComponent(): React.Node {
81
- /** $FlowExpectedError: Foo missing `requiredProp` **/
81
+ /** $FlowExpectedError[incompatible-type] : Foo missing `requiredProp` **/
82
82
  return <Foo />;
83
83
  },
84
84
  checkMinimalPropsOnFunctionalComponent(): React.Node {
@@ -86,7 +86,7 @@ module.exports = {
86
86
  return <Foo requiredProp="foo" />;
87
87
  },
88
88
  checkMissingPropOnClassComponent(): React.Node {
89
- /** $FlowExpectedError: Bar missing `requiredProp` **/
89
+ /** $FlowExpectedError[incompatible-type] : Bar missing `requiredProp` **/
90
90
  return <Bar />;
91
91
  },
92
92
  checkMinimalPropsOnClassComponent(): React.Node {
@@ -94,19 +94,19 @@ module.exports = {
94
94
  return <Bar requiredProp="foo" />;
95
95
  },
96
96
  checkWrongPropType(): React.Node {
97
- /** $FlowExpectedError: Bar wrong `requiredProp` type, should be string **/
97
+ /** $FlowExpectedError[incompatible-type] : Bar wrong `requiredProp` type, should be string **/
98
98
  return <Bar requiredProp={17} />;
99
99
  },
100
100
  checkWrongOptionalType(): React.Node {
101
- /** $FlowExpectedError: Bar wrong `optionalProp` type, should be `{foo: string}` **/
101
+ /** $FlowExpectedError[incompatible-type] : Bar wrong `optionalProp` type, should be `{foo: string}` **/
102
102
  return <Bar optionalProp="wrongType" requiredProp="foo" />;
103
103
  },
104
104
  checkNullOptionalType(): React.Node {
105
- /** $FlowExpectedError: Bar `optionalProp` must be omitted or truthy, not null **/
105
+ /** $FlowExpectedError[incompatible-type] : Bar `optionalProp` must be omitted or truthy, not null **/
106
106
  return <Bar optionalProp={null} requiredProp="foo" />;
107
107
  },
108
108
  checkWrongDefaultPropType(): React.Node {
109
- /** $FlowExpectedError: Bar wrong `defaultProp` type, should be string **/
109
+ /** $FlowExpectedError[incompatible-type] : Bar wrong `defaultProp` type, should be string **/
110
110
  return <Bar defaultProp={false} requiredProp="foo" />;
111
111
  },
112
112
  checkAllPossibleProps(): React.Node {
@@ -122,7 +122,7 @@ module.exports = {
122
122
  },
123
123
  checkMissingPropSpread(): React.Node {
124
124
  const props = {defaultProp: 'foo'};
125
- /** $FlowExpectedError: Bar missing `requiredProp` with spread **/
125
+ /** $FlowExpectedError[incompatible-type] : Bar missing `requiredProp` with spread **/
126
126
  return <Bar {...props} />;
127
127
  },
128
128
  checkStaticsAndMethodsProxying(): React.Node {
@@ -131,10 +131,10 @@ module.exports = {
131
131
  getString(): string {
132
132
  const ok = this._barRef ? this._barRef.getNum() : 'default'; // legit
133
133
 
134
- /** $FlowExpectedError: Bar does not have `missingMethod` **/
134
+ /** $FlowExpectedError[prop-missing] : Bar does not have `missingMethod` **/
135
135
  const bad = this._barRef ? this._barRef.missingMethod() : 'default';
136
136
 
137
- /** $FlowExpectedError: Bar `getNum` gives number, but `getString` assumes string **/
137
+ /** $FlowExpectedError[incompatible-type] : Bar `getNum` gives number, but `getString` assumes string **/
138
138
  return bad ? 'not good' : ok;
139
139
  }
140
140
  render(): React.MixedElement {
@@ -39,10 +39,10 @@ class FooComponent extends React.Component<$FlowFixMe> {
39
39
  const reqLen = this.props.requiredProp.length;
40
40
  const optionalProp = this.props.optionalProp;
41
41
 
42
- /** $FlowExpectedError: `optionalProp` might be null **/
42
+ /** $FlowExpectedError[incompatible-use] : `optionalProp` might be null **/
43
43
  const optionalFoo = this.props.optionalProp.foo;
44
44
 
45
- /** $FlowExpectedError: there is no prop `missingProp` **/
45
+ /** $FlowExpectedError[prop-missing] : there is no prop `missingProp` **/
46
46
  const missing = this.props.missingProp;
47
47
 
48
48
  const defLen = this.props.defaultProp.length; // always a valid string, so no error
@@ -140,7 +140,7 @@ module.exports = {
140
140
  return <Foo {...props} />;
141
141
  },
142
142
  checkStaticsAndMethodsProxying(): React.Node {
143
- /* $FlowFixMe(>=0.53.0) This comment suppresses an
143
+ /* $FlowFixMe[missing-type-arg](>=0.53.0) This comment suppresses an
144
144
  * error when upgrading Flow's support for React. Common errors found when
145
145
  * upgrading Flow's React support are documented at
146
146
  * https://fburl.com/eq7bs81w */
@@ -149,10 +149,10 @@ module.exports = {
149
149
  getString(): string {
150
150
  const ok = this._fooRef ? this._fooRef.getNum() : 'default'; // legit
151
151
 
152
- /** $FlowExpectedError: Foo does not have `missingMethod` **/
152
+ /** $FlowExpectedError[prop-missing] : Foo does not have `missingMethod` **/
153
153
  const bad = this._fooRef ? this._fooRef.missingMethod() : 'default';
154
154
 
155
- /** $FlowExpectedError: Foo `getNum` gives number, but `getString` assumes string **/
155
+ /** $FlowExpectedError[incompatible-type] : Foo `getNum` gives number, but `getString` assumes string **/
156
156
  return bad ? 'not good' : ok;
157
157
  }
158
158
  render(): React.Node {
@@ -38,10 +38,10 @@ class FooComponent extends React.Component<$FlowFixMe> {
38
38
  const reqLen = this.props.requiredProp.length;
39
39
  const optionalProp = this.props.optionalProp;
40
40
 
41
- /** $FlowExpectedError: `optionalProp` might be null **/
41
+ /** $FlowExpectedError[incompatible-use] : `optionalProp` might be null **/
42
42
  const optionalFoo = this.props.optionalProp.foo;
43
43
 
44
- /** $FlowExpectedError: there is no prop `missingProp` **/
44
+ /** $FlowExpectedError[prop-missing] : there is no prop `missingProp` **/
45
45
  const missing = this.props.missingProp;
46
46
 
47
47
  const defLen = this.props.defaultProp.length; // always a valid string, so no error
@@ -123,7 +123,7 @@ module.exports = {
123
123
  return <Foo {...props} />;
124
124
  },
125
125
  checkStaticsAndMethodsProxying(): React.Node {
126
- /* $FlowFixMe(>=0.53.0) This comment suppresses an
126
+ /* $FlowFixMe[missing-type-arg](>=0.53.0) This comment suppresses an
127
127
  * error when upgrading Flow's support for React. Common errors found when
128
128
  * upgrading Flow's React support are documented at
129
129
  * https://fburl.com/eq7bs81w */
@@ -132,10 +132,10 @@ module.exports = {
132
132
  getString(): string {
133
133
  const ok = this._fooRef ? this._fooRef.getNum() : 'default'; // legit
134
134
 
135
- /** $FlowExpectedError: Foo does not have `missingMethod` **/
135
+ /** $FlowExpectedError[prop-missing] : Foo does not have `missingMethod` **/
136
136
  const bad = this._fooRef ? this._fooRef.missingMethod() : 'default';
137
137
 
138
- /** $FlowExpectedError: Foo `getNum` gives number, but `getString` assumes string **/
138
+ /** $FlowExpectedError[incompatible-type] : Foo `getNum` gives number, but `getString` assumes string **/
139
139
  return bad ? 'not good' : ok;
140
140
  }
141
141
  render(): React.Node {
@@ -55,9 +55,9 @@ class BadReferenceTest_ extends React.Component<{
55
55
  }> {
56
56
  render(): React.Node {
57
57
  (this.props.badref.id: string);
58
- // $FlowExpectedError
58
+ // $FlowExpectedError[prop-missing]
59
59
  this.props.badref.name;
60
- // $FlowExpectedError The notref fragment was not used.
60
+ // $FlowExpectedError[incompatible-type] The notref fragment was not used.
61
61
  return <NotReferencedTest notref={this.props.badref} />;
62
62
  }
63
63
  }
@@ -86,9 +86,9 @@ class SingularTest extends React.Component<{
86
86
  }> {
87
87
  render(): React.Node {
88
88
  (nullthrows(this.props.user.name): string);
89
- // $FlowExpectedError
89
+ // $FlowExpectedError[incompatible-use]
90
90
  this.props.nullableUser.name;
91
- // $FlowExpectedError
91
+ // $FlowExpectedError[incompatible-use]
92
92
  this.props.optionalUser.name;
93
93
  (nullthrows(nullthrows(this.props.nullableUser).name): string);
94
94
  (nullthrows(nullthrows(this.props.optionalUser).name): string);
@@ -113,7 +113,7 @@ class PluralTest extends React.Component<{
113
113
  const names = this.props.users.map(user => user.name).filter(Boolean);
114
114
  // $FlowExpectedError
115
115
  (names: Array<string>);
116
- // $FlowExpectedError
116
+ // $FlowExpectedError[incompatible-type]
117
117
  (names: Array<number>);
118
118
  return null;
119
119
  }
@@ -151,21 +151,21 @@ function cb(): void {}
151
151
  <SingularTestFragment
152
152
  onClick={cb}
153
153
  string="x"
154
- // $FlowExpectedError - can't pass null for user
154
+ // $FlowExpectedError[incompatible-type] - can't pass null for user
155
155
  user={null}
156
156
  nullableUser={null}
157
157
  />;
158
- // $FlowExpectedError - user is required
158
+ // $FlowExpectedError[incompatible-type] - user is required
159
159
  <SingularTestFragment onClick={cb} string="x" nullableUser={null} />;
160
160
  <SingularTestFragment
161
161
  onClick={cb}
162
162
  string="x"
163
- // $FlowExpectedError - can't pass non-user ref for user
163
+ // $FlowExpectedError[incompatible-type] - can't pass non-user ref for user
164
164
  user={nonUserRef}
165
165
  nullableUser={null}
166
166
  />;
167
167
  <SingularTestFragment
168
- // $FlowExpectedError - `cb` prop is not a function
168
+ // $FlowExpectedError[incompatible-type] - `cb` prop is not a function
169
169
  onClick="cb"
170
170
  string="x"
171
171
  user={aUserRef}
@@ -173,7 +173,7 @@ function cb(): void {}
173
173
  />;
174
174
  <SingularTestFragment
175
175
  onClick={cb}
176
- // $FlowExpectedError - `string` prop is not a string
176
+ // $FlowExpectedError[incompatible-type] - `string` prop is not a string
177
177
  string={1}
178
178
  user={aUserRef}
179
179
  nullableUser={null}
@@ -199,7 +199,7 @@ function cb(): void {}
199
199
  optionalUser={aUserRef}
200
200
  />;
201
201
 
202
- // $FlowExpectedError - onClick is required
202
+ // $FlowExpectedError[incompatible-type] - onClick is required
203
203
  <SingularTestFragment
204
204
  string="x"
205
205
  user={aUserRef}
@@ -223,11 +223,11 @@ declare var aComplexUserRef: {
223
223
  optionalUser={aComplexUserRef}
224
224
  />;
225
225
 
226
- // $FlowExpectedError - can't pass null for user
226
+ // $FlowExpectedError[incompatible-type] - can't pass null for user
227
227
  <PluralTestFragment users={null} nullableUsers={null} />;
228
- // $FlowExpectedError - users is required
228
+ // $FlowExpectedError[incompatible-type] - users is required
229
229
  <PluralTestFragment nullableUsers={null} />;
230
- // $FlowExpectedError - can't pass non-user refs for user
230
+ // $FlowExpectedError[incompatible-type] - can't pass non-user refs for user
231
231
  <PluralTestFragment users={[nonUserRef]} nullableUsers={null} />;
232
232
 
233
233
  <PluralTestFragment users={usersRef} nullableUsers={null} />;
@@ -259,7 +259,7 @@ const AnyTestContainer = createFragmentContainer(AnyTest, {});
259
259
  <AnyTestContainer anything={42} />;
260
260
  <AnyTestContainer anything={null} />;
261
261
  <AnyTestContainer anything={() => {}} />;
262
- // $FlowExpectedError - any other prop can not be passed
262
+ // $FlowExpectedError[incompatible-type] - any other prop can not be passed
263
263
  <AnyTestContainer anything={null} anythingElse={42} />;
264
- // $FlowExpectedError - anything has to be passed
264
+ // $FlowExpectedError[incompatible-type] - anything has to be passed
265
265
  <AnyTestContainer />;
package/hooks.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Relay v0.0.0-main-de25544e
2
+ * Relay v0.0.0-main-997aecc4
3
3
  *
4
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
5
5
  *
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Relay v0.0.0-main-de25544e
2
+ * Relay v0.0.0-main-997aecc4
3
3
  *
4
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
5
5
  *
package/legacy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Relay v0.0.0-main-de25544e
2
+ * Relay v0.0.0-main-997aecc4
3
3
  *
4
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
5
5
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-relay",
3
3
  "description": "A framework for building GraphQL-driven React applications.",
4
- "version": "0.0.0-main-de25544e",
4
+ "version": "0.0.0-main-997aecc4",
5
5
  "keywords": [
6
6
  "graphql",
7
7
  "relay",
@@ -20,7 +20,7 @@
20
20
  "fbjs": "^3.0.2",
21
21
  "invariant": "^2.2.4",
22
22
  "nullthrows": "^1.1.1",
23
- "relay-runtime": "0.0.0-main-de25544e"
23
+ "relay-runtime": "0.0.0-main-997aecc4"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "react": "^16.9.0 || ^17 || ^18 || ^19"
@@ -28,12 +28,12 @@ component EntryPointContainer<
28
28
  TRenders: React.Node,
29
29
  // $FlowFixMe[unsupported-variance-annotation]
30
30
  TEntryPointComponent: EntryPointComponent<
31
- // $FlowExpectedErrors[unclear-type] Use any to accept all kinds of EntryPointComponent
31
+ // $FlowExpectedError[unclear-type] s[unclear-type] Use any to accept all kinds of EntryPointComponent
32
32
  any,
33
- // $FlowExpectedErrors[unclear-type] Use any to accept all kinds of EntryPointComponent
33
+ // $FlowExpectedError[unclear-type] s[unclear-type] Use any to accept all kinds of EntryPointComponent
34
34
  any,
35
35
  TRuntimeProps,
36
- // $FlowExpectedErrors[unclear-type] Use any to accept all kinds of EntryPointComponent
36
+ // $FlowExpectedError[unclear-type] s[unclear-type] Use any to accept all kinds of EntryPointComponent
37
37
  any,
38
38
  TRenders,
39
39
  >,
@@ -69,7 +69,7 @@ type BadParentEntrypointParams = $ReadOnly<{}>;
69
69
  entryPoints: {
70
70
  nestedComponent: NestedRelayEntryPoint({
71
71
  /**
72
- $FlowExpectedError The entryPointParams here should be of type
72
+ $FlowExpectedError[incompatible-type] The entryPointParams here should be of type
73
73
  NestedEntrypointPreloadParams, but it does not contain subEntrypointPreloadParam
74
74
  */
75
75
  entryPoint: NestedEntryPoint,
@@ -114,12 +114,12 @@ const {refetch} = useBlockingPaginationFragment(
114
114
  refetchableFragmentInput,
115
115
  keyNonNullable,
116
116
  );
117
- // $FlowExpectedError: internal option
117
+ // $FlowExpectedError[incompatible-type] : internal option
118
118
  refetch(variables, {
119
119
  __environment: environment,
120
120
  });
121
121
 
122
- // $FlowExpectedError: doesn't exist
122
+ // $FlowExpectedError[incompatible-type] : doesn't exist
123
123
  refetch(variables, {
124
124
  NON_EXIST: 'NON_EXIST',
125
125
  });
@@ -142,11 +142,11 @@ loadNext(10, {
142
142
 
143
143
  // $FlowFixMe[prop-missing]
144
144
  loadNext(10, {
145
- // $FlowExpectedError: doesn't accept variables not available in the Flow type
145
+ // $FlowExpectedError[incompatible-type] : doesn't accept variables not available in the Flow type
146
146
  UNSTABLE_extraVariables: invalidVariables,
147
147
  });
148
148
 
149
- // $FlowExpectedError: doesn't exist
149
+ // $FlowExpectedError[incompatible-type] : doesn't exist
150
150
  loadNext(10, {
151
151
  UNSTABLE_foo: invalidVariables,
152
152
  });
@@ -57,27 +57,27 @@ const usersFragment: useFragmentFlowtest_users$fragment = graphql`
57
57
  (Any: ?useFragmentFlowtest_users$key),
58
58
  ): ?useFragmentFlowtest_users$data);
59
59
 
60
- // $FlowExpectedError: can't cast nullable to non-nullable
60
+ // $FlowExpectedError[incompatible-type] : can't cast nullable to non-nullable
61
61
  (useFragment(
62
62
  userFragment,
63
63
  (Any: ?useFragmentFlowtest_user$key),
64
64
  ): useFragmentFlowtest_user$data);
65
- // $FlowExpectedError: can't cast nullable plural to non-nullable plural
65
+ // $FlowExpectedError[incompatible-type] : can't cast nullable plural to non-nullable plural
66
66
  (useFragment(
67
67
  usersFragment,
68
68
  (Any: ?useFragmentFlowtest_users$key),
69
69
  ): useFragmentFlowtest_users$data);
70
70
 
71
- // $FlowExpectedError: Key should be one of the generated types
71
+ // $FlowExpectedError[incompatible-type] : Key should be one of the generated types
72
72
  useFragment(userFragment, 'INVALID_KEY');
73
73
 
74
- // $FlowExpectedError: Key should not be a user provided object
74
+ // $FlowExpectedError[incompatible-type] : Key should not be a user provided object
75
75
  useFragment(userFragment, {a: 123});
76
76
 
77
- // $FlowExpectedError: Key should not be an empty object
77
+ // $FlowExpectedError[incompatible-type] : Key should not be an empty object
78
78
  useFragment(userFragment, {});
79
79
 
80
- // $FlowExpectedError: Key should be the `<name>$key` type from generated flow
80
+ // $FlowExpectedError[incompatible-type] : Key should be the `<name>$key` type from generated flow
81
81
  useFragment(userFragment, (Any: useFragmentFlowtest_user$data));
82
82
 
83
83
  /* eslint-enable react-hooks/rules-of-hooks */
@@ -113,12 +113,12 @@ const {refetch} = usePaginationFragment(
113
113
  refetchableFragmentInput,
114
114
  keyNonNullable,
115
115
  );
116
- // $FlowExpectedError: internal option
116
+ // $FlowExpectedError[incompatible-type] : internal option
117
117
  refetch(variables, {
118
118
  __environment: environment,
119
119
  });
120
120
 
121
- // $FlowExpectedError: doesn't exist
121
+ // $FlowExpectedError[incompatible-type] : doesn't exist
122
122
  refetch(variables, {
123
123
  NON_EXIST: 'NON_EXIST',
124
124
  });
@@ -141,11 +141,11 @@ loadNext(10, {
141
141
 
142
142
  // $FlowFixMe[prop-missing]
143
143
  loadNext(10, {
144
- // $FlowExpectedError: doesn't accept variables not available in the Flow type
144
+ // $FlowExpectedError[incompatible-type] : doesn't accept variables not available in the Flow type
145
145
  UNSTABLE_extraVariables: invalidVariables,
146
146
  });
147
147
 
148
- // $FlowExpectedError: doesn't exist
148
+ // $FlowExpectedError[incompatible-type] : doesn't exist
149
149
  loadNext(10, {
150
150
  UNSTABLE_foo: invalidVariables,
151
151
  });
@@ -106,12 +106,12 @@ const [, refetch] = useRefetchableFragment(
106
106
  refetchableFragmentInput,
107
107
  keyNonNullable,
108
108
  );
109
- // $FlowExpectedError: internal option
109
+ // $FlowExpectedError[incompatible-type] : internal option
110
110
  refetch(variables, {
111
111
  __environment: environment,
112
112
  });
113
113
 
114
- // $FlowExpectedError: doesn't exist
114
+ // $FlowExpectedError[incompatible-type] : doesn't exist
115
115
  refetch(variables, {
116
116
  NON_EXIST: 'NON_EXIST',
117
117
  });