relay-runtime 0.0.0-main-74a1c635 → 0.0.0-main-14324a61

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.
package/experimental.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Relay v0.0.0-main-74a1c635
2
+ * Relay v0.0.0-main-14324a61
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-74a1c635
2
+ * Relay v0.0.0-main-14324a61
3
3
  *
4
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
5
5
  *
@@ -122,7 +122,7 @@ function commitMutation<TVariables: Variables, TData, TRawResponse = {...}>(
122
122
  if (configs) {
123
123
  ({optimisticUpdater, updater} = RelayDeclarativeMutationConfig.convert<{
124
124
  variables: TVariables,
125
- /* $FlowFixMe[incompatible-call] error exposed when improving flow typing
125
+ /* $FlowFixMe[incompatible-type] error exposed when improving flow typing
126
126
  * of commitMutation */
127
127
  response: TData,
128
128
  }>(configs, mutation, optimisticUpdater, updater));
@@ -131,7 +131,7 @@ function commitMutation<TVariables: Variables, TData, TRawResponse = {...}>(
131
131
  const subscription = environment
132
132
  .executeMutation<{
133
133
  variables: TVariables,
134
- /* $FlowFixMe[incompatible-call] error exposed when improving flow typing
134
+ /* $FlowFixMe[incompatible-type] error exposed when improving flow typing
135
135
  * of commitMutation */
136
136
  response: TData,
137
137
  }>({
@@ -48,7 +48,7 @@ function readUpdatableFragment<TFragmentType: FragmentType, TData>(
48
48
  );
49
49
 
50
50
  return {
51
- // $FlowFixMe[incompatible-call]
51
+ // $FlowFixMe[incompatible-type]
52
52
  updatableData: createUpdatableProxy<TData>(
53
53
  fragmentRoot,
54
54
  fragmentVariables,
@@ -30,7 +30,7 @@ function readUpdatableQuery<TVariables: Variables, TData>(
30
30
  const updatableQuery = getUpdatableQuery(query);
31
31
 
32
32
  return {
33
- // $FlowFixMe[incompatible-call]
33
+ // $FlowFixMe[incompatible-type]
34
34
  updatableData: createUpdatableProxy<TData>(
35
35
  proxy.getRoot(),
36
36
  variables,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "relay-runtime",
3
3
  "description": "A core runtime for building GraphQL-driven applications.",
4
- "version": "0.0.0-main-74a1c635",
4
+ "version": "0.0.0-main-14324a61",
5
5
  "keywords": [
6
6
  "graphql",
7
7
  "relay"
@@ -139,7 +139,7 @@ function fetchQuery<TVariables: Variables, TData, TRawResponse>(
139
139
 
140
140
  function readData(snapshot: Snapshot): TData {
141
141
  handlePotentialSnapshotErrors(environment, snapshot.fieldErrors);
142
- /* $FlowFixMe[incompatible-return] we assume readData returns the right
142
+ /* $FlowFixMe[incompatible-type] we assume readData returns the right
143
143
  * data just having written it from network or checked availability. */
144
144
  return snapshot.data;
145
145
  }
@@ -1032,7 +1032,7 @@ class Executor<TMutation: MutationParameters> {
1032
1032
  // OK: always have to run after an async module import resolves
1033
1033
  if (shouldScheduleAsyncStoreUpdate) {
1034
1034
  this._scheduleAsyncStoreUpdate(
1035
- // $FlowFixMe[incompatible-call] `shouldScheduleAsyncStoreUpdate` check should cover `null` case
1035
+ // $FlowFixMe[incompatible-type] `shouldScheduleAsyncStoreUpdate` check should cover `null` case
1036
1036
  batchAsyncModuleUpdatesFN,
1037
1037
  sink.complete,
1038
1038
  );
@@ -252,7 +252,7 @@ function getLinkedRecordID(record: Record, storageKey: StorageKey): ?DataID {
252
252
  'getLinkedRecords() instead of getLinkedRecord()?'
253
253
  : '',
254
254
  );
255
- // $FlowFixMe[incompatible-return]
255
+ // $FlowFixMe[incompatible-type]
256
256
  return link[REF_KEY];
257
257
  }
258
258
 
@@ -341,7 +341,7 @@ class RelayModernStore implements Store {
341
341
  if (this._releaseBuffer.length > this._gcReleaseBufferSize) {
342
342
  const _id = this._releaseBuffer.shift();
343
343
  if (!this._shouldRetainWithinTTL_EXPERIMENTAL) {
344
- // $FlowFixMe[incompatible-call]
344
+ // $FlowFixMe[incompatible-type]
345
345
  this._roots.delete(_id);
346
346
  }
347
347
  this.scheduleGC();
@@ -470,7 +470,7 @@ class RelayModernStore implements Store {
470
470
  fetchTime: Date.now(),
471
471
  };
472
472
  this._releaseBuffer.push(id);
473
- /* $FlowFixMe[incompatible-call] Natural Inference rollout. See
473
+ /* $FlowFixMe[incompatible-type] Natural Inference rollout. See
474
474
  * https://fburl.com/gdoc/y8dn025u */
475
475
  this._roots.set(id, temporaryRootEntry);
476
476
  }
@@ -25,7 +25,7 @@ const RelayRecordSource = require('./RelayRecordSource');
25
25
  const invariant = require('invariant');
26
26
 
27
27
  const UNPUBLISH_RECORD_SENTINEL = RelayModernRecord.fromObject(
28
- // $FlowFixMe[incompatible-call] frozen objects are readonly
28
+ // $FlowFixMe[incompatible-type] frozen objects are readonly
29
29
  Object.freeze({
30
30
  __UNPUBLISH_RECORD_SENTINEL: true,
31
31
  }),
@@ -88,7 +88,7 @@ class RelayOptimisticRecordSource implements MutableRecordSource {
88
88
  }
89
89
 
90
90
  remove(dataID: DataID): void {
91
- // $FlowFixMe[incompatible-call] frozen objects are readonly
91
+ // $FlowFixMe[incompatible-type] frozen objects are readonly
92
92
  this._sink.set(dataID, UNPUBLISH_RECORD_SENTINEL);
93
93
  }
94
94
 
@@ -218,6 +218,8 @@ class RelayPublishQueue implements PublishQueue {
218
218
  ): $ReadOnlyArray<RequestDescriptor> {
219
219
  const runWillClearGcHold =
220
220
  // $FlowFixMe[incompatible-type]
221
+ /* $FlowFixMe[invalid-compare] Error discovered during Constant Condition
222
+ * roll out. See https://fburl.com/workplace/4oq3zi07. */
221
223
  this._appliedOptimisticUpdates === 0 && !!this._gcHold;
222
224
  const runIsANoop =
223
225
  // this._pendingBackupRebase is true if an applied optimistic
@@ -300,7 +300,7 @@ class RelayReader {
300
300
  if (record === undefined) {
301
301
  this._markDataAsMissing('<record>');
302
302
  }
303
- // $FlowFixMe[incompatible-return]
303
+ // $FlowFixMe[incompatible-type]
304
304
  return record;
305
305
  }
306
306
  const data = prevData || {};
@@ -648,11 +648,11 @@ class RelayResponseNormalizer {
648
648
  return;
649
649
  }
650
650
 
651
- // $FlowFixMe[incompatible-call]
651
+ // $FlowFixMe[incompatible-type]
652
652
  const typeName = field.concreteType ?? this._getRecordType(fieldValue);
653
653
  const nextID =
654
654
  this._getDataId(
655
- // $FlowFixMe[incompatible-call]
655
+ // $FlowFixMe[incompatible-type]
656
656
  fieldValue,
657
657
  typeName,
658
658
  ) ||
@@ -141,7 +141,7 @@ if (__DEV__) {
141
141
  ): ?{[string]: mixed} => {
142
142
  const record = source.get(dataID);
143
143
  if (record == null) {
144
- // $FlowFixMe[incompatible-return]
144
+ // $FlowFixMe[incompatible-type]
145
145
  return record;
146
146
  }
147
147
  return new Proxy(
@@ -159,7 +159,7 @@ if (__DEV__) {
159
159
  return getWrappedRecord(source, value.__ref);
160
160
  }
161
161
  if (Array.isArray(value.__refs)) {
162
- // $FlowFixMe[incompatible-call]
162
+ // $FlowFixMe[incompatible-type]
163
163
  return value.__refs.map((ref: string) =>
164
164
  getWrappedRecord(source, ref),
165
165
  );
@@ -669,9 +669,9 @@ class LiveResolverCache implements ResolverCache {
669
669
  const recordID: string = recordsToVisit.pop();
670
670
  visited.add(recordID);
671
671
 
672
- // $FlowFixMe[incompatible-call]
672
+ // $FlowFixMe[incompatible-type]
673
673
  updatedDataIDs.add(recordID);
674
- // $FlowFixMe[incompatible-call]
674
+ // $FlowFixMe[incompatible-type]
675
675
  const fragmentSet = this._recordIDToResolverIDs.get(recordID);
676
676
  if (fragmentSet == null) {
677
677
  continue;
@@ -16,7 +16,7 @@ const LIVE_RESOLVER_SUSPENSE_SENTINEL: mixed = Object.freeze({
16
16
  });
17
17
 
18
18
  function suspenseSentinel(): empty {
19
- // $FlowFixMe[incompatible-return]
19
+ // $FlowFixMe[incompatible-type]
20
20
  return LIVE_RESOLVER_SUSPENSE_SENTINEL;
21
21
  }
22
22
 
@@ -107,7 +107,7 @@ function requestSubscription<TVariables: Variables, TData, TRawResponse>(
107
107
  );
108
108
  }
109
109
  const data = environment.lookup(selector).data;
110
- // $FlowFixMe[incompatible-cast]
110
+ // $FlowFixMe[incompatible-type]
111
111
  onNext((data: TData));
112
112
  }
113
113
  },
@@ -28,7 +28,7 @@ function registerEnvironmentWithDevTools(environment: IEnvironment): void {
28
28
  // $FlowFixMe[incompatible-use] D61394600
29
29
  const devToolsHook = _global && _global.__RELAY_DEVTOOLS_HOOK__;
30
30
  if (devToolsHook) {
31
- // $FlowFixMe[incompatible-call] D61394600
31
+ // $FlowFixMe[incompatible-type] D61394600
32
32
  devToolsHook.registerEnvironment(environment);
33
33
  }
34
34
  }