react-relay 14.0.0 → 15.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (194) hide show
  1. package/ReactRelayContainerUtils.js.flow +1 -2
  2. package/ReactRelayContext.js +1 -1
  3. package/ReactRelayContext.js.flow +1 -2
  4. package/ReactRelayFragmentContainer.js.flow +6 -4
  5. package/ReactRelayFragmentMockRenderer.js.flow +1 -2
  6. package/ReactRelayLocalQueryRenderer.js.flow +5 -5
  7. package/ReactRelayPaginationContainer.js.flow +21 -14
  8. package/ReactRelayQueryFetcher.js.flow +28 -16
  9. package/ReactRelayQueryRenderer.js.flow +42 -13
  10. package/ReactRelayQueryRendererContext.js.flow +2 -3
  11. package/ReactRelayRefetchContainer.js.flow +9 -9
  12. package/ReactRelayTestMocker.js.flow +3 -3
  13. package/ReactRelayTypes.js.flow +7 -8
  14. package/RelayContext.js.flow +1 -2
  15. package/__flowtests__/ReactRelayFragmentContainer-flowtest.js.flow +4 -5
  16. package/__flowtests__/ReactRelayPaginationContainer-flowtest.js.flow +4 -5
  17. package/__flowtests__/ReactRelayRefetchContainer-flowtest.js.flow +4 -5
  18. package/__flowtests__/RelayModern-flowtest.js.flow +3 -4
  19. package/__flowtests__/RelayModernFlowtest_badref.graphql.js.flow +3 -4
  20. package/__flowtests__/RelayModernFlowtest_notref.graphql.js.flow +3 -4
  21. package/__flowtests__/RelayModernFlowtest_user.graphql.js.flow +3 -4
  22. package/__flowtests__/RelayModernFlowtest_users.graphql.js.flow +3 -4
  23. package/__flowtests__/__generated__/ReactRelayFragmentContainerFlowtest_viewer.graphql.js.flow +3 -1
  24. package/__flowtests__/__generated__/ReactRelayFragmentContainerFlowtest_viewer2.graphql.js.flow +3 -1
  25. package/__flowtests__/__generated__/ReactRelayPaginationContainerFlowtestQuery.graphql.js.flow +4 -2
  26. package/__flowtests__/__generated__/ReactRelayPaginationContainerFlowtest_viewer.graphql.js.flow +3 -1
  27. package/__flowtests__/__generated__/ReactRelayRefetchContainerFlowtestQuery.graphql.js.flow +4 -2
  28. package/__flowtests__/__generated__/ReactRelayRefetchContainerFlowtest_viewer.graphql.js.flow +3 -1
  29. package/__flowtests__/__generated__/RelayModernFlowtest_badref.graphql.js.flow +4 -2
  30. package/__flowtests__/__generated__/RelayModernFlowtest_notref.graphql.js.flow +4 -2
  31. package/__flowtests__/__generated__/RelayModernFlowtest_user.graphql.js.flow +3 -1
  32. package/__flowtests__/__generated__/RelayModernFlowtest_users.graphql.js.flow +3 -1
  33. package/assertFragmentMap.js.flow +1 -2
  34. package/buildReactRelayContainer.js.flow +7 -7
  35. package/getRootVariablesForFragments.js.flow +1 -3
  36. package/hooks.js +1 -1
  37. package/hooks.js.flow +4 -2
  38. package/index.js +1 -1
  39. package/index.js.flow +6 -2
  40. package/isRelayEnvironment.js.flow +1 -2
  41. package/jest-react/enqueueTask.js.flow +1 -1
  42. package/jest-react/index.js.flow +1 -1
  43. package/jest-react/internalAct.js.flow +1 -1
  44. package/legacy.js +1 -1
  45. package/legacy.js.flow +1 -2
  46. package/lib/ReactRelayContainerUtils.js +2 -3
  47. package/lib/ReactRelayContext.js +3 -4
  48. package/lib/ReactRelayFragmentContainer.js +47 -73
  49. package/lib/ReactRelayFragmentMockRenderer.js +2 -4
  50. package/lib/ReactRelayLocalQueryRenderer.js +18 -31
  51. package/lib/ReactRelayPaginationContainer.js +74 -164
  52. package/lib/ReactRelayQueryFetcher.js +49 -76
  53. package/lib/ReactRelayQueryRenderer.js +63 -84
  54. package/lib/ReactRelayQueryRendererContext.js +2 -2
  55. package/lib/ReactRelayRefetchContainer.js +58 -108
  56. package/lib/ReactRelayTestMocker.js +33 -68
  57. package/lib/ReactRelayTypes.js +2 -1
  58. package/lib/RelayContext.js +4 -7
  59. package/lib/assertFragmentMap.js +3 -5
  60. package/lib/buildReactRelayContainer.js +11 -27
  61. package/lib/getRootVariablesForFragments.js +6 -10
  62. package/lib/hooks.js +5 -18
  63. package/lib/index.js +7 -24
  64. package/lib/isRelayEnvironment.js +5 -4
  65. package/lib/jest-react/enqueueTask.js +5 -9
  66. package/lib/jest-react/index.js +0 -1
  67. package/lib/jest-react/internalAct.js +9 -20
  68. package/lib/legacy.js +2 -8
  69. package/lib/multi-actor/ActorChange.js +2 -5
  70. package/lib/multi-actor/index.js +2 -1
  71. package/lib/multi-actor/useRelayActorEnvironment.js +4 -8
  72. package/lib/relay-hooks/EntryPointContainer.react.js +9 -15
  73. package/lib/relay-hooks/EntryPointTypes.flow.js +5 -3
  74. package/lib/relay-hooks/FragmentResource.js +109 -203
  75. package/lib/relay-hooks/HooksImplementation.js +3 -6
  76. package/lib/relay-hooks/InternalLogger.js +2 -3
  77. package/lib/relay-hooks/LRUCache.js +2 -20
  78. package/lib/relay-hooks/LazyLoadEntryPointContainer_DEPRECATED.react.js +33 -54
  79. package/lib/relay-hooks/MatchContainer.js +15 -24
  80. package/lib/relay-hooks/ProfilerContext.js +3 -3
  81. package/lib/relay-hooks/QueryResource.js +31 -101
  82. package/lib/relay-hooks/RelayEnvironmentProvider.js +5 -9
  83. package/lib/relay-hooks/SuspenseResource.js +9 -33
  84. package/lib/relay-hooks/loadEntryPoint.js +19 -31
  85. package/lib/relay-hooks/loadQuery.js +42 -78
  86. package/lib/relay-hooks/preloadQuery_DEPRECATED.js +11 -37
  87. package/lib/relay-hooks/prepareEntryPoint_DEPRECATED.js +9 -15
  88. package/lib/relay-hooks/react-cache/RelayReactCache.js +7 -12
  89. package/lib/relay-hooks/react-cache/getQueryResultOrFetchQuery_REACT_CACHE.js +27 -81
  90. package/lib/relay-hooks/react-cache/readFragmentInternal_REACT_CACHE.js +206 -0
  91. package/lib/relay-hooks/react-cache/useFragmentInternal_REACT_CACHE.js +195 -215
  92. package/lib/relay-hooks/react-cache/useFragment_REACT_CACHE.js +5 -15
  93. package/lib/relay-hooks/react-cache/useLazyLoadQuery_REACT_CACHE.js +17 -24
  94. package/lib/relay-hooks/react-cache/usePaginationFragment_REACT_CACHE.js +149 -0
  95. package/lib/relay-hooks/react-cache/usePreloadedQuery_REACT_CACHE.js +24 -39
  96. package/lib/relay-hooks/react-cache/useRefetchableFragmentInternal_REACT_CACHE.js +325 -0
  97. package/lib/relay-hooks/react-cache/useRefetchableFragment_REACT_CACHE.js +37 -0
  98. package/lib/relay-hooks/useBlockingPaginationFragment.js +73 -93
  99. package/lib/relay-hooks/useClientQuery.js +30 -0
  100. package/lib/relay-hooks/useEntryPointLoader.js +18 -38
  101. package/lib/relay-hooks/useFetchTrackingRef.js +10 -12
  102. package/lib/relay-hooks/useFragment.js +8 -19
  103. package/lib/relay-hooks/useFragmentNode.js +20 -32
  104. package/lib/relay-hooks/useIsMountedRef.js +4 -6
  105. package/lib/relay-hooks/useIsOperationNodeActive.js +8 -20
  106. package/lib/relay-hooks/useIsParentQueryActive.js +3 -6
  107. package/lib/relay-hooks/useLazyLoadQuery.js +7 -24
  108. package/lib/relay-hooks/useLazyLoadQueryNode.js +23 -34
  109. package/lib/relay-hooks/useLoadMoreFunction.js +46 -78
  110. package/lib/relay-hooks/useMemoOperationDescriptor.js +6 -15
  111. package/lib/relay-hooks/useMemoVariables.js +15 -34
  112. package/lib/relay-hooks/useMutation.js +9 -27
  113. package/lib/relay-hooks/usePaginationFragment.js +73 -76
  114. package/lib/relay-hooks/usePreloadedQuery.js +13 -44
  115. package/lib/relay-hooks/useQueryLoader.js +24 -49
  116. package/lib/relay-hooks/useRefetchableFragment.js +19 -17
  117. package/lib/relay-hooks/useRefetchableFragmentNode.js +65 -109
  118. package/lib/relay-hooks/useRelayEnvironment.js +4 -8
  119. package/lib/relay-hooks/useStaticFragmentNodeWarning.js +4 -8
  120. package/lib/relay-hooks/useSubscribeToInvalidationState.js +8 -9
  121. package/lib/relay-hooks/useSubscription.js +5 -10
  122. package/lib/relay-hooks/useUnsafeRef_DEPRECATED.js +29 -0
  123. package/multi-actor/ActorChange.js.flow +1 -1
  124. package/multi-actor/index.js.flow +1 -1
  125. package/multi-actor/useRelayActorEnvironment.js.flow +2 -4
  126. package/package.json +2 -2
  127. package/react-relay-hooks.js +2 -2
  128. package/react-relay-hooks.min.js +2 -2
  129. package/react-relay-legacy.js +2 -2
  130. package/react-relay-legacy.min.js +2 -2
  131. package/react-relay.js +2 -2
  132. package/react-relay.min.js +2 -2
  133. package/relay-hooks/EntryPointContainer.react.js.flow +3 -5
  134. package/relay-hooks/EntryPointTypes.flow.js.flow +37 -37
  135. package/relay-hooks/FragmentResource.js.flow +43 -19
  136. package/relay-hooks/HooksImplementation.js.flow +7 -9
  137. package/relay-hooks/InternalLogger.js.flow +1 -3
  138. package/relay-hooks/LRUCache.js.flow +1 -3
  139. package/relay-hooks/LazyLoadEntryPointContainer_DEPRECATED.react.js.flow +19 -14
  140. package/relay-hooks/MatchContainer.js.flow +6 -8
  141. package/relay-hooks/ProfilerContext.js.flow +1 -3
  142. package/relay-hooks/QueryResource.js.flow +29 -11
  143. package/relay-hooks/RelayEnvironmentProvider.js.flow +4 -6
  144. package/relay-hooks/SuspenseResource.js.flow +1 -3
  145. package/relay-hooks/__flowtests__/EntryPointTypes/EntryPointElementConfig-flowtest.js.flow +6 -4
  146. package/relay-hooks/__flowtests__/EntryPointTypes/NestedEntrypoints-flowtest.js.flow +4 -4
  147. package/relay-hooks/__flowtests__/__generated__/useFragmentFlowtest_user.graphql.js.flow +3 -1
  148. package/relay-hooks/__flowtests__/__generated__/useFragmentFlowtest_users.graphql.js.flow +3 -1
  149. package/relay-hooks/__flowtests__/useBlockingPaginationFragment-flowtest.js.flow +39 -39
  150. package/relay-hooks/__flowtests__/useFragment-flowtest.js.flow +1 -3
  151. package/relay-hooks/__flowtests__/usePaginationFragment-flowtest.js.flow +37 -38
  152. package/relay-hooks/__flowtests__/useRefetchableFragment-flowtest.js.flow +18 -20
  153. package/relay-hooks/__flowtests__/utils.js.flow +21 -12
  154. package/relay-hooks/loadEntryPoint.js.flow +11 -6
  155. package/relay-hooks/loadQuery.js.flow +11 -7
  156. package/relay-hooks/preloadQuery_DEPRECATED.js.flow +9 -12
  157. package/relay-hooks/prepareEntryPoint_DEPRECATED.js.flow +13 -10
  158. package/relay-hooks/react-cache/RelayReactCache.js.flow +1 -3
  159. package/relay-hooks/react-cache/getQueryResultOrFetchQuery_REACT_CACHE.js.flow +26 -20
  160. package/relay-hooks/react-cache/readFragmentInternal_REACT_CACHE.js.flow +297 -0
  161. package/relay-hooks/react-cache/useFragmentInternal_REACT_CACHE.js.flow +136 -96
  162. package/relay-hooks/react-cache/useFragment_REACT_CACHE.js.flow +1 -3
  163. package/relay-hooks/react-cache/useLazyLoadQuery_REACT_CACHE.js.flow +3 -5
  164. package/relay-hooks/react-cache/usePaginationFragment_REACT_CACHE.js.flow +190 -0
  165. package/relay-hooks/react-cache/usePreloadedQuery_REACT_CACHE.js.flow +3 -6
  166. package/relay-hooks/react-cache/useRefetchableFragmentInternal_REACT_CACHE.js.flow +601 -0
  167. package/relay-hooks/react-cache/useRefetchableFragment_REACT_CACHE.js.flow +65 -0
  168. package/relay-hooks/useBlockingPaginationFragment.js.flow +86 -59
  169. package/relay-hooks/useClientQuery.js.flow +39 -0
  170. package/relay-hooks/useEntryPointLoader.js.flow +16 -14
  171. package/relay-hooks/useFetchTrackingRef.js.flow +7 -8
  172. package/relay-hooks/useFragment.js.flow +2 -4
  173. package/relay-hooks/useFragmentNode.js.flow +7 -8
  174. package/relay-hooks/useIsMountedRef.js.flow +2 -4
  175. package/relay-hooks/useIsOperationNodeActive.js.flow +1 -1
  176. package/relay-hooks/useIsParentQueryActive.js.flow +1 -1
  177. package/relay-hooks/useLazyLoadQuery.js.flow +9 -32
  178. package/relay-hooks/useLazyLoadQueryNode.js.flow +4 -6
  179. package/relay-hooks/useLoadMoreFunction.js.flow +20 -17
  180. package/relay-hooks/useMemoOperationDescriptor.js.flow +3 -5
  181. package/relay-hooks/useMemoVariables.js.flow +13 -31
  182. package/relay-hooks/useMutation.js.flow +6 -8
  183. package/relay-hooks/usePaginationFragment.js.flow +75 -43
  184. package/relay-hooks/usePreloadedQuery.js.flow +49 -43
  185. package/relay-hooks/useQueryLoader.js.flow +89 -28
  186. package/relay-hooks/useRefetchableFragment.js.flow +83 -23
  187. package/relay-hooks/useRefetchableFragmentNode.js.flow +26 -22
  188. package/relay-hooks/useRelayEnvironment.js.flow +2 -4
  189. package/relay-hooks/useStaticFragmentNodeWarning.js.flow +3 -5
  190. package/relay-hooks/useSubscribeToInvalidationState.js.flow +2 -4
  191. package/relay-hooks/useSubscription.js.flow +1 -3
  192. package/relay-hooks/useUnsafeRef_DEPRECATED.js.flow +25 -0
  193. package/lib/readContext.js +0 -28
  194. package/readContext.js.flow +0 -31
@@ -4,25 +4,22 @@
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
- * @emails oncall+relay
8
7
  *
9
8
  * @format
9
+ * @oncall relay
10
10
  */
11
- 'use strict'; // flowlint ambiguous-object-type:error
12
11
 
13
- var warning = require("fbjs/lib/warning");
12
+ 'use strict';
14
13
 
14
+ var warning = require("fbjs/lib/warning");
15
15
  var implementation = null;
16
-
17
16
  function inject(impl) {
18
17
  process.env.NODE_ENV !== "production" ? warning(implementation !== null, 'Relay HooksImplementation was injected twice.') : void 0;
19
18
  implementation = impl;
20
19
  }
21
-
22
20
  function get() {
23
21
  return implementation;
24
22
  }
25
-
26
23
  module.exports = {
27
24
  inject: inject,
28
25
  get: get
@@ -4,15 +4,14 @@
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
- * @emails oncall+relay
8
7
  *
9
8
  * @format
9
+ * @oncall relay
10
10
  */
11
- // flowlint ambiguous-object-type:error
11
+
12
12
  'use strict';
13
13
 
14
14
  var loggerImpl = function loggerImpl(eventData) {};
15
-
16
15
  module.exports = {
17
16
  setLoggerImplementation: function setLoggerImplementation(loggerFn) {
18
17
  loggerImpl = loggerFn;
@@ -5,14 +5,13 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  *
8
- * @emails oncall+relay
9
8
  * @format
9
+ * @oncall relay
10
10
  */
11
- // flowlint ambiguous-object-type:error
11
+
12
12
  'use strict';
13
13
 
14
14
  var invariant = require('invariant');
15
-
16
15
  /**
17
16
  * JS maps (both plain objects and Map) maintain key insertion
18
17
  * order, which means there is an easy way to simulate LRU behavior
@@ -30,62 +29,45 @@ var LRUCache = /*#__PURE__*/function () {
30
29
  !(this._capacity > 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'LRUCache: Unable to create instance of cache with zero or negative capacity.') : invariant(false) : void 0;
31
30
  this._map = new Map();
32
31
  }
33
-
34
32
  var _proto = LRUCache.prototype;
35
-
36
33
  _proto.set = function set(key, value) {
37
34
  this._map["delete"](key);
38
-
39
35
  this._map.set(key, value);
40
-
41
36
  if (this._map.size > this._capacity) {
42
37
  var firstKey = this._map.keys().next();
43
-
44
38
  if (!firstKey.done) {
45
39
  this._map["delete"](firstKey.value);
46
40
  }
47
41
  }
48
42
  };
49
-
50
43
  _proto.get = function get(key) {
51
44
  var value = this._map.get(key);
52
-
53
45
  if (value != null) {
54
46
  this._map["delete"](key);
55
-
56
47
  this._map.set(key, value);
57
48
  }
58
-
59
49
  return value;
60
50
  };
61
-
62
51
  _proto.has = function has(key) {
63
52
  return this._map.has(key);
64
53
  };
65
-
66
54
  _proto["delete"] = function _delete(key) {
67
55
  this._map["delete"](key);
68
56
  };
69
-
70
57
  _proto.size = function size() {
71
58
  return this._map.size;
72
59
  };
73
-
74
60
  _proto.capacity = function capacity() {
75
61
  return this._capacity - this._map.size;
76
62
  };
77
-
78
63
  _proto.clear = function clear() {
79
64
  this._map.clear();
80
65
  };
81
-
82
66
  return LRUCache;
83
67
  }();
84
-
85
68
  function create(capacity) {
86
69
  return new LRUCache(capacity);
87
70
  }
88
-
89
71
  module.exports = {
90
72
  create: create
91
73
  };
@@ -4,125 +4,105 @@
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
- * @emails oncall+relay
8
7
  *
9
8
  * @format
9
+ * @oncall relay
10
10
  */
11
- // flowlint ambiguous-object-type:error
11
+
12
12
  'use strict';
13
13
 
14
14
  var preloadQuery_DEPRECATED = require('./preloadQuery_DEPRECATED');
15
-
16
15
  var ProfilerContext = require('./ProfilerContext');
17
-
18
16
  var useRelayEnvironment = require('./useRelayEnvironment');
19
-
20
17
  var React = require('react');
21
-
22
18
  var _require = require('react'),
23
- useContext = _require.useContext,
24
- useEffect = _require.useEffect,
25
- useMemo = _require.useMemo;
26
-
19
+ useContext = _require.useContext,
20
+ useEffect = _require.useEffect,
21
+ useMemo = _require.useMemo;
27
22
  var _require2 = require('relay-runtime'),
28
- stableCopy = _require2.stableCopy;
29
-
23
+ stableCopy = _require2.stableCopy;
30
24
  function stableStringify(value) {
31
25
  var _JSON$stringify;
32
-
33
26
  return (_JSON$stringify = JSON.stringify(stableCopy(value))) !== null && _JSON$stringify !== void 0 ? _JSON$stringify : 'null';
34
27
  }
35
-
36
28
  function prepareEntryPoint(environmentProvider, entryPoint, entryPointParams) {
37
29
  // Start loading the code for the entrypoint
38
30
  var loadingPromise = null;
39
-
40
31
  if (entryPoint.root.getModuleIfRequired() == null) {
41
32
  loadingPromise = entryPoint.root.load();
42
33
  }
43
-
44
34
  var preloadProps = entryPoint.getPreloadProps(entryPointParams);
45
35
  var queries = preloadProps.queries,
46
- entryPoints = preloadProps.entryPoints,
47
- extraProps = preloadProps.extraProps;
36
+ entryPoints = preloadProps.entryPoints,
37
+ extraProps = preloadProps.extraProps;
48
38
  var preloadedQueries = {};
49
39
  var preloadedEntryPoints = {};
50
-
51
40
  if (queries != null) {
52
41
  var queriesPropNames = Object.keys(queries);
53
42
  queriesPropNames.forEach(function (queryPropName) {
54
43
  var _queries$queryPropNam = queries[queryPropName],
55
- environmentProviderOptions = _queries$queryPropNam.environmentProviderOptions,
56
- options = _queries$queryPropNam.options,
57
- parameters = _queries$queryPropNam.parameters,
58
- variables = _queries$queryPropNam.variables;
44
+ environmentProviderOptions = _queries$queryPropNam.environmentProviderOptions,
45
+ options = _queries$queryPropNam.options,
46
+ parameters = _queries$queryPropNam.parameters,
47
+ variables = _queries$queryPropNam.variables;
59
48
  var environment = environmentProvider.getEnvironment(environmentProviderOptions);
60
49
  preloadedQueries[queryPropName] = preloadQuery_DEPRECATED(environment, parameters, variables, options, environmentProviderOptions);
61
50
  });
62
51
  }
63
-
64
52
  if (entryPoints != null) {
65
53
  var entryPointPropNames = Object.keys(entryPoints);
66
54
  entryPointPropNames.forEach(function (entryPointPropName) {
67
55
  var entryPointDescription = entryPoints[entryPointPropName];
68
-
69
56
  if (entryPointDescription == null) {
70
57
  return;
71
58
  }
72
-
73
59
  var nestedEntryPoint = entryPointDescription.entryPoint,
74
- nestedParams = entryPointDescription.entryPointParams;
60
+ nestedParams = entryPointDescription.entryPointParams;
75
61
  preloadedEntryPoints[entryPointPropName] = prepareEntryPoint(environmentProvider, nestedEntryPoint, nestedParams);
76
62
  });
77
63
  }
78
-
79
64
  return {
80
65
  entryPoints: preloadedEntryPoints,
81
66
  extraProps: extraProps !== null && extraProps !== void 0 ? extraProps : null,
82
67
  getComponent: function getComponent() {
83
68
  var component = entryPoint.root.getModuleIfRequired();
84
-
85
69
  if (component == null) {
86
70
  var _loadingPromise;
87
-
88
71
  loadingPromise = (_loadingPromise = loadingPromise) !== null && _loadingPromise !== void 0 ? _loadingPromise : entryPoint.root.load();
89
72
  throw loadingPromise;
90
- } // $FlowFixMe[incompatible-cast] - trust me Flow, its entryPoint component
91
-
92
-
73
+ }
74
+ // $FlowFixMe[incompatible-cast] - trust me Flow, its entryPoint component
93
75
  return component;
94
76
  },
95
77
  queries: preloadedQueries,
96
78
  rootModuleID: entryPoint.root.getModuleId()
97
79
  };
98
80
  }
99
-
100
81
  function LazyLoadEntryPointContainer_DEPRECATED(_ref) {
101
82
  var entryPoint = _ref.entryPoint,
102
- entryPointParams = _ref.entryPointParams,
103
- props = _ref.props,
104
- environmentProvider = _ref.environmentProvider;
83
+ entryPointParams = _ref.entryPointParams,
84
+ props = _ref.props,
85
+ environmentProvider = _ref.environmentProvider;
105
86
  var environment = useRelayEnvironment();
106
- var getPreloadProps = entryPoint.getPreloadProps; // IMPORTANT: Loading the component may suspend (throw), so the props
87
+ var getPreloadProps = entryPoint.getPreloadProps;
88
+ // IMPORTANT: Loading the component may suspend (throw), so the props
107
89
  // *must* be computed first to fetch the component's data-dependencies in
108
90
  // parallel with the component itself (the code).
109
-
110
91
  var entryPointParamsHash = stableStringify(entryPointParams);
111
-
112
92
  var _useMemo = useMemo(function () {
113
- return prepareEntryPoint(environmentProvider !== null && environmentProvider !== void 0 ? environmentProvider : {
114
- getEnvironment: function getEnvironment() {
115
- return environment;
116
- }
117
- }, entryPoint, entryPointParams); // NOTE: stableParams encodes the information from params
118
- // eslint-disable-next-line react-hooks/exhaustive-deps
119
- }, [environment, environmentProvider, getPreloadProps, entryPointParamsHash]),
120
- getComponent = _useMemo.getComponent,
121
- queries = _useMemo.queries,
122
- entryPoints = _useMemo.entryPoints,
123
- extraProps = _useMemo.extraProps,
124
- rootModuleID = _useMemo.rootModuleID;
125
-
93
+ return prepareEntryPoint(environmentProvider !== null && environmentProvider !== void 0 ? environmentProvider : {
94
+ getEnvironment: function getEnvironment() {
95
+ return environment;
96
+ }
97
+ }, entryPoint, entryPointParams);
98
+ // NOTE: stableParams encodes the information from params
99
+ // eslint-disable-next-line react-hooks/exhaustive-deps
100
+ }, [environment, environmentProvider, getPreloadProps, entryPointParamsHash]),
101
+ getComponent = _useMemo.getComponent,
102
+ queries = _useMemo.queries,
103
+ entryPoints = _useMemo.entryPoints,
104
+ extraProps = _useMemo.extraProps,
105
+ rootModuleID = _useMemo.rootModuleID;
126
106
  var Component = useMemo(function () {
127
107
  return getComponent();
128
108
  }, [getComponent]);
@@ -141,5 +121,4 @@ function LazyLoadEntryPointContainer_DEPRECATED(_ref) {
141
121
  queries: queries
142
122
  });
143
123
  }
144
-
145
124
  module.exports = LazyLoadEntryPointContainer_DEPRECATED;
@@ -4,20 +4,18 @@
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
- * @emails oncall+relay
8
7
  *
9
8
  * @format
9
+ * @oncall relay
10
10
  */
11
- // flowlint ambiguous-object-type:error
12
- 'use strict';
13
11
 
14
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
12
+ 'use strict';
15
13
 
14
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
16
15
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
17
-
18
16
  var React = require('react');
19
-
20
17
  var useMemo = React.useMemo;
18
+
21
19
  /**
22
20
  * Renders the results of a data-driven dependency fetched with the `@match`
23
21
  * directive. The `@match` directive can be used to specify a mapping of
@@ -85,39 +83,35 @@ var useMemo = React.useMemo;
85
83
  * your server returns for the `js(moduleName: String)` field).
86
84
  *
87
85
  */
86
+
88
87
  // Note: this type is intentionally non-exact, it is expected that the
89
88
  // object may contain sibling fields.
90
89
 
91
90
  function MatchContainer(_ref2) {
92
91
  var _ref;
93
-
94
92
  var fallback = _ref2.fallback,
95
- loader = _ref2.loader,
96
- match = _ref2.match,
97
- props = _ref2.props;
98
-
93
+ loader = _ref2.loader,
94
+ match = _ref2.match,
95
+ props = _ref2.props;
99
96
  if (match != null && typeof match !== 'object') {
100
97
  throw new Error('MatchContainer: Expected `match` value to be an object or null/undefined.');
101
- } // NOTE: the MatchPointer type has a $fragmentSpreads field to ensure that only
98
+ }
99
+ // NOTE: the MatchPointer type has a $fragmentSpreads field to ensure that only
102
100
  // an object that contains a FragmentSpread can be passed. If the fragment
103
101
  // spread matches, then the metadata fields below (__id, __fragments, etc.)
104
102
  // will be present. But they can be missing if all the fragment spreads use
105
103
  // @module and none of the types matched. The cast here is necessary because
106
104
  // fragment Flow types don't describe metadata fields, only the actual schema
107
105
  // fields the developer selected.
108
-
109
-
110
106
  var _ref3 = (_ref = match) !== null && _ref !== void 0 ? _ref : {},
111
- __id = _ref3.__id,
112
- __fragments = _ref3.__fragments,
113
- __fragmentOwner = _ref3.__fragmentOwner,
114
- __fragmentPropName = _ref3.__fragmentPropName,
115
- __module_component = _ref3.__module_component;
116
-
107
+ __id = _ref3.__id,
108
+ __fragments = _ref3.__fragments,
109
+ __fragmentOwner = _ref3.__fragmentOwner,
110
+ __fragmentPropName = _ref3.__fragmentPropName,
111
+ __module_component = _ref3.__module_component;
117
112
  if (__fragmentOwner != null && typeof __fragmentOwner !== 'object' || __fragmentPropName != null && typeof __fragmentPropName !== 'string' || __fragments != null && typeof __fragments !== 'object' || __id != null && typeof __id !== 'string') {
118
113
  throw new Error("MatchContainer: Invalid 'match' value, expected an object that has a " + "'...SomeFragment' spread.");
119
114
  }
120
-
121
115
  var LoadedContainer = __module_component != null ? loader(__module_component) : null;
122
116
  var fragmentProps = useMemo(function () {
123
117
  // TODO: Perform this transformation in RelayReader so that unchanged
@@ -131,10 +125,8 @@ function MatchContainer(_ref2) {
131
125
  };
132
126
  return fragProps;
133
127
  }
134
-
135
128
  return null;
136
129
  }, [__id, __fragments, __fragmentOwner, __fragmentPropName]);
137
-
138
130
  if (LoadedContainer != null && fragmentProps != null) {
139
131
  // $FlowFixMe[incompatible-type]
140
132
  // $FlowFixMe[cannot-spread-indexer]
@@ -143,5 +135,4 @@ function MatchContainer(_ref2) {
143
135
  return fallback !== null && fallback !== void 0 ? fallback : null;
144
136
  }
145
137
  }
146
-
147
138
  module.exports = MatchContainer;
@@ -4,18 +4,18 @@
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
- * @emails oncall+relay
8
7
  *
9
8
  * @format
9
+ * @oncall relay
10
10
  */
11
- // flowlint ambiguous-object-type:error
11
+
12
12
  // This contextual profiler can be used to wrap a react sub-tree. It will bind
13
13
  // the RelayProfiler during the render phase of these components. Allows
14
14
  // collecting metrics for a specific part of your application.
15
+
15
16
  'use strict';
16
17
 
17
18
  var React = require('react');
18
-
19
19
  var ProfilerContext = React.createContext({
20
20
  wrapPrepareQueryResource: function wrapPrepareQueryResource(cb) {
21
21
  return cb();