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 CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Relay v0.0.0-main-c730ab6f
2
+ * Relay v0.0.0-main-3cfc85ff
3
3
  *
4
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
5
5
  *
@@ -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);
@@ -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; // We only want to update `this._variables` if we have compiler artifacts that support it.
1017
- // Until we've rolled out the compiler portion of this change, we need to check at runtime.
1018
-
1019
- if (fragmentSpreadOrFragment.argumentDefinitions != null) {
1020
- // If the inline fragment spread has arguments, we need to temporarily
1021
- // switch this._variables to include the fragment spread's arguments
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) // Mutated in place
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) // Written to
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
- function start(subscription: Subscription) {
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();
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-c730ab6f",
4
+ "version": "0.0.0-main-3cfc85ff",
5
5
  "keywords": [
6
6
  "graphql",
7
7
  "relay"