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 +1 -1
- package/index.js +1 -1
- package/mutations/commitMutation.js.flow +2 -2
- package/mutations/readUpdatableFragment.js.flow +1 -1
- package/mutations/readUpdatableQuery.js.flow +1 -1
- package/package.json +1 -1
- package/query/fetchQuery.js.flow +1 -1
- package/store/OperationExecutor.js.flow +1 -1
- package/store/RelayModernRecord.js.flow +1 -1
- package/store/RelayModernStore.js.flow +2 -2
- package/store/RelayOptimisticRecordSource.js.flow +2 -2
- package/store/RelayPublishQueue.js.flow +2 -0
- package/store/RelayReader.js.flow +1 -1
- package/store/RelayResponseNormalizer.js.flow +2 -2
- package/store/StoreInspector.js.flow +2 -2
- package/store/live-resolvers/LiveResolverCache.js.flow +2 -2
- package/store/live-resolvers/LiveResolverSuspenseSentinel.js.flow +1 -1
- package/subscription/requestSubscription.js.flow +1 -1
- package/util/registerEnvironmentWithDevTools.js.flow +1 -1
package/experimental.js
CHANGED
package/index.js
CHANGED
|
@@ -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-
|
|
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-
|
|
134
|
+
/* $FlowFixMe[incompatible-type] error exposed when improving flow typing
|
|
135
135
|
* of commitMutation */
|
|
136
136
|
response: TData,
|
|
137
137
|
}>({
|
|
@@ -30,7 +30,7 @@ function readUpdatableQuery<TVariables: Variables, TData>(
|
|
|
30
30
|
const updatableQuery = getUpdatableQuery(query);
|
|
31
31
|
|
|
32
32
|
return {
|
|
33
|
-
// $FlowFixMe[incompatible-
|
|
33
|
+
// $FlowFixMe[incompatible-type]
|
|
34
34
|
updatableData: createUpdatableProxy<TData>(
|
|
35
35
|
proxy.getRoot(),
|
|
36
36
|
variables,
|
package/package.json
CHANGED
package/query/fetchQuery.js.flow
CHANGED
|
@@ -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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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
|
|
@@ -648,11 +648,11 @@ class RelayResponseNormalizer {
|
|
|
648
648
|
return;
|
|
649
649
|
}
|
|
650
650
|
|
|
651
|
-
// $FlowFixMe[incompatible-
|
|
651
|
+
// $FlowFixMe[incompatible-type]
|
|
652
652
|
const typeName = field.concreteType ?? this._getRecordType(fieldValue);
|
|
653
653
|
const nextID =
|
|
654
654
|
this._getDataId(
|
|
655
|
-
// $FlowFixMe[incompatible-
|
|
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-
|
|
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-
|
|
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-
|
|
672
|
+
// $FlowFixMe[incompatible-type]
|
|
673
673
|
updatedDataIDs.add(recordID);
|
|
674
|
-
// $FlowFixMe[incompatible-
|
|
674
|
+
// $FlowFixMe[incompatible-type]
|
|
675
675
|
const fragmentSet = this._recordIDToResolverIDs.get(recordID);
|
|
676
676
|
if (fragmentSet == null) {
|
|
677
677
|
continue;
|
|
@@ -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-
|
|
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-
|
|
31
|
+
// $FlowFixMe[incompatible-type] D61394600
|
|
32
32
|
devToolsHook.registerEnvironment(environment);
|
|
33
33
|
}
|
|
34
34
|
}
|