react-relay 14.1.0 → 15.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/ReactRelayContainerUtils.js.flow +1 -0
- package/ReactRelayContext.js +1 -1
- package/ReactRelayContext.js.flow +1 -0
- package/ReactRelayFragmentContainer.js.flow +6 -2
- package/ReactRelayFragmentMockRenderer.js.flow +1 -0
- package/ReactRelayLocalQueryRenderer.js.flow +5 -3
- package/ReactRelayPaginationContainer.js.flow +21 -12
- package/ReactRelayQueryFetcher.js.flow +19 -5
- package/ReactRelayQueryRenderer.js.flow +32 -1
- package/ReactRelayQueryRendererContext.js.flow +1 -0
- package/ReactRelayRefetchContainer.js.flow +9 -5
- package/ReactRelayTestMocker.js.flow +3 -1
- package/ReactRelayTypes.js.flow +1 -0
- package/RelayContext.js.flow +1 -0
- package/__flowtests__/ReactRelayFragmentContainer-flowtest.js.flow +2 -1
- package/__flowtests__/ReactRelayPaginationContainer-flowtest.js.flow +1 -0
- package/__flowtests__/ReactRelayRefetchContainer-flowtest.js.flow +1 -0
- package/__flowtests__/RelayModern-flowtest.js.flow +1 -0
- package/__flowtests__/RelayModernFlowtest_badref.graphql.js.flow +1 -0
- package/__flowtests__/RelayModernFlowtest_notref.graphql.js.flow +1 -0
- package/__flowtests__/RelayModernFlowtest_user.graphql.js.flow +1 -0
- package/__flowtests__/RelayModernFlowtest_users.graphql.js.flow +1 -0
- package/__flowtests__/__generated__/ReactRelayFragmentContainerFlowtest_viewer.graphql.js.flow +3 -1
- package/__flowtests__/__generated__/ReactRelayFragmentContainerFlowtest_viewer2.graphql.js.flow +3 -1
- package/__flowtests__/__generated__/ReactRelayPaginationContainerFlowtestQuery.graphql.js.flow +4 -2
- package/__flowtests__/__generated__/ReactRelayPaginationContainerFlowtest_viewer.graphql.js.flow +3 -1
- package/__flowtests__/__generated__/ReactRelayRefetchContainerFlowtestQuery.graphql.js.flow +4 -2
- package/__flowtests__/__generated__/ReactRelayRefetchContainerFlowtest_viewer.graphql.js.flow +3 -1
- package/__flowtests__/__generated__/RelayModernFlowtest_badref.graphql.js.flow +4 -2
- package/__flowtests__/__generated__/RelayModernFlowtest_notref.graphql.js.flow +4 -2
- package/__flowtests__/__generated__/RelayModernFlowtest_user.graphql.js.flow +3 -1
- package/__flowtests__/__generated__/RelayModernFlowtest_users.graphql.js.flow +3 -1
- package/assertFragmentMap.js.flow +1 -0
- package/buildReactRelayContainer.js.flow +7 -5
- package/getRootVariablesForFragments.js.flow +1 -1
- package/hooks.js +1 -1
- package/hooks.js.flow +4 -0
- package/index.js +1 -1
- package/index.js.flow +4 -0
- package/isRelayEnvironment.js.flow +1 -0
- package/jest-react/enqueueTask.js.flow +1 -1
- package/jest-react/index.js.flow +1 -1
- package/jest-react/internalAct.js.flow +1 -1
- package/legacy.js +1 -1
- package/legacy.js.flow +1 -0
- package/lib/ReactRelayContainerUtils.js +2 -2
- package/lib/ReactRelayContext.js +3 -3
- package/lib/ReactRelayFragmentContainer.js +39 -66
- package/lib/ReactRelayFragmentMockRenderer.js +2 -3
- package/lib/ReactRelayLocalQueryRenderer.js +18 -30
- package/lib/ReactRelayPaginationContainer.js +66 -159
- package/lib/ReactRelayQueryFetcher.js +48 -74
- package/lib/ReactRelayQueryRenderer.js +62 -82
- package/lib/ReactRelayQueryRendererContext.js +2 -1
- package/lib/ReactRelayRefetchContainer.js +52 -99
- package/lib/ReactRelayTestMocker.js +32 -66
- package/lib/ReactRelayTypes.js +2 -0
- package/lib/RelayContext.js +4 -6
- package/lib/assertFragmentMap.js +3 -4
- package/lib/buildReactRelayContainer.js +10 -25
- package/lib/getRootVariablesForFragments.js +5 -8
- package/lib/hooks.js +5 -17
- package/lib/index.js +5 -24
- package/lib/isRelayEnvironment.js +5 -3
- package/lib/jest-react/enqueueTask.js +5 -9
- package/lib/jest-react/index.js +0 -1
- package/lib/jest-react/internalAct.js +9 -20
- package/lib/legacy.js +2 -7
- package/lib/multi-actor/ActorChange.js +2 -5
- package/lib/multi-actor/index.js +2 -1
- package/lib/multi-actor/useRelayActorEnvironment.js +4 -7
- package/lib/relay-hooks/EntryPointContainer.react.js +9 -14
- package/lib/relay-hooks/EntryPointTypes.flow.js +5 -2
- package/lib/relay-hooks/FragmentResource.js +102 -196
- package/lib/relay-hooks/HooksImplementation.js +2 -5
- package/lib/relay-hooks/InternalLogger.js +2 -2
- package/lib/relay-hooks/LRUCache.js +2 -19
- package/lib/relay-hooks/LazyLoadEntryPointContainer_DEPRECATED.react.js +33 -53
- package/lib/relay-hooks/MatchContainer.js +14 -22
- package/lib/relay-hooks/ProfilerContext.js +3 -2
- package/lib/relay-hooks/QueryResource.js +30 -99
- package/lib/relay-hooks/RelayEnvironmentProvider.js +5 -8
- package/lib/relay-hooks/SuspenseResource.js +8 -31
- package/lib/relay-hooks/loadEntryPoint.js +19 -31
- package/lib/relay-hooks/loadQuery.js +41 -77
- package/lib/relay-hooks/preloadQuery_DEPRECATED.js +10 -35
- package/lib/relay-hooks/prepareEntryPoint_DEPRECATED.js +9 -14
- package/lib/relay-hooks/react-cache/RelayReactCache.js +7 -11
- package/lib/relay-hooks/react-cache/getQueryResultOrFetchQuery_REACT_CACHE.js +24 -78
- package/lib/relay-hooks/react-cache/readFragmentInternal_REACT_CACHE.js +23 -56
- package/lib/relay-hooks/react-cache/useFragmentInternal_REACT_CACHE.js +65 -143
- package/lib/relay-hooks/react-cache/useFragment_REACT_CACHE.js +5 -14
- package/lib/relay-hooks/react-cache/useLazyLoadQuery_REACT_CACHE.js +17 -23
- package/lib/relay-hooks/react-cache/usePaginationFragment_REACT_CACHE.js +73 -74
- package/lib/relay-hooks/react-cache/usePreloadedQuery_REACT_CACHE.js +24 -38
- package/lib/relay-hooks/react-cache/useRefetchableFragmentInternal_REACT_CACHE.js +60 -102
- package/lib/relay-hooks/react-cache/useRefetchableFragment_REACT_CACHE.js +7 -15
- package/lib/relay-hooks/useBlockingPaginationFragment.js +71 -92
- package/lib/relay-hooks/useClientQuery.js +3 -6
- package/lib/relay-hooks/useEntryPointLoader.js +17 -36
- package/lib/relay-hooks/useFetchTrackingRef.js +10 -11
- package/lib/relay-hooks/useFragment.js +8 -18
- package/lib/relay-hooks/useFragmentNode.js +20 -31
- package/lib/relay-hooks/useIsMountedRef.js +4 -5
- package/lib/relay-hooks/useIsOperationNodeActive.js +8 -20
- package/lib/relay-hooks/useIsParentQueryActive.js +3 -6
- package/lib/relay-hooks/useLazyLoadQuery.js +6 -9
- package/lib/relay-hooks/useLazyLoadQueryNode.js +23 -33
- package/lib/relay-hooks/useLoadMoreFunction.js +45 -76
- package/lib/relay-hooks/useMemoOperationDescriptor.js +6 -14
- package/lib/relay-hooks/useMemoVariables.js +15 -33
- package/lib/relay-hooks/useMutation.js +8 -25
- package/lib/relay-hooks/usePaginationFragment.js +61 -76
- package/lib/relay-hooks/usePreloadedQuery.js +12 -29
- package/lib/relay-hooks/useQueryLoader.js +23 -47
- package/lib/relay-hooks/useRefetchableFragment.js +8 -18
- package/lib/relay-hooks/useRefetchableFragmentNode.js +64 -107
- package/lib/relay-hooks/useRelayEnvironment.js +4 -7
- package/lib/relay-hooks/useStaticFragmentNodeWarning.js +4 -7
- package/lib/relay-hooks/useSubscribeToInvalidationState.js +8 -8
- package/lib/relay-hooks/useSubscription.js +5 -9
- package/lib/relay-hooks/useUnsafeRef_DEPRECATED.js +29 -0
- package/multi-actor/ActorChange.js.flow +1 -1
- package/multi-actor/index.js.flow +1 -1
- package/multi-actor/useRelayActorEnvironment.js.flow +2 -2
- package/package.json +2 -2
- package/react-relay-hooks.js +2 -2
- package/react-relay-hooks.min.js +2 -2
- package/react-relay-legacy.js +2 -2
- package/react-relay-legacy.min.js +2 -2
- package/react-relay.js +2 -2
- package/react-relay.min.js +2 -2
- package/relay-hooks/EntryPointContainer.react.js.flow +1 -1
- package/relay-hooks/EntryPointTypes.flow.js.flow +7 -5
- package/relay-hooks/FragmentResource.js.flow +34 -8
- package/relay-hooks/HooksImplementation.js.flow +1 -1
- package/relay-hooks/InternalLogger.js.flow +1 -1
- package/relay-hooks/LRUCache.js.flow +1 -1
- package/relay-hooks/LazyLoadEntryPointContainer_DEPRECATED.react.js.flow +15 -8
- package/relay-hooks/MatchContainer.js.flow +1 -1
- package/relay-hooks/ProfilerContext.js.flow +1 -1
- package/relay-hooks/QueryResource.js.flow +25 -5
- package/relay-hooks/RelayEnvironmentProvider.js.flow +2 -2
- package/relay-hooks/SuspenseResource.js.flow +1 -1
- package/relay-hooks/__flowtests__/EntryPointTypes/EntryPointElementConfig-flowtest.js.flow +3 -1
- package/relay-hooks/__flowtests__/EntryPointTypes/NestedEntrypoints-flowtest.js.flow +2 -2
- package/relay-hooks/__flowtests__/__generated__/useFragmentFlowtest_user.graphql.js.flow +3 -1
- package/relay-hooks/__flowtests__/__generated__/useFragmentFlowtest_users.graphql.js.flow +3 -1
- package/relay-hooks/__flowtests__/useBlockingPaginationFragment-flowtest.js.flow +35 -33
- package/relay-hooks/__flowtests__/useFragment-flowtest.js.flow +1 -1
- package/relay-hooks/__flowtests__/usePaginationFragment-flowtest.js.flow +33 -32
- package/relay-hooks/__flowtests__/useRefetchableFragment-flowtest.js.flow +18 -18
- package/relay-hooks/__flowtests__/utils.js.flow +13 -2
- package/relay-hooks/loadEntryPoint.js.flow +11 -6
- package/relay-hooks/loadQuery.js.flow +11 -7
- package/relay-hooks/preloadQuery_DEPRECATED.js.flow +5 -6
- package/relay-hooks/prepareEntryPoint_DEPRECATED.js.flow +13 -8
- package/relay-hooks/react-cache/RelayReactCache.js.flow +1 -1
- package/relay-hooks/react-cache/getQueryResultOrFetchQuery_REACT_CACHE.js.flow +4 -4
- package/relay-hooks/react-cache/readFragmentInternal_REACT_CACHE.js.flow +3 -3
- package/relay-hooks/react-cache/useFragmentInternal_REACT_CACHE.js.flow +4 -4
- package/relay-hooks/react-cache/useFragment_REACT_CACHE.js.flow +1 -1
- package/relay-hooks/react-cache/useLazyLoadQuery_REACT_CACHE.js.flow +1 -1
- package/relay-hooks/react-cache/usePaginationFragment_REACT_CACHE.js.flow +41 -22
- package/relay-hooks/react-cache/usePreloadedQuery_REACT_CACHE.js.flow +1 -2
- package/relay-hooks/react-cache/useRefetchableFragmentInternal_REACT_CACHE.js.flow +11 -5
- package/relay-hooks/react-cache/useRefetchableFragment_REACT_CACHE.js.flow +2 -2
- package/relay-hooks/useBlockingPaginationFragment.js.flow +85 -56
- package/relay-hooks/useClientQuery.js.flow +1 -1
- package/relay-hooks/useEntryPointLoader.js.flow +10 -6
- package/relay-hooks/useFetchTrackingRef.js.flow +5 -4
- package/relay-hooks/useFragment.js.flow +2 -2
- package/relay-hooks/useFragmentNode.js.flow +5 -4
- package/relay-hooks/useIsMountedRef.js.flow +1 -1
- package/relay-hooks/useIsOperationNodeActive.js.flow +1 -1
- package/relay-hooks/useIsParentQueryActive.js.flow +1 -1
- package/relay-hooks/useLazyLoadQuery.js.flow +2 -2
- package/relay-hooks/useLazyLoadQueryNode.js.flow +2 -2
- package/relay-hooks/useLoadMoreFunction.js.flow +14 -9
- package/relay-hooks/useMemoOperationDescriptor.js.flow +3 -3
- package/relay-hooks/useMemoVariables.js.flow +13 -29
- package/relay-hooks/useMutation.js.flow +4 -4
- package/relay-hooks/usePaginationFragment.js.flow +53 -46
- package/relay-hooks/usePreloadedQuery.js.flow +47 -22
- package/relay-hooks/useQueryLoader.js.flow +85 -22
- package/relay-hooks/useRefetchableFragment.js.flow +64 -33
- package/relay-hooks/useRefetchableFragmentNode.js.flow +10 -4
- package/relay-hooks/useRelayEnvironment.js.flow +2 -2
- package/relay-hooks/useStaticFragmentNodeWarning.js.flow +3 -3
- package/relay-hooks/useSubscribeToInvalidationState.js.flow +2 -2
- package/relay-hooks/useSubscription.js.flow +1 -1
- package/relay-hooks/useUnsafeRef_DEPRECATED.js.flow +25 -0
- package/lib/readContext.js +0 -27
- package/readContext.js.flow +0 -29
@@ -6,37 +6,36 @@
|
|
6
6
|
*
|
7
7
|
*
|
8
8
|
* @format
|
9
|
-
* @
|
9
|
+
* @oncall relay
|
10
10
|
*/
|
11
|
+
|
11
12
|
'use strict';
|
12
13
|
|
13
14
|
var _require = require('./loadQuery'),
|
14
|
-
|
15
|
-
|
15
|
+
loadQuery = _require.loadQuery;
|
16
16
|
function loadEntryPoint(environmentProvider, entryPoint, entryPointParams) {
|
17
17
|
// Start loading the code for the entrypoint
|
18
18
|
var loadingPromise = null;
|
19
|
-
|
20
19
|
if (entryPoint.root.getModuleIfRequired() == null) {
|
21
20
|
loadingPromise = entryPoint.root.load();
|
22
21
|
}
|
23
|
-
|
24
22
|
var preloadProps = entryPoint.getPreloadProps(entryPointParams);
|
25
23
|
var queries = preloadProps.queries,
|
26
|
-
|
27
|
-
|
24
|
+
entryPoints = preloadProps.entryPoints,
|
25
|
+
extraProps = preloadProps.extraProps;
|
28
26
|
var preloadedQueries = {};
|
29
27
|
var preloadedEntryPoints = {};
|
30
|
-
|
31
28
|
if (queries != null) {
|
32
29
|
var queriesPropNames = Object.keys(queries);
|
33
30
|
queriesPropNames.forEach(function (queryPropName) {
|
34
31
|
var _queries$queryPropNam = queries[queryPropName],
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
32
|
+
environmentProviderOptions = _queries$queryPropNam.environmentProviderOptions,
|
33
|
+
options = _queries$queryPropNam.options,
|
34
|
+
parameters = _queries$queryPropNam.parameters,
|
35
|
+
variables = _queries$queryPropNam.variables;
|
39
36
|
var environment = environmentProvider.getEnvironment(environmentProviderOptions);
|
37
|
+
|
38
|
+
// $FlowFixMe[underconstrained-implicit-instantiation]
|
40
39
|
preloadedQueries[queryPropName] = loadQuery(environment, parameters, variables, {
|
41
40
|
fetchPolicy: options === null || options === void 0 ? void 0 : options.fetchPolicy,
|
42
41
|
networkCacheConfig: options === null || options === void 0 ? void 0 : options.networkCacheConfig,
|
@@ -44,75 +43,64 @@ function loadEntryPoint(environmentProvider, entryPoint, entryPointParams) {
|
|
44
43
|
}, environmentProviderOptions);
|
45
44
|
});
|
46
45
|
}
|
47
|
-
|
48
46
|
if (entryPoints != null) {
|
49
47
|
var entryPointPropNames = Object.keys(entryPoints);
|
50
48
|
entryPointPropNames.forEach(function (entryPointPropName) {
|
51
49
|
var entryPointDescription = entryPoints[entryPointPropName];
|
52
|
-
|
53
50
|
if (entryPointDescription == null) {
|
54
51
|
return;
|
55
52
|
}
|
56
|
-
|
57
53
|
var nestedEntryPoint = entryPointDescription.entryPoint,
|
58
|
-
|
54
|
+
nestedParams = entryPointDescription.entryPointParams;
|
59
55
|
preloadedEntryPoints[entryPointPropName] = loadEntryPoint(environmentProvider, nestedEntryPoint, nestedParams);
|
60
56
|
});
|
61
57
|
}
|
62
|
-
|
63
58
|
var isDisposed = false;
|
64
59
|
return {
|
65
60
|
dispose: function dispose() {
|
66
61
|
if (isDisposed) {
|
67
62
|
return;
|
68
63
|
}
|
69
|
-
|
70
64
|
if (preloadedQueries != null) {
|
71
65
|
Object.values(preloadedQueries).forEach(function (_ref) {
|
72
66
|
var innerDispose = _ref.dispose;
|
73
67
|
innerDispose();
|
74
68
|
});
|
75
69
|
}
|
76
|
-
|
77
70
|
if (preloadedEntryPoints != null) {
|
78
71
|
Object.values(preloadedEntryPoints).forEach(function (_ref2) {
|
79
72
|
var innerDispose = _ref2.dispose;
|
80
73
|
innerDispose();
|
81
74
|
});
|
82
75
|
}
|
83
|
-
|
84
76
|
isDisposed = true;
|
85
77
|
},
|
86
78
|
entryPoints: preloadedEntryPoints,
|
87
79
|
extraProps: extraProps !== null && extraProps !== void 0 ? extraProps : null,
|
88
80
|
getComponent: function getComponent() {
|
89
81
|
var componentModule = entryPoint.root.getModuleIfRequired();
|
90
|
-
|
91
82
|
if (componentModule == null) {
|
92
83
|
var _loadingPromise;
|
93
|
-
|
94
84
|
loadingPromise = (_loadingPromise = loadingPromise) !== null && _loadingPromise !== void 0 ? _loadingPromise : entryPoint.root.load();
|
95
85
|
throw loadingPromise;
|
96
|
-
}
|
86
|
+
}
|
87
|
+
|
88
|
+
// On certain platforms, getting an es6 module with a default export from a JSResource will return an object like
|
97
89
|
// {default: module}, so let's assume that if the "component" has a static property named "default"
|
98
90
|
// that it's actually an es6 module wrapper, so unwrap it. This won't work for React classes with a static property named "default", but
|
99
91
|
// that's probably a worthwhile trade-off.
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
92
|
+
var component =
|
93
|
+
// $FlowIgnore[prop-missing]
|
94
|
+
componentModule["default"] != null ? componentModule["default"] : componentModule;
|
95
|
+
// $FlowFixMe[incompatible-cast] - trust me Flow, its entryPoint component
|
105
96
|
return component;
|
106
97
|
},
|
107
|
-
|
108
98
|
// $FlowFixMe[unsafe-getters-setters] - this has no side effects
|
109
99
|
get isDisposed() {
|
110
100
|
return isDisposed;
|
111
101
|
},
|
112
|
-
|
113
102
|
queries: preloadedQueries,
|
114
103
|
rootModuleID: entryPoint.root.getModuleId()
|
115
104
|
};
|
116
105
|
}
|
117
|
-
|
118
106
|
module.exports = loadEntryPoint;
|
@@ -6,51 +6,44 @@
|
|
6
6
|
*
|
7
7
|
*
|
8
8
|
* @format
|
9
|
-
* @
|
9
|
+
* @oncall relay
|
10
10
|
*/
|
11
|
+
|
11
12
|
'use strict';
|
12
13
|
|
13
14
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
14
|
-
|
15
15
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
16
|
-
|
17
16
|
var invariant = require('invariant');
|
18
|
-
|
19
17
|
var React = require('react');
|
20
|
-
|
21
18
|
var _require = require('relay-runtime'),
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
19
|
+
fetchQueryDeduped = _require.__internal.fetchQueryDeduped,
|
20
|
+
Observable = _require.Observable,
|
21
|
+
PreloadableQueryRegistry = _require.PreloadableQueryRegistry,
|
22
|
+
RelayFeatureFlags = _require.RelayFeatureFlags,
|
23
|
+
ReplaySubject = _require.ReplaySubject,
|
24
|
+
createOperationDescriptor = _require.createOperationDescriptor,
|
25
|
+
getRequest = _require.getRequest,
|
26
|
+
getRequestIdentifier = _require.getRequestIdentifier;
|
31
27
|
var warning = require("fbjs/lib/warning");
|
32
|
-
|
33
28
|
var RenderDispatcher = null;
|
34
29
|
var fetchKey = 100001;
|
35
|
-
|
36
30
|
function useTrackLoadQueryInRender() {
|
37
31
|
if (RenderDispatcher === null) {
|
38
32
|
var _React$__SECRET_INTER, _React$__SECRET_INTER2;
|
39
|
-
|
40
33
|
// Flow does not know of React internals (rightly so), but we need to
|
41
34
|
// ensure here that this function isn't called inside render.
|
42
35
|
RenderDispatcher = // $FlowFixMe[prop-missing]
|
43
36
|
(_React$__SECRET_INTER = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _React$__SECRET_INTER === void 0 ? void 0 : (_React$__SECRET_INTER2 = _React$__SECRET_INTER.ReactCurrentDispatcher) === null || _React$__SECRET_INTER2 === void 0 ? void 0 : _React$__SECRET_INTER2.current;
|
44
37
|
}
|
45
38
|
}
|
46
|
-
|
47
39
|
function loadQuery(environment, preloadableRequest, variables, options, environmentProviderOptions) {
|
48
40
|
var _React$__SECRET_INTER3, _React$__SECRET_INTER4, _options$__nameForWar, _options$fetchPolicy;
|
49
|
-
|
50
41
|
// This code ensures that we don't call loadQuery during render.
|
51
42
|
var CurrentDispatcher = // $FlowFixMe[prop-missing]
|
52
43
|
(_React$__SECRET_INTER3 = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _React$__SECRET_INTER3 === void 0 ? void 0 : (_React$__SECRET_INTER4 = _React$__SECRET_INTER3.ReactCurrentDispatcher) === null || _React$__SECRET_INTER4 === void 0 ? void 0 : _React$__SECRET_INTER4.current;
|
53
|
-
process.env.NODE_ENV !== "production" ? warning(RenderDispatcher == null || CurrentDispatcher !== RenderDispatcher, 'Relay: `%s` should not be called inside a React render function.', (_options$__nameForWar = options === null || options === void 0 ? void 0 : options.__nameForWarning) !== null && _options$__nameForWar !== void 0 ? _options$__nameForWar : 'loadQuery') : void 0;
|
44
|
+
process.env.NODE_ENV !== "production" ? warning(RenderDispatcher == null || CurrentDispatcher !== RenderDispatcher, 'Relay: `%s` should not be called inside a React render function.', (_options$__nameForWar = options === null || options === void 0 ? void 0 : options.__nameForWarning) !== null && _options$__nameForWar !== void 0 ? _options$__nameForWar : 'loadQuery') : void 0;
|
45
|
+
|
46
|
+
// Every time you call loadQuery, we will generate a new fetchKey.
|
54
47
|
// This will ensure that every query reference that is created and
|
55
48
|
// passed to usePreloadedQuery is independently evaluated,
|
56
49
|
// even if they are for the same query/variables.
|
@@ -59,25 +52,26 @@ function loadQuery(environment, preloadableRequest, variables, options, environm
|
|
59
52
|
// cache in usePreloadedQuery reuse the cached result instead of
|
60
53
|
// re-evaluating the new query ref and triggering a refetch if
|
61
54
|
// necessary.
|
62
|
-
|
63
55
|
fetchKey++;
|
64
56
|
var fetchPolicy = (_options$fetchPolicy = options === null || options === void 0 ? void 0 : options.fetchPolicy) !== null && _options$fetchPolicy !== void 0 ? _options$fetchPolicy : 'store-or-network';
|
65
57
|
var networkCacheConfig = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, options === null || options === void 0 ? void 0 : options.networkCacheConfig), {}, {
|
66
58
|
force: true
|
67
|
-
});
|
59
|
+
});
|
60
|
+
|
61
|
+
// executeWithNetworkSource will retain and execute an operation
|
68
62
|
// against the Relay store, given an Observable that would provide
|
69
63
|
// the network events for the operation.
|
70
|
-
|
71
64
|
var retainReference;
|
72
65
|
var didExecuteNetworkSource = false;
|
73
|
-
|
74
66
|
var executeWithNetworkSource = function executeWithNetworkSource(operation, networkObservable) {
|
75
67
|
didExecuteNetworkSource = true;
|
76
68
|
return environment.executeWithSource({
|
77
69
|
operation: operation,
|
78
70
|
source: networkObservable
|
79
71
|
});
|
80
|
-
};
|
72
|
+
};
|
73
|
+
|
74
|
+
// N.B. For loadQuery, we unconventionally want to return an Observable
|
81
75
|
// that isn't lazily executed, meaning that we don't want to wait
|
82
76
|
// until the returned Observable is subscribed to to actually start
|
83
77
|
// fetching and executing an operation; i.e. we want to execute the
|
@@ -86,20 +80,17 @@ function loadQuery(environment, preloadableRequest, variables, options, environm
|
|
86
80
|
// allows us to capture the events that occur during the eager execution
|
87
81
|
// of the operation, and then replay them to the Observable we
|
88
82
|
// ultimately return.
|
89
|
-
|
90
|
-
|
91
83
|
var executionSubject = new ReplaySubject();
|
92
84
|
var returnedObservable = Observable.create(function (sink) {
|
93
85
|
return executionSubject.subscribe(sink);
|
94
86
|
});
|
95
87
|
var unsubscribeFromNetworkRequest;
|
96
|
-
var networkError = null;
|
88
|
+
var networkError = null;
|
89
|
+
// makeNetworkRequest will immediately start a raw network request if
|
97
90
|
// one isn't already in flight and return an Observable that when
|
98
91
|
// subscribed to will replay the network events that have occured so far,
|
99
92
|
// as well as subsequent events.
|
100
|
-
|
101
93
|
var didMakeNetworkRequest = false;
|
102
|
-
|
103
94
|
var makeNetworkRequest = function makeNetworkRequest(params) {
|
104
95
|
// N.B. this function is called synchronously or not at all
|
105
96
|
// didMakeNetworkRequest is safe to rely on in the returned value
|
@@ -110,7 +101,6 @@ function loadQuery(environment, preloadableRequest, variables, options, environm
|
|
110
101
|
didMakeNetworkRequest = true;
|
111
102
|
var observable;
|
112
103
|
var subject = new ReplaySubject();
|
113
|
-
|
114
104
|
if (RelayFeatureFlags.ENABLE_LOAD_QUERY_REQUEST_DEDUPING === true) {
|
115
105
|
// Here, we are calling fetchQueryDeduped at the network layer level,
|
116
106
|
// which ensures that only a single network request is active for a given
|
@@ -136,21 +126,19 @@ function loadQuery(environment, preloadableRequest, variables, options, environm
|
|
136
126
|
var network = environment.getNetwork();
|
137
127
|
observable = network.execute(params, variables, networkCacheConfig);
|
138
128
|
}
|
139
|
-
|
140
129
|
var _observable$subscribe = observable.subscribe({
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
130
|
+
error: function error(err) {
|
131
|
+
networkError = err;
|
132
|
+
subject.error(err);
|
133
|
+
},
|
134
|
+
next: function next(data) {
|
135
|
+
subject.next(data);
|
136
|
+
},
|
137
|
+
complete: function complete() {
|
138
|
+
subject.complete();
|
139
|
+
}
|
140
|
+
}),
|
141
|
+
unsubscribe = _observable$subscribe.unsubscribe;
|
154
142
|
unsubscribeFromNetworkRequest = unsubscribe;
|
155
143
|
return Observable.create(function (sink) {
|
156
144
|
var subjectSubscription = subject.subscribe(sink);
|
@@ -160,9 +148,7 @@ function loadQuery(environment, preloadableRequest, variables, options, environm
|
|
160
148
|
};
|
161
149
|
});
|
162
150
|
};
|
163
|
-
|
164
151
|
var unsubscribeFromExecution;
|
165
|
-
|
166
152
|
var executeDeduped = function executeDeduped(operation, fetchFn) {
|
167
153
|
if (RelayFeatureFlags.ENABLE_LOAD_QUERY_REQUEST_DEDUPING === true) {
|
168
154
|
// N.B. at this point, if we're calling execute with a query ast (OperationDescriptor),
|
@@ -174,7 +160,9 @@ function loadQuery(environment, preloadableRequest, variables, options, environm
|
|
174
160
|
// so we set this to true before deduping, to guarantee that the `source`
|
175
161
|
// observable is returned.
|
176
162
|
didMakeNetworkRequest = true;
|
177
|
-
}
|
163
|
+
}
|
164
|
+
|
165
|
+
// Here, we are calling fetchQueryDeduped, which ensures that only
|
178
166
|
// a single operation is active for a given (environment, identifier) pair,
|
179
167
|
// and also tracks the active state of the operation, which is necessary
|
180
168
|
// for our Suspense infra to later be able to suspend (or not) on
|
@@ -188,8 +176,6 @@ function loadQuery(environment, preloadableRequest, variables, options, environm
|
|
188
176
|
// - If no duplicate active operation is found, it will call the fetchFn
|
189
177
|
// to execute the operation, and return an Observable that will provide
|
190
178
|
// the events for executing the operation.
|
191
|
-
|
192
|
-
|
193
179
|
var _fetchQueryDeduped$su = fetchQueryDeduped(environment, operation.request.identifier, fetchFn).subscribe({
|
194
180
|
error: function error(err) {
|
195
181
|
executionSubject.error(err);
|
@@ -201,23 +187,19 @@ function loadQuery(environment, preloadableRequest, variables, options, environm
|
|
201
187
|
executionSubject.complete();
|
202
188
|
}
|
203
189
|
});
|
204
|
-
|
205
190
|
unsubscribeFromExecution = _fetchQueryDeduped$su.unsubscribe;
|
206
191
|
};
|
207
|
-
|
208
192
|
var checkAvailabilityAndExecute = function checkAvailabilityAndExecute(concreteRequest) {
|
209
193
|
var operation = createOperationDescriptor(concreteRequest, variables, networkCacheConfig);
|
210
194
|
retainReference = environment.retain(operation);
|
211
|
-
|
212
195
|
if (fetchPolicy === 'store-only') {
|
213
196
|
return;
|
214
|
-
}
|
197
|
+
}
|
198
|
+
|
199
|
+
// N.B. If the fetch policy allows fulfillment from the store but the
|
215
200
|
// environment already has the data for that operation cached in the store,
|
216
201
|
// then we do nothing.
|
217
|
-
|
218
|
-
|
219
202
|
var shouldFetch = fetchPolicy !== 'store-or-network' || environment.check(operation).status !== 'available';
|
220
|
-
|
221
203
|
if (shouldFetch) {
|
222
204
|
executeDeduped(operation, function () {
|
223
205
|
// N.B. Since we have the operation synchronously available here,
|
@@ -228,20 +210,16 @@ function loadQuery(environment, preloadableRequest, variables, options, environm
|
|
228
210
|
});
|
229
211
|
}
|
230
212
|
};
|
231
|
-
|
232
213
|
var params;
|
233
214
|
var cancelOnLoadCallback;
|
234
215
|
var queryId;
|
235
|
-
|
236
216
|
if (preloadableRequest.kind === 'PreloadableConcreteRequest') {
|
237
217
|
var preloadableConcreteRequest = preloadableRequest;
|
238
218
|
params = preloadableConcreteRequest.params;
|
239
219
|
var _params = params;
|
240
220
|
queryId = _params.id;
|
241
221
|
!(queryId !== null) ? process.env.NODE_ENV !== "production" ? invariant(false, 'Relay: `loadQuery` requires that preloadable query `%s` has a persisted query id', params.name) : invariant(false) : void 0;
|
242
|
-
|
243
222
|
var _module = PreloadableQueryRegistry.get(queryId);
|
244
|
-
|
245
223
|
if (_module != null) {
|
246
224
|
checkAvailabilityAndExecute(_module);
|
247
225
|
} else {
|
@@ -252,20 +230,18 @@ function loadQuery(environment, preloadableRequest, variables, options, environm
|
|
252
230
|
// ast, and we know that if we don't have the query ast
|
253
231
|
// available, then this query could've never been written to the
|
254
232
|
// store in the first place, so it couldn't have been cached.
|
255
|
-
var networkObservable = fetchPolicy === 'store-only' ? null : makeNetworkRequest(params);
|
256
|
-
|
233
|
+
var networkObservable = fetchPolicy === 'store-only' ? null : makeNetworkRequest(params);
|
234
|
+
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
|
257
235
|
var _PreloadableQueryRegi = PreloadableQueryRegistry.onLoad(queryId, function (preloadedModule) {
|
258
236
|
cancelOnLoadCallback();
|
259
237
|
var operation = createOperationDescriptor(preloadedModule, variables, networkCacheConfig);
|
260
238
|
retainReference = environment.retain(operation);
|
261
|
-
|
262
239
|
if (networkObservable != null) {
|
263
240
|
executeDeduped(operation, function () {
|
264
241
|
return executeWithNetworkSource(operation, networkObservable);
|
265
242
|
});
|
266
243
|
}
|
267
244
|
});
|
268
|
-
|
269
245
|
cancelOnLoadCallback = _PreloadableQueryRegi.dispose;
|
270
246
|
}
|
271
247
|
} else {
|
@@ -275,35 +251,28 @@ function loadQuery(environment, preloadableRequest, variables, options, environm
|
|
275
251
|
queryId = params.cacheID != null ? params.cacheID : params.id;
|
276
252
|
checkAvailabilityAndExecute(request);
|
277
253
|
}
|
278
|
-
|
279
254
|
var isDisposed = false;
|
280
255
|
var isReleased = false;
|
281
256
|
var isNetworkRequestCancelled = false;
|
282
|
-
|
283
257
|
var releaseQuery = function releaseQuery() {
|
284
258
|
if (isReleased) {
|
285
259
|
return;
|
286
260
|
}
|
287
|
-
|
288
261
|
retainReference && retainReference.dispose();
|
289
262
|
isReleased = true;
|
290
263
|
};
|
291
|
-
|
292
264
|
var cancelNetworkRequest = function cancelNetworkRequest() {
|
293
265
|
if (isNetworkRequestCancelled) {
|
294
266
|
return;
|
295
267
|
}
|
296
|
-
|
297
268
|
if (didExecuteNetworkSource) {
|
298
269
|
unsubscribeFromExecution && unsubscribeFromExecution();
|
299
270
|
} else {
|
300
271
|
unsubscribeFromNetworkRequest && unsubscribeFromNetworkRequest();
|
301
272
|
}
|
302
|
-
|
303
273
|
cancelOnLoadCallback && cancelOnLoadCallback();
|
304
274
|
isNetworkRequestCancelled = true;
|
305
275
|
};
|
306
|
-
|
307
276
|
return {
|
308
277
|
kind: 'PreloadedQuery',
|
309
278
|
environment: environment,
|
@@ -312,7 +281,6 @@ function loadQuery(environment, preloadableRequest, variables, options, environm
|
|
312
281
|
if (isDisposed) {
|
313
282
|
return;
|
314
283
|
}
|
315
|
-
|
316
284
|
releaseQuery();
|
317
285
|
cancelNetworkRequest();
|
318
286
|
isDisposed = true;
|
@@ -321,17 +289,14 @@ function loadQuery(environment, preloadableRequest, variables, options, environm
|
|
321
289
|
cancelNetworkRequest: cancelNetworkRequest,
|
322
290
|
fetchKey: fetchKey,
|
323
291
|
id: queryId,
|
324
|
-
|
325
292
|
// $FlowFixMe[unsafe-getters-setters] - this has no side effects
|
326
293
|
get isDisposed() {
|
327
294
|
return isDisposed || isReleased;
|
328
295
|
},
|
329
|
-
|
330
296
|
// $FlowFixMe[unsafe-getters-setters] - this has no side effects
|
331
297
|
get networkError() {
|
332
298
|
return networkError;
|
333
299
|
},
|
334
|
-
|
335
300
|
name: params.name,
|
336
301
|
networkCacheConfig: networkCacheConfig,
|
337
302
|
fetchPolicy: fetchPolicy,
|
@@ -339,7 +304,6 @@ function loadQuery(environment, preloadableRequest, variables, options, environm
|
|
339
304
|
variables: variables
|
340
305
|
};
|
341
306
|
}
|
342
|
-
|
343
307
|
module.exports = {
|
344
308
|
loadQuery: loadQuery,
|
345
309
|
useTrackLoadQueryInRender: useTrackLoadQueryInRender
|
@@ -4,65 +4,53 @@
|
|
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
|
+
|
11
12
|
'use strict';
|
12
13
|
|
13
14
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
14
|
-
|
15
15
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
16
|
-
|
17
16
|
var _require = require('relay-runtime'),
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
17
|
+
Observable = _require.Observable,
|
18
|
+
PreloadableQueryRegistry = _require.PreloadableQueryRegistry,
|
19
|
+
ReplaySubject = _require.ReplaySubject,
|
20
|
+
createOperationDescriptor = _require.createOperationDescriptor,
|
21
|
+
getRequest = _require.getRequest,
|
22
|
+
getRequestIdentifier = _require.getRequestIdentifier;
|
23
|
+
|
24
|
+
// Expire results by this delay after they resolve.
|
27
25
|
var DEFAULT_PREFETCH_TIMEOUT = 30 * 1000; // 30 seconds
|
28
26
|
|
29
27
|
var WEAKMAP_SUPPORTED = typeof WeakMap === 'function';
|
30
28
|
var STORE_OR_NETWORK_DEFAULT = 'store-or-network';
|
31
29
|
var pendingQueriesByEnvironment = WEAKMAP_SUPPORTED ? new WeakMap() : new Map();
|
32
|
-
|
33
30
|
function preloadQuery(environment, preloadableRequest, variables, options, environmentProviderOptions) {
|
34
31
|
var _pendingQueries = pendingQueriesByEnvironment.get(environment);
|
35
|
-
|
36
32
|
if (_pendingQueries == null) {
|
37
33
|
_pendingQueries = new Map();
|
38
34
|
pendingQueriesByEnvironment.set(environment, _pendingQueries);
|
39
35
|
}
|
40
|
-
|
41
36
|
var pendingQueries = _pendingQueries; // store in a const for flow
|
42
|
-
|
43
37
|
var queryEntry = preloadQueryDeduped(environment, pendingQueries, preloadableRequest, variables, options);
|
44
38
|
var source = queryEntry.kind === 'network' ? Observable.create(function (sink) {
|
45
39
|
var subscription;
|
46
|
-
|
47
40
|
if (pendingQueries.get(queryEntry.cacheKey) == null) {
|
48
41
|
var newQueryEntry = preloadQueryDeduped(environment, pendingQueries, preloadableRequest, variables, options);
|
49
|
-
|
50
42
|
if (newQueryEntry.kind === 'network') {
|
51
43
|
subscription = newQueryEntry.subject.subscribe(sink);
|
52
44
|
}
|
53
45
|
} else {
|
54
46
|
subscription = queryEntry.subject.subscribe(sink);
|
55
47
|
}
|
56
|
-
|
57
48
|
return function () {
|
58
49
|
var _subscription;
|
59
|
-
|
60
50
|
(_subscription = subscription) === null || _subscription === void 0 ? void 0 : _subscription.unsubscribe();
|
61
|
-
|
62
51
|
if (environment.isServer()) {
|
63
52
|
return;
|
64
53
|
}
|
65
|
-
|
66
54
|
setTimeout(function () {
|
67
55
|
// Clear the cache entry after the default timeout
|
68
56
|
// null-check for Flow
|
@@ -86,13 +74,10 @@ function preloadQuery(environment, preloadableRequest, variables, options, envir
|
|
86
74
|
status: queryEntry.status
|
87
75
|
};
|
88
76
|
}
|
89
|
-
|
90
77
|
function preloadQueryDeduped(environment, pendingQueries, preloadableRequest, variables, options) {
|
91
78
|
var _options$fetchPolicy;
|
92
|
-
|
93
79
|
var params;
|
94
80
|
var query;
|
95
|
-
|
96
81
|
if (preloadableRequest.kind === 'PreloadableConcreteRequest') {
|
97
82
|
var preloadableConcreteRequest = preloadableRequest;
|
98
83
|
params = preloadableConcreteRequest.params;
|
@@ -101,7 +86,6 @@ function preloadQueryDeduped(environment, pendingQueries, preloadableRequest, va
|
|
101
86
|
query = getRequest(preloadableRequest);
|
102
87
|
params = query.params;
|
103
88
|
}
|
104
|
-
|
105
89
|
var network = environment.getNetwork();
|
106
90
|
var fetchPolicy = (_options$fetchPolicy = options === null || options === void 0 ? void 0 : options.fetchPolicy) !== null && _options$fetchPolicy !== void 0 ? _options$fetchPolicy : STORE_OR_NETWORK_DEFAULT;
|
107
91
|
var fetchKey = options === null || options === void 0 ? void 0 : options.fetchKey;
|
@@ -114,10 +98,8 @@ function preloadQueryDeduped(environment, pendingQueries, preloadableRequest, va
|
|
114
98
|
status: 'missing'
|
115
99
|
};
|
116
100
|
var nextQueryEntry;
|
117
|
-
|
118
101
|
if (availability.status === 'available' && query != null) {
|
119
102
|
var _availability$fetchTi;
|
120
|
-
|
121
103
|
nextQueryEntry = prevQueryEntry && prevQueryEntry.kind === 'cache' ? prevQueryEntry : {
|
122
104
|
cacheKey: cacheKey,
|
123
105
|
fetchKey: fetchKey,
|
@@ -131,7 +113,6 @@ function preloadQueryDeduped(environment, pendingQueries, preloadableRequest, va
|
|
131
113
|
fetchTime: (_availability$fetchTi = availability === null || availability === void 0 ? void 0 : availability.fetchTime) !== null && _availability$fetchTi !== void 0 ? _availability$fetchTi : null
|
132
114
|
}
|
133
115
|
};
|
134
|
-
|
135
116
|
if (!environment.isServer() && prevQueryEntry == null) {
|
136
117
|
setTimeout(function () {
|
137
118
|
// Clear the cache entry after the default timeout
|
@@ -162,7 +143,6 @@ function preloadQueryDeduped(environment, pendingQueries, preloadableRequest, va
|
|
162
143
|
if (environment.isServer()) {
|
163
144
|
return;
|
164
145
|
}
|
165
|
-
|
166
146
|
setTimeout(function () {
|
167
147
|
// Clear the cache entry after the default timeout
|
168
148
|
// null-check for Flow
|
@@ -185,25 +165,20 @@ function preloadQueryDeduped(environment, pendingQueries, preloadableRequest, va
|
|
185
165
|
} else {
|
186
166
|
nextQueryEntry = prevQueryEntry;
|
187
167
|
}
|
188
|
-
|
189
168
|
pendingQueries.set(cacheKey, nextQueryEntry);
|
190
169
|
return nextQueryEntry;
|
191
170
|
}
|
192
|
-
|
193
171
|
function cleanup(pendingQueries, entry) {
|
194
172
|
// Reload the entry by its cache key and only invalidate if its the identical
|
195
173
|
// entry instance. This ensures that if the same query/variables are fetched
|
196
174
|
// successively that a timeout/expiration from an earlier fetch doesn't clear
|
197
175
|
// a subsequent fetch.
|
198
176
|
var currentEntry = pendingQueries.get(entry.cacheKey);
|
199
|
-
|
200
177
|
if (currentEntry != null && currentEntry === entry) {
|
201
178
|
if (currentEntry.kind === 'network') {
|
202
179
|
currentEntry.subscription.unsubscribe();
|
203
180
|
}
|
204
|
-
|
205
181
|
pendingQueries["delete"](currentEntry.cacheKey);
|
206
182
|
}
|
207
183
|
}
|
208
|
-
|
209
184
|
module.exports = preloadQuery;
|
@@ -4,53 +4,48 @@
|
|
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
|
+
|
11
12
|
'use strict';
|
12
13
|
|
13
14
|
var preloadQuery = require('./preloadQuery_DEPRECATED');
|
14
|
-
|
15
15
|
function prepareEntryPoint(environmentProvider, entryPoint, entryPointParams) {
|
16
16
|
// Start loading the code for the entrypoint
|
17
17
|
if (entryPoint.root.getModuleIfRequired() == null) {
|
18
|
+
// $FlowFixMe[unused-promise]
|
18
19
|
entryPoint.root.load();
|
19
20
|
}
|
20
|
-
|
21
21
|
var preloadProps = entryPoint.getPreloadProps(entryPointParams);
|
22
22
|
var queries = preloadProps.queries,
|
23
|
-
|
23
|
+
entryPoints = preloadProps.entryPoints;
|
24
24
|
var preloadedQueries = {};
|
25
25
|
var preloadedEntryPoints = {};
|
26
|
-
|
27
26
|
if (queries != null) {
|
28
27
|
var queriesPropNames = Object.keys(queries);
|
29
28
|
queriesPropNames.forEach(function (queryPropName) {
|
30
29
|
var _queries$queryPropNam = queries[queryPropName],
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
30
|
+
environmentProviderOptions = _queries$queryPropNam.environmentProviderOptions,
|
31
|
+
options = _queries$queryPropNam.options,
|
32
|
+
parameters = _queries$queryPropNam.parameters,
|
33
|
+
variables = _queries$queryPropNam.variables;
|
35
34
|
var environment = environmentProvider.getEnvironment(environmentProviderOptions);
|
36
35
|
preloadedQueries[queryPropName] = preloadQuery(environment, parameters, variables, options, environmentProviderOptions);
|
37
36
|
});
|
38
37
|
}
|
39
|
-
|
40
38
|
if (entryPoints != null) {
|
41
39
|
var entryPointPropNames = Object.keys(entryPoints);
|
42
40
|
entryPointPropNames.forEach(function (entryPointPropName) {
|
43
41
|
var entryPointDescription = entryPoints[entryPointPropName];
|
44
|
-
|
45
42
|
if (entryPointDescription == null) {
|
46
43
|
return;
|
47
44
|
}
|
48
|
-
|
49
45
|
var nestedEntryPoint = entryPointDescription.entryPoint,
|
50
|
-
|
46
|
+
nestedParams = entryPointDescription.entryPointParams;
|
51
47
|
preloadedEntryPoints[entryPointPropName] = prepareEntryPoint(environmentProvider, nestedEntryPoint, nestedParams);
|
52
48
|
});
|
53
49
|
}
|
54
50
|
}
|
55
|
-
|
56
51
|
module.exports = prepareEntryPoint;
|