react-relay 14.1.0 → 16.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (196) hide show
  1. package/ReactRelayContainerUtils.js.flow +1 -0
  2. package/ReactRelayContext.js +1 -1
  3. package/ReactRelayContext.js.flow +1 -0
  4. package/ReactRelayFragmentContainer.js.flow +6 -2
  5. package/ReactRelayFragmentMockRenderer.js.flow +1 -0
  6. package/ReactRelayLocalQueryRenderer.js.flow +5 -3
  7. package/ReactRelayPaginationContainer.js.flow +21 -12
  8. package/ReactRelayQueryFetcher.js.flow +20 -10
  9. package/ReactRelayQueryRenderer.js.flow +15 -11
  10. package/ReactRelayQueryRendererContext.js.flow +1 -0
  11. package/ReactRelayRefetchContainer.js.flow +9 -5
  12. package/ReactRelayTestMocker.js.flow +3 -1
  13. package/ReactRelayTypes.js.flow +2 -0
  14. package/RelayContext.js.flow +1 -0
  15. package/__flowtests__/ReactRelayFragmentContainer-flowtest.js.flow +2 -1
  16. package/__flowtests__/ReactRelayPaginationContainer-flowtest.js.flow +1 -0
  17. package/__flowtests__/ReactRelayRefetchContainer-flowtest.js.flow +1 -0
  18. package/__flowtests__/RelayModern-flowtest.js.flow +1 -0
  19. package/__flowtests__/RelayModernFlowtest_badref.graphql.js.flow +1 -0
  20. package/__flowtests__/RelayModernFlowtest_notref.graphql.js.flow +1 -0
  21. package/__flowtests__/RelayModernFlowtest_user.graphql.js.flow +1 -0
  22. package/__flowtests__/RelayModernFlowtest_users.graphql.js.flow +1 -0
  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 -0
  34. package/buildReactRelayContainer.js.flow +10 -6
  35. package/getRootVariablesForFragments.js.flow +1 -1
  36. package/hooks.js +1 -1
  37. package/hooks.js.flow +4 -0
  38. package/index.js +1 -1
  39. package/index.js.flow +4 -0
  40. package/isRelayEnvironment.js.flow +1 -0
  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 -0
  46. package/lib/ReactRelayContainerUtils.js +0 -11
  47. package/lib/ReactRelayContext.js +1 -12
  48. package/lib/ReactRelayFragmentContainer.js +23 -122
  49. package/lib/ReactRelayFragmentMockRenderer.js +0 -12
  50. package/lib/ReactRelayLocalQueryRenderer.js +12 -41
  51. package/lib/ReactRelayPaginationContainer.js +45 -341
  52. package/lib/ReactRelayQueryFetcher.js +36 -111
  53. package/lib/ReactRelayQueryRenderer.js +29 -137
  54. package/lib/ReactRelayQueryRendererContext.js +0 -10
  55. package/lib/ReactRelayRefetchContainer.js +33 -166
  56. package/lib/ReactRelayTestMocker.js +18 -128
  57. package/lib/ReactRelayTypes.js +0 -9
  58. package/lib/RelayContext.js +0 -23
  59. package/lib/assertFragmentMap.js +0 -16
  60. package/lib/buildReactRelayContainer.js +7 -41
  61. package/lib/getRootVariablesForFragments.js +2 -19
  62. package/lib/hooks.js +3 -30
  63. package/lib/index.js +3 -39
  64. package/lib/isRelayEnvironment.js +1 -16
  65. package/lib/jest-react/enqueueTask.js +1 -25
  66. package/lib/jest-react/index.js +0 -1
  67. package/lib/jest-react/internalAct.js +2 -51
  68. package/lib/legacy.js +0 -20
  69. package/lib/multi-actor/ActorChange.js +0 -14
  70. package/lib/multi-actor/index.js +0 -10
  71. package/lib/multi-actor/useRelayActorEnvironment.js +2 -16
  72. package/lib/relay-hooks/EntryPointContainer.react.js +7 -23
  73. package/lib/relay-hooks/EntryPointTypes.flow.js +0 -10
  74. package/lib/relay-hooks/FragmentResource.js +130 -280
  75. package/lib/relay-hooks/HooksImplementation.js +0 -14
  76. package/lib/relay-hooks/InternalLogger.js +0 -11
  77. package/lib/relay-hooks/LRUCache.js +0 -39
  78. package/lib/relay-hooks/LazyLoadEntryPointContainer_DEPRECATED.react.js +27 -65
  79. package/lib/relay-hooks/MatchContainer.js +9 -111
  80. package/lib/relay-hooks/NestedRelayEntryPointBuilderUtils.js +9 -0
  81. package/lib/relay-hooks/ProfilerContext.js +0 -14
  82. package/lib/relay-hooks/QueryResource.js +14 -149
  83. package/lib/relay-hooks/RelayEnvironmentProvider.js +3 -17
  84. package/lib/relay-hooks/SuspenseResource.js +2 -59
  85. package/lib/relay-hooks/loadEntryPoint.js +10 -45
  86. package/lib/relay-hooks/loadQuery.js +29 -169
  87. package/lib/relay-hooks/preloadQuery_DEPRECATED.js +8 -58
  88. package/lib/relay-hooks/prepareEntryPoint_DEPRECATED.js +6 -24
  89. package/lib/relay-hooks/react-cache/RelayReactCache.js +4 -20
  90. package/lib/relay-hooks/react-cache/getQueryResultOrFetchQuery_REACT_CACHE.js +13 -102
  91. package/lib/relay-hooks/react-cache/readFragmentInternal_REACT_CACHE.js +18 -75
  92. package/lib/relay-hooks/react-cache/useFragmentInternal_REACT_CACHE.js +79 -222
  93. package/lib/relay-hooks/react-cache/useFragment_REACT_CACHE.js +3 -27
  94. package/lib/relay-hooks/react-cache/useLazyLoadQuery_REACT_CACHE.js +11 -33
  95. package/lib/relay-hooks/react-cache/usePaginationFragment_REACT_CACHE.js +62 -85
  96. package/lib/relay-hooks/react-cache/usePreloadedQuery_REACT_CACHE.js +20 -63
  97. package/lib/relay-hooks/react-cache/useRefetchableFragmentInternal_REACT_CACHE.js +53 -179
  98. package/lib/relay-hooks/react-cache/useRefetchableFragment_REACT_CACHE.js +5 -27
  99. package/lib/relay-hooks/useBlockingPaginationFragment.js +58 -121
  100. package/lib/relay-hooks/useClientQuery.js +0 -21
  101. package/lib/relay-hooks/useEntryPointLoader.js +12 -100
  102. package/lib/relay-hooks/useFetchTrackingRef.js +6 -33
  103. package/lib/relay-hooks/useFragment.js +5 -32
  104. package/lib/relay-hooks/useFragmentNode.js +14 -55
  105. package/lib/relay-hooks/useIsMountedRef.js +2 -14
  106. package/lib/relay-hooks/useIsOperationNodeActive.js +6 -29
  107. package/lib/relay-hooks/useIsParentQueryActive.js +1 -15
  108. package/lib/relay-hooks/useLazyLoadQuery.js +2 -23
  109. package/lib/relay-hooks/useLazyLoadQueryNode.js +18 -63
  110. package/lib/relay-hooks/useLoadMoreFunction.js +44 -100
  111. package/lib/relay-hooks/useMemoOperationDescriptor.js +4 -23
  112. package/lib/relay-hooks/useMemoVariables.js +8 -43
  113. package/lib/relay-hooks/useMutation.js +6 -34
  114. package/lib/relay-hooks/usePaginationFragment.js +49 -89
  115. package/lib/relay-hooks/usePreloadedQuery.js +10 -54
  116. package/lib/relay-hooks/useQueryLoader.js +18 -116
  117. package/lib/relay-hooks/useRefetchableFragment.js +4 -30
  118. package/lib/relay-hooks/useRefetchableFragmentNode.js +58 -184
  119. package/lib/relay-hooks/useRelayEnvironment.js +2 -16
  120. package/lib/relay-hooks/useStaticFragmentNodeWarning.js +2 -20
  121. package/lib/relay-hooks/useSubscribeToInvalidationState.js +3 -28
  122. package/lib/relay-hooks/useSubscription.js +3 -22
  123. package/lib/relay-hooks/useUnsafeRef_DEPRECATED.js +12 -0
  124. package/multi-actor/ActorChange.js.flow +1 -1
  125. package/multi-actor/index.js.flow +1 -1
  126. package/multi-actor/useRelayActorEnvironment.js.flow +2 -2
  127. package/package.json +2 -2
  128. package/react-relay-hooks.js +2 -2
  129. package/react-relay-hooks.min.js +2 -2
  130. package/react-relay-legacy.js +2 -2
  131. package/react-relay-legacy.min.js +2 -2
  132. package/react-relay.js +2 -2
  133. package/react-relay.min.js +2 -2
  134. package/relay-hooks/EntryPointContainer.react.js.flow +6 -1
  135. package/relay-hooks/EntryPointTypes.flow.js.flow +23 -20
  136. package/relay-hooks/FragmentResource.js.flow +148 -34
  137. package/relay-hooks/HooksImplementation.js.flow +1 -1
  138. package/relay-hooks/InternalLogger.js.flow +1 -1
  139. package/relay-hooks/LRUCache.js.flow +1 -1
  140. package/relay-hooks/LazyLoadEntryPointContainer_DEPRECATED.react.js.flow +19 -10
  141. package/relay-hooks/MatchContainer.js.flow +1 -1
  142. package/relay-hooks/NestedRelayEntryPointBuilderUtils.js.flow +51 -0
  143. package/relay-hooks/ProfilerContext.js.flow +1 -1
  144. package/relay-hooks/QueryResource.js.flow +25 -5
  145. package/relay-hooks/RelayEnvironmentProvider.js.flow +2 -2
  146. package/relay-hooks/SuspenseResource.js.flow +1 -1
  147. package/relay-hooks/__flowtests__/EntryPointTypes/EntryPointElementConfig-flowtest.js.flow +3 -1
  148. package/relay-hooks/__flowtests__/EntryPointTypes/NestedEntrypoints-flowtest.js.flow +9 -7
  149. package/relay-hooks/__flowtests__/__generated__/useFragmentFlowtest_user.graphql.js.flow +3 -1
  150. package/relay-hooks/__flowtests__/__generated__/useFragmentFlowtest_users.graphql.js.flow +3 -1
  151. package/relay-hooks/__flowtests__/useBlockingPaginationFragment-flowtest.js.flow +40 -33
  152. package/relay-hooks/__flowtests__/useFragment-flowtest.js.flow +1 -1
  153. package/relay-hooks/__flowtests__/usePaginationFragment-flowtest.js.flow +38 -32
  154. package/relay-hooks/__flowtests__/useRefetchableFragment-flowtest.js.flow +20 -18
  155. package/relay-hooks/__flowtests__/utils.js.flow +13 -2
  156. package/relay-hooks/loadEntryPoint.js.flow +15 -8
  157. package/relay-hooks/loadQuery.js.flow +32 -8
  158. package/relay-hooks/preloadQuery_DEPRECATED.js.flow +5 -6
  159. package/relay-hooks/prepareEntryPoint_DEPRECATED.js.flow +17 -10
  160. package/relay-hooks/react-cache/RelayReactCache.js.flow +1 -1
  161. package/relay-hooks/react-cache/getQueryResultOrFetchQuery_REACT_CACHE.js.flow +4 -4
  162. package/relay-hooks/react-cache/readFragmentInternal_REACT_CACHE.js.flow +5 -4
  163. package/relay-hooks/react-cache/useFragmentInternal_REACT_CACHE.js.flow +32 -14
  164. package/relay-hooks/react-cache/useFragment_REACT_CACHE.js.flow +4 -10
  165. package/relay-hooks/react-cache/useLazyLoadQuery_REACT_CACHE.js.flow +1 -1
  166. package/relay-hooks/react-cache/usePaginationFragment_REACT_CACHE.js.flow +39 -49
  167. package/relay-hooks/react-cache/usePreloadedQuery_REACT_CACHE.js.flow +1 -2
  168. package/relay-hooks/react-cache/useRefetchableFragmentInternal_REACT_CACHE.js.flow +29 -16
  169. package/relay-hooks/react-cache/useRefetchableFragment_REACT_CACHE.js.flow +17 -33
  170. package/relay-hooks/useBlockingPaginationFragment.js.flow +85 -58
  171. package/relay-hooks/useClientQuery.js.flow +3 -3
  172. package/relay-hooks/useEntryPointLoader.js.flow +10 -6
  173. package/relay-hooks/useFetchTrackingRef.js.flow +5 -4
  174. package/relay-hooks/useFragment.js.flow +2 -2
  175. package/relay-hooks/useFragmentNode.js.flow +7 -6
  176. package/relay-hooks/useIsMountedRef.js.flow +1 -1
  177. package/relay-hooks/useIsOperationNodeActive.js.flow +1 -1
  178. package/relay-hooks/useIsParentQueryActive.js.flow +1 -1
  179. package/relay-hooks/useLazyLoadQuery.js.flow +2 -2
  180. package/relay-hooks/useLazyLoadQueryNode.js.flow +2 -2
  181. package/relay-hooks/useLoadMoreFunction.js.flow +27 -16
  182. package/relay-hooks/useMemoOperationDescriptor.js.flow +3 -3
  183. package/relay-hooks/useMemoVariables.js.flow +13 -29
  184. package/relay-hooks/useMutation.js.flow +30 -13
  185. package/relay-hooks/usePaginationFragment.js.flow +55 -54
  186. package/relay-hooks/usePreloadedQuery.js.flow +47 -22
  187. package/relay-hooks/useQueryLoader.js.flow +78 -21
  188. package/relay-hooks/useRefetchableFragment.js.flow +65 -33
  189. package/relay-hooks/useRefetchableFragmentNode.js.flow +38 -17
  190. package/relay-hooks/useRelayEnvironment.js.flow +2 -2
  191. package/relay-hooks/useStaticFragmentNodeWarning.js.flow +3 -3
  192. package/relay-hooks/useSubscribeToInvalidationState.js.flow +2 -2
  193. package/relay-hooks/useSubscription.js.flow +1 -1
  194. package/relay-hooks/useUnsafeRef_DEPRECATED.js.flow +25 -0
  195. package/lib/readContext.js +0 -27
  196. package/readContext.js.flow +0 -29
@@ -1,53 +1,29 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- * @emails oncall+relay
8
- * @format
9
- */
10
- // This file is sync'd from https://github.com/facebook/react/tree/main/packages/jest-react
11
1
  'use strict';
12
2
 
13
3
  var didWarnAboutMessageChannel = false;
14
4
  var enqueueTaskImpl = null;
15
-
16
5
  function enqueueTask(task) {
17
6
  if (enqueueTaskImpl === null) {
18
7
  try {
19
- // read require off the module object to get around the bundlers.
20
- // we don't want them to detect a require and bundle a Node polyfill.
21
8
  var requireString = ('require' + Math.random()).slice(0, 7);
22
- var nodeRequire = module && module[requireString]; // assuming we're in node, let's try to get node's
23
- // version of setImmediate, bypassing fake timers if any.
24
-
9
+ var nodeRequire = module && module[requireString];
25
10
  enqueueTaskImpl = nodeRequire.call(module, 'timers').setImmediate;
26
11
  } catch (_unused) {
27
- // we're in a browser
28
- // we can't use regular timers because they may still be faked
29
- // so we try MessageChannel+postMessage instead
30
12
  enqueueTaskImpl = function enqueueTaskImpl(callback) {
31
13
  if (process.env.NODE_ENV !== "production") {
32
14
  if (didWarnAboutMessageChannel === false) {
33
15
  didWarnAboutMessageChannel = true;
34
-
35
16
  if (typeof MessageChannel === 'undefined') {
36
17
  console.error('This browser does not have a MessageChannel implementation, ' + 'so enqueuing tasks via await act(async () => ...) will fail. ' + 'Please file an issue at https://github.com/facebook/react/issues ' + 'if you encounter this warning.');
37
18
  }
38
19
  }
39
20
  }
40
- /*global MessageChannel*/
41
-
42
-
43
21
  var channel = new MessageChannel();
44
22
  channel.port1.onmessage = callback;
45
23
  channel.port2.postMessage(undefined);
46
24
  };
47
25
  }
48
26
  }
49
-
50
27
  return enqueueTaskImpl(task);
51
28
  }
52
-
53
29
  module.exports = enqueueTask;
@@ -9,5 +9,4 @@ Object.defineProperty(exports, "act", {
9
9
  return _internalAct.act;
10
10
  }
11
11
  });
12
-
13
12
  var _internalAct = require("./internalAct");
@@ -1,73 +1,34 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- * @emails oncall+relay
8
- * @format
9
- */
10
-
11
- /* global jest */
12
- // This file is sync'd from https://github.com/facebook/react/tree/main/packages/jest-react
13
- // This version of `act` is only used by our tests. Unlike the public version
14
- // of `act`, it's designed to work identically in both production and
15
- // development. It may have slightly different behavior from the public
16
- // version, too, since our constraints in our test suite are not the same as
17
- // those of developers using React — we're testing React itself, as opposed to
18
- // building an app with React.
19
1
  'use strict';
20
2
 
21
3
  var enqueueTask = require('./enqueueTask');
22
-
23
- var Scheduler = require('scheduler/unstable_mock'); // The subset of a Promise that React APIs rely on. This resolves a value.
24
- // This doesn't require a return value neither from the handler nor the
25
- // then function.
26
-
27
-
4
+ var Scheduler = require('scheduler/unstable_mock');
28
5
  var actingUpdatesScopeDepth = 0;
29
-
30
6
  function act(scope) {
31
7
  if (Scheduler.unstable_flushAllWithoutAsserting === undefined) {
32
8
  throw Error('This version of `act` requires a special mock build of Scheduler.');
33
9
  }
34
-
35
10
  if (setTimeout._isMockFunction !== true) {
36
11
  throw Error("This version of `act` requires Jest's timer mocks " + '(i.e. jest.useFakeTimers).');
37
12
  }
38
-
39
13
  var previousIsActEnvironment = global.IS_REACT_ACT_ENVIRONMENT;
40
14
  var previousActingUpdatesScopeDepth = actingUpdatesScopeDepth;
41
15
  actingUpdatesScopeDepth++;
42
-
43
16
  if (process.env.NODE_ENV !== "production" && actingUpdatesScopeDepth === 1) {
44
- // Because this is not the "real" `act`, we set this to `false` so React
45
- // knows not to fire `act` warnings.
46
17
  global.IS_REACT_ACT_ENVIRONMENT = false;
47
18
  }
48
-
49
19
  var unwind = function unwind() {
50
20
  if (process.env.NODE_ENV !== "production" && actingUpdatesScopeDepth === 1) {
51
21
  global.IS_REACT_ACT_ENVIRONMENT = previousIsActEnvironment;
52
22
  }
53
-
54
23
  actingUpdatesScopeDepth--;
55
-
56
24
  if (process.env.NODE_ENV !== "production") {
57
25
  if (actingUpdatesScopeDepth > previousActingUpdatesScopeDepth) {
58
- // if it's _less than_ previousActingUpdatesScopeDepth, then we can
59
- // assume the 'other' one has warned
60
26
  console.error('You seem to have overlapping act() calls, this is not supported. ' + 'Be sure to await previous act() calls before making a new one. ');
61
27
  }
62
28
  }
63
- }; // TODO: This would be way simpler if 1) we required a promise to be
64
- // returned and 2) we could use async/await. Since it's only our used in
65
- // our test suite, we should be able to.
66
-
67
-
29
+ };
68
30
  try {
69
31
  var result = scope();
70
-
71
32
  if (typeof result === 'object' && result !== null && typeof result.then === 'function') {
72
33
  var thenableResult = result;
73
34
  return {
@@ -88,16 +49,11 @@ function act(scope) {
88
49
  };
89
50
  } else {
90
51
  var returnValue = result;
91
-
92
52
  try {
93
- // TODO: Let's not support non-async scopes at all in our tests. Need to
94
- // migrate existing tests.
95
53
  var didFlushWork;
96
-
97
54
  do {
98
55
  didFlushWork = Scheduler.unstable_flushAllWithoutAsserting();
99
56
  } while (didFlushWork);
100
-
101
57
  return {
102
58
  then: function then(resolve, reject) {
103
59
  resolve(returnValue);
@@ -112,15 +68,11 @@ function act(scope) {
112
68
  throw error;
113
69
  }
114
70
  }
115
-
116
71
  function flushActWork(resolve, reject) {
117
- // Flush suspended fallbacks
118
- // $FlowFixMe: Flow doesn't know about global Jest object
119
72
  jest.runOnlyPendingTimers();
120
73
  enqueueTask(function () {
121
74
  try {
122
75
  var didFlushWork = Scheduler.unstable_flushAllWithoutAsserting();
123
-
124
76
  if (didFlushWork) {
125
77
  flushActWork(resolve, reject);
126
78
  } else {
@@ -131,5 +83,4 @@ function flushActWork(resolve, reject) {
131
83
  }
132
84
  });
133
85
  }
134
-
135
86
  exports.act = act;
package/lib/legacy.js CHANGED
@@ -1,32 +1,12 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- *
8
- * @format
9
- */
10
1
  'use strict';
11
2
 
12
3
  var ReactRelayContext = require('./ReactRelayContext');
13
-
14
4
  var ReactRelayFragmentContainer = require('./ReactRelayFragmentContainer');
15
-
16
5
  var ReactRelayLocalQueryRenderer = require('./ReactRelayLocalQueryRenderer');
17
-
18
6
  var ReactRelayPaginationContainer = require('./ReactRelayPaginationContainer');
19
-
20
7
  var ReactRelayQueryRenderer = require('./ReactRelayQueryRenderer');
21
-
22
8
  var ReactRelayRefetchContainer = require('./ReactRelayRefetchContainer');
23
-
24
9
  var RelayRuntime = require('relay-runtime');
25
-
26
- /**
27
- * Legacy react-relay exports.
28
- * Should prefer using interface defined in ./hooks.js
29
- */
30
10
  module.exports = {
31
11
  ConnectionHandler: RelayRuntime.ConnectionHandler,
32
12
  QueryRenderer: ReactRelayQueryRenderer,
@@ -1,21 +1,8 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- *
8
- * @emails oncall+relay
9
- * @format
10
- */
11
1
  'use strict';
12
2
 
13
3
  var RelayEnvironmentProvider = require('../relay-hooks/RelayEnvironmentProvider');
14
-
15
4
  var useRelayActorEnvironment = require('./useRelayActorEnvironment');
16
-
17
5
  var React = require('react');
18
-
19
6
  function ActorChange(props) {
20
7
  var actorEnvironment = useRelayActorEnvironment(props.actorChangePoint.__viewer);
21
8
  var getEnvironmentForActor = React.useCallback(function (actorIdentifier) {
@@ -26,5 +13,4 @@ function ActorChange(props) {
26
13
  getEnvironmentForActor: getEnvironmentForActor
27
14
  }, props.children(props.actorChangePoint.__fragmentRef, props.actorChangePoint.__viewer));
28
15
  }
29
-
30
16
  module.exports = ActorChange;
@@ -1,11 +1 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- *
8
- * @emails oncall+relay
9
- * @format
10
- */
11
1
  'use strict';
@@ -1,22 +1,9 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- * @emails oncall+relay
8
- *
9
- * @format
10
- */
11
1
  'use strict';
12
2
 
3
+ var ReactRelayContext = require('./../ReactRelayContext');
13
4
  var invariant = require('invariant');
14
-
15
5
  var _require = require('react'),
16
- useContext = _require.useContext;
17
-
18
- var ReactRelayContext = require('react-relay/ReactRelayContext');
19
-
6
+ useContext = _require.useContext;
20
7
  function useRelayActorEnvironment(actorIdentifier) {
21
8
  var context = useContext(ReactRelayContext);
22
9
  !(context != null) ? process.env.NODE_ENV !== "production" ? invariant(false, 'useRelayActorEnvironment: Expected to have found a Relay environment provided by ' + 'a `RelayEnvironmentProvider` component. ' + 'This usually means that useRelayActorEnvironment was used in a ' + 'component that is not a descendant of a `RelayEnvironmentProvider`. ' + 'Please make sure a `RelayEnvironmentProvider` has been rendered somewhere ' + 'as a parent or ancestor of your component.') : invariant(false) : void 0;
@@ -24,5 +11,4 @@ function useRelayActorEnvironment(actorIdentifier) {
24
11
  !(getEnvironmentForActor != null) ? process.env.NODE_ENV !== "production" ? invariant(false, 'useRelayActorEnvironment: Expected to have a function `getEnvironmentForActor`.' + 'This usually means that `RelayEnvironmentProvider`. was not properly set up for use in the ' + 'multi actor application. Please make sure the provider has defined a `getEnvironmentForActor`.') : invariant(false) : void 0;
25
12
  return getEnvironmentForActor(actorIdentifier);
26
13
  }
27
-
28
14
  module.exports = useRelayActorEnvironment;
@@ -1,36 +1,21 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- * @emails oncall+relay
8
- *
9
- * @format
10
- */
11
1
  'use strict';
12
2
 
13
3
  var ProfilerContext = require('./ProfilerContext');
14
-
15
4
  var useRelayEnvironment = require('./useRelayEnvironment');
16
-
17
5
  var React = require('react');
18
-
19
6
  var _require = require('react'),
20
- useContext = _require.useContext,
21
- useEffect = _require.useEffect;
22
-
7
+ useContext = _require.useContext,
8
+ useEffect = _require.useEffect;
23
9
  var warning = require("fbjs/lib/warning");
24
-
25
10
  function EntryPointContainer(_ref) {
26
11
  var entryPointReference = _ref.entryPointReference,
27
- props = _ref.props;
12
+ props = _ref.props;
28
13
  process.env.NODE_ENV !== "production" ? warning(entryPointReference.isDisposed === false, '<EntryPointContainer>: Expected entryPointReference to not be disposed ' + 'yet. This is because disposing the entrypoint marks it for future garbage ' + 'collection, and as such may no longer be present in the Relay store. ' + 'In the future, this will become a hard error.') : void 0;
29
14
  var getComponent = entryPointReference.getComponent,
30
- queries = entryPointReference.queries,
31
- entryPoints = entryPointReference.entryPoints,
32
- extraProps = entryPointReference.extraProps,
33
- rootModuleID = entryPointReference.rootModuleID;
15
+ queries = entryPointReference.queries,
16
+ entryPoints = entryPointReference.entryPoints,
17
+ extraProps = entryPointReference.extraProps,
18
+ rootModuleID = entryPointReference.rootModuleID;
34
19
  var Component = getComponent();
35
20
  var profilerContext = useContext(ProfilerContext);
36
21
  var environment = useRelayEnvironment();
@@ -48,5 +33,4 @@ function EntryPointContainer(_ref) {
48
33
  queries: queries
49
34
  });
50
35
  }
51
-
52
36
  module.exports = EntryPointContainer;
@@ -1,11 +1 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- * @emails oncall+relay
8
- *
9
- * @format
10
- */
11
1
  'use strict';