relay-runtime 0.0.0-main-c730ab6f → 0.0.0-main-3cfc85ff
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/index.js +1 -1
- package/lib/store/OperationExecutor.js +0 -1
- package/lib/store/RelayReader.js +6 -10
- package/lib/store/ResolverCache.js +4 -3
- package/lib/store/experimental-live-resolvers/LiveResolverCache.js +4 -3
- package/lib/subscription/requestSubscription.js +1 -3
- package/network/RelayObservable.js.flow +4 -2
- package/package.json +1 -1
- package/relay-runtime.js +2 -2
- package/relay-runtime.min.js +2 -2
- package/store/RelayReader.js.flow +12 -16
- package/util/ReaderNode.js.flow +2 -4
package/index.js
CHANGED
|
@@ -876,7 +876,6 @@ var Executor = /*#__PURE__*/function () {
|
|
|
876
876
|
_this10._handleFollowupPayload(followupPayload, operation); // OK: always have to run after an async module import resolves
|
|
877
877
|
|
|
878
878
|
|
|
879
|
-
// OK: always have to run after an async module import resolves
|
|
880
879
|
if (shouldScheduleAsyncStoreUpdate) {
|
|
881
880
|
_this10._scheduleAsyncStoreUpdate( // $FlowFixMe[incompatible-call] `shouldScheduleAsyncStoreUpdate` check should cover `null` case
|
|
882
881
|
batchAsyncModuleUpdatesFN, sink.complete);
|
package/lib/store/RelayReader.js
CHANGED
|
@@ -1013,16 +1013,12 @@ var RelayReader = /*#__PURE__*/function () {
|
|
|
1013
1013
|
var inlineData = {};
|
|
1014
1014
|
var parentFragmentName = this._fragmentName;
|
|
1015
1015
|
this._fragmentName = fragmentSpreadOrFragment.name;
|
|
1016
|
-
var parentVariables = this._variables; //
|
|
1017
|
-
//
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
// for the duration of its traversal.
|
|
1023
|
-
var argumentVariables = fragmentSpreadOrFragment.args ? getArgumentValues(fragmentSpreadOrFragment.args, this._variables) : {};
|
|
1024
|
-
this._variables = RelayConcreteVariables.getFragmentVariables(fragmentSpreadOrFragment, this._owner.variables, argumentVariables);
|
|
1025
|
-
}
|
|
1016
|
+
var parentVariables = this._variables; // If the inline fragment spread has arguments, we need to temporarily
|
|
1017
|
+
// switch this._variables to include the fragment spread's arguments
|
|
1018
|
+
// for the duration of its traversal.
|
|
1019
|
+
|
|
1020
|
+
var argumentVariables = fragmentSpreadOrFragment.args ? getArgumentValues(fragmentSpreadOrFragment.args, this._variables) : {};
|
|
1021
|
+
this._variables = RelayConcreteVariables.getFragmentVariables(fragmentSpreadOrFragment, this._owner.variables, argumentVariables);
|
|
1026
1022
|
|
|
1027
1023
|
this._traverseSelections(fragmentSpreadOrFragment.selections, record, inlineData); // Put the parent variables back
|
|
1028
1024
|
|
|
@@ -137,7 +137,8 @@ var RecordResolverCache = /*#__PURE__*/function () {
|
|
|
137
137
|
return [answer, linkedID, error, snapshot, undefined];
|
|
138
138
|
};
|
|
139
139
|
|
|
140
|
-
_proto2.invalidateDataIDs = function invalidateDataIDs(updatedDataIDs
|
|
140
|
+
_proto2.invalidateDataIDs = function invalidateDataIDs(updatedDataIDs // Mutated in place
|
|
141
|
+
) {
|
|
141
142
|
var recordSource = this._getRecordSource();
|
|
142
143
|
|
|
143
144
|
var visited = new Set();
|
|
@@ -188,8 +189,8 @@ var RecordResolverCache = /*#__PURE__*/function () {
|
|
|
188
189
|
};
|
|
189
190
|
|
|
190
191
|
_proto2._markInvalidatedResolverRecord = function _markInvalidatedResolverRecord(dataID, recordSource, // Written to
|
|
191
|
-
updatedDataIDs
|
|
192
|
-
{
|
|
192
|
+
updatedDataIDs // Mutated in place
|
|
193
|
+
) {
|
|
193
194
|
var record = recordSource.get(dataID);
|
|
194
195
|
|
|
195
196
|
if (!record) {
|
|
@@ -250,7 +250,8 @@ var LiveResolverCache = /*#__PURE__*/function () {
|
|
|
250
250
|
};
|
|
251
251
|
};
|
|
252
252
|
|
|
253
|
-
_proto.invalidateDataIDs = function invalidateDataIDs(updatedDataIDs
|
|
253
|
+
_proto.invalidateDataIDs = function invalidateDataIDs(updatedDataIDs // Mutated in place
|
|
254
|
+
) {
|
|
254
255
|
var recordSource = this._getRecordSource();
|
|
255
256
|
|
|
256
257
|
var visited = new Set();
|
|
@@ -308,8 +309,8 @@ var LiveResolverCache = /*#__PURE__*/function () {
|
|
|
308
309
|
}
|
|
309
310
|
};
|
|
310
311
|
|
|
311
|
-
_proto._markInvalidatedResolverRecord = function _markInvalidatedResolverRecord(dataID, recordSource
|
|
312
|
-
{
|
|
312
|
+
_proto._markInvalidatedResolverRecord = function _markInvalidatedResolverRecord(dataID, recordSource // Written to
|
|
313
|
+
) {
|
|
313
314
|
var record = recordSource.get(dataID);
|
|
314
315
|
|
|
315
316
|
if (!record) {
|
|
@@ -40,9 +40,7 @@ function requestSubscription(environment, config) {
|
|
|
40
40
|
|
|
41
41
|
var _ref = configs ? RelayDeclarativeMutationConfig.convert(configs, subscription, null
|
|
42
42
|
/* optimisticUpdater */
|
|
43
|
-
,
|
|
44
|
-
/* optimisticUpdater */
|
|
45
|
-
config.updater) : config,
|
|
43
|
+
, config.updater) : config,
|
|
46
44
|
updater = _ref.updater;
|
|
47
45
|
|
|
48
46
|
var sub = environment.executeSubscription({
|
|
@@ -343,12 +343,14 @@ class RelayObservable<+T> implements Subscribable<T> {
|
|
|
343
343
|
return RelayObservable.create(sink => {
|
|
344
344
|
const subscriptions = [];
|
|
345
345
|
|
|
346
|
-
|
|
346
|
+
type ObservableContext = {_sub?: Subscription};
|
|
347
|
+
|
|
348
|
+
function start(this: ObservableContext, subscription: Subscription) {
|
|
347
349
|
this._sub = subscription;
|
|
348
350
|
subscriptions.push(subscription);
|
|
349
351
|
}
|
|
350
352
|
|
|
351
|
-
function complete() {
|
|
353
|
+
function complete(this: ObservableContext) {
|
|
352
354
|
subscriptions.splice(subscriptions.indexOf(this._sub), 1);
|
|
353
355
|
if (subscriptions.length === 0) {
|
|
354
356
|
sink.complete();
|