relay-runtime 4.0.0 → 5.0.0

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.
Files changed (60) hide show
  1. package/index.js +1 -1
  2. package/lib/ClientID.js +1 -1
  3. package/lib/ConvertToExecuteFunction.js +1 -1
  4. package/lib/DataChecker.js +10 -9
  5. package/lib/NormalizationNode.js +1 -1
  6. package/lib/ReaderNode.js +1 -1
  7. package/lib/RelayCombinedEnvironmentTypes.js +1 -1
  8. package/lib/RelayConcreteNode.js +1 -1
  9. package/lib/RelayConnectionHandler.js +1 -1
  10. package/lib/RelayConnectionInterface.js +1 -1
  11. package/lib/RelayDefaultHandleKey.js +1 -1
  12. package/lib/RelayDefaultHandlerProvider.js +1 -6
  13. package/lib/RelayDefaultMissingFieldHandlers.js +26 -0
  14. package/lib/RelayFeatureFlags.js +3 -5
  15. package/lib/RelayModernEnvironment.js +30 -20
  16. package/lib/RelayModernFragmentOwner.js +1 -1
  17. package/lib/RelayModernFragmentSpecResolver.js +36 -49
  18. package/lib/RelayModernOperationDescriptor.js +1 -1
  19. package/lib/RelayModernQueryExecutor.js +200 -92
  20. package/lib/RelayModernSelector.js +36 -16
  21. package/lib/RelayModernStore.js +14 -8
  22. package/lib/RelayNetwork.js +1 -1
  23. package/lib/RelayNetworkLogger.js +1 -1
  24. package/lib/RelayNetworkTypes.js +1 -1
  25. package/lib/RelayObservable.js +69 -40
  26. package/lib/RelayOperationTracker.js +26 -39
  27. package/lib/RelayPublishQueue.js +24 -19
  28. package/lib/RelayQueryResponseCache.js +1 -1
  29. package/lib/RelayReader.js +23 -5
  30. package/lib/RelayRecordProxy.js +7 -3
  31. package/lib/RelayRecordSourceMutator.js +1 -1
  32. package/lib/RelayRecordSourceProxy.js +5 -2
  33. package/lib/RelayRecordSourceSelectorProxy.js +1 -1
  34. package/lib/RelayRecordState.js +1 -1
  35. package/lib/RelayReferenceMarker.js +4 -3
  36. package/lib/RelayReplaySubject.js +1 -1
  37. package/lib/RelayResponseNormalizer.js +57 -19
  38. package/lib/RelayRuntimeTypes.js +1 -1
  39. package/lib/RelayStoreUtils.js +39 -9
  40. package/lib/RelayViewerHandler.js +2 -49
  41. package/lib/StoreInspector.js +1 -1
  42. package/lib/cloneRelayHandleSourceField.js +1 -1
  43. package/lib/commitLocalUpdate.js +1 -1
  44. package/lib/createRelayContext.js +1 -1
  45. package/lib/deepFreeze.js +1 -1
  46. package/lib/defaultGetDataID.js +24 -0
  47. package/lib/fetchQueryInternal.js +1 -1
  48. package/lib/fetchRelayModernQuery.js +1 -1
  49. package/lib/getFragmentIdentifier.js +1 -1
  50. package/lib/getFragmentSpecIdentifier.js +1 -1
  51. package/lib/getRequestParametersIdentifier.js +1 -1
  52. package/lib/hasOverlappingIDs.js +1 -1
  53. package/lib/index.js +5 -0
  54. package/lib/isPromise.js +1 -1
  55. package/lib/isScalarAndEqual.js +1 -1
  56. package/lib/normalizeRelayPayload.js +2 -5
  57. package/lib/recycleNodesInto.js +7 -1
  58. package/package.json +2 -2
  59. package/relay-runtime.js +2 -2
  60. package/relay-runtime.min.js +2 -2
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * strict-local
7
+ *
8
8
  * @format
9
9
  */
10
10
  'use strict';
package/lib/index.js CHANGED
@@ -25,6 +25,8 @@ var RelayDefaultHandleKey = require("./RelayDefaultHandleKey");
25
25
 
26
26
  var RelayDefaultHandlerProvider = require("./RelayDefaultHandlerProvider");
27
27
 
28
+ var RelayDefaultMissingFieldHandlers = require("./RelayDefaultMissingFieldHandlers");
29
+
28
30
  var RelayError = require("./RelayError");
29
31
 
30
32
  var RelayFeatureFlags = require("./RelayFeatureFlags");
@@ -119,6 +121,8 @@ module.exports = {
119
121
  getFragmentOwner: RelayModernFragmentOwner.getFragmentOwner,
120
122
  getFragmentOwners: RelayModernFragmentOwner.getFragmentOwners,
121
123
  getPaginationFragment: RelayModernGraphQLTag.getPaginationFragment,
124
+ getModuleComponentKey: RelayStoreUtils.getModuleComponentKey,
125
+ getModuleOperationKey: RelayStoreUtils.getModuleOperationKey,
122
126
  getRefetchableFragment: RelayModernGraphQLTag.getRefetchableFragment,
123
127
  getRequest: RelayModernGraphQLTag.getRequest,
124
128
  getSingularSelector: RelayCore.getSingularSelector,
@@ -136,6 +140,7 @@ module.exports = {
136
140
  RangeOperations: RelayDeclarativeMutationConfig.RangeOperations,
137
141
  // Extensions
138
142
  DefaultHandlerProvider: RelayDefaultHandlerProvider,
143
+ DefaultMissingFieldHandlers: RelayDefaultMissingFieldHandlers,
139
144
  ConnectionHandler: RelayConnectionHandler,
140
145
  ViewerHandler: RelayViewerHandler,
141
146
  // Helpers (can be implemented via the above API)
package/lib/isPromise.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * strict
7
+ *
8
8
  * @format
9
9
  */
10
10
  'use strict';
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * strict
7
+ *
8
8
  * @format
9
9
  */
10
10
  'use strict';
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * strict-local
7
+ *
8
8
  * @format
9
9
  */
10
10
  'use strict';
@@ -19,10 +19,7 @@ var _require = require("./RelayStoreUtils"),
19
19
  ROOT_ID = _require.ROOT_ID,
20
20
  ROOT_TYPE = _require.ROOT_TYPE;
21
21
 
22
- function normalizeRelayPayload(selector, payload, errors) {
23
- var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {
24
- handleStrippedNulls: false
25
- };
22
+ function normalizeRelayPayload(selector, payload, errors, options) {
26
23
  var source = new RelayInMemoryRecordSource();
27
24
  source.set(ROOT_ID, RelayModernRecord.create(ROOT_ID, ROOT_TYPE));
28
25
 
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * strict
7
+ *
8
8
  * @format
9
9
  */
10
10
  'use strict';
@@ -52,9 +52,15 @@ function recycleNodesInto(prevData, nextData) {
52
52
  if (nextValue !== nextObject[key]) {
53
53
  if (process.env.NODE_ENV !== "production") {
54
54
  if (!Object.isFrozen(nextObject)) {
55
+ /* $FlowFixMe(>=0.98.0 site=www,mobile,react_native_fb,oss) This
56
+ * comment suppresses an error found when Flow v0.98 was deployed.
57
+ * To see the error delete this comment and run Flow. */
55
58
  nextObject[key] = nextValue;
56
59
  }
57
60
  } else {
61
+ /* $FlowFixMe(>=0.98.0 site=www,mobile,react_native_fb,oss) This comment
62
+ * suppresses an error found when Flow v0.98 was deployed. To see
63
+ * the error delete this comment and run Flow. */
58
64
  nextObject[key] = nextValue;
59
65
  }
60
66
  }
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "relay-runtime",
3
3
  "description": "A core runtime for building GraphQL-driven applications.",
4
- "version": "4.0.0",
4
+ "version": "5.0.0",
5
5
  "keywords": [
6
6
  "graphql",
7
7
  "relay"
8
8
  ],
9
9
  "license": "MIT",
10
- "homepage": "https://facebook.github.io/relay/",
10
+ "homepage": "https://relay.dev",
11
11
  "bugs": "https://github.com/facebook/relay/issues",
12
12
  "repository": "facebook/relay",
13
13
  "dependencies": {