@module-federation/modern-js 0.0.0-next-20250526074234 → 0.0.0-next-20250527065931

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/package.json +23 -39
  2. package/dist/LICENSE +0 -21
  3. package/dist/cjs/cli/configPlugin.js +0 -379
  4. package/dist/cjs/cli/configPlugin.spec.js +0 -114
  5. package/dist/cjs/cli/index.js +0 -87
  6. package/dist/cjs/cli/manifest.js +0 -75
  7. package/dist/cjs/cli/mfRuntimePlugins/auto-fetch-data.js +0 -98
  8. package/dist/cjs/cli/mfRuntimePlugins/inject-node-fetch.js +0 -44
  9. package/dist/cjs/cli/mfRuntimePlugins/resolve-entry-ipv4.js +0 -82
  10. package/dist/cjs/cli/mfRuntimePlugins/shared-strategy.js +0 -43
  11. package/dist/cjs/cli/server/data-fetch-server-plugin.js +0 -192
  12. package/dist/cjs/cli/ssrPlugin.js +0 -236
  13. package/dist/cjs/cli/utils.js +0 -90
  14. package/dist/cjs/constant.js +0 -78
  15. package/dist/cjs/interfaces/bundler.js +0 -16
  16. package/dist/cjs/interfaces/global.js +0 -16
  17. package/dist/cjs/logger.js +0 -27
  18. package/dist/cjs/runtime/AwaitDataFetch.js +0 -144
  19. package/dist/cjs/runtime/createRemoteComponent.js +0 -327
  20. package/dist/cjs/runtime/index.js +0 -50
  21. package/dist/cjs/runtime/wrapNoSSR.js +0 -35
  22. package/dist/cjs/ssr-runtime/SSRLiveReload.js +0 -43
  23. package/dist/cjs/ssr-runtime/devPlugin.js +0 -71
  24. package/dist/cjs/ssr-runtime/downgrade.js +0 -114
  25. package/dist/cjs/ssr-runtime/injectDataFetchFunctionPlugin.js +0 -136
  26. package/dist/cjs/types/index.js +0 -16
  27. package/dist/cjs/utils/dataFetch.js +0 -211
  28. package/dist/cjs/utils/index.js +0 -54
  29. package/dist/esm/cli/configPlugin.js +0 -386
  30. package/dist/esm/cli/configPlugin.spec.js +0 -110
  31. package/dist/esm/cli/index.js +0 -81
  32. package/dist/esm/cli/manifest.js +0 -41
  33. package/dist/esm/cli/mfRuntimePlugins/auto-fetch-data.js +0 -74
  34. package/dist/esm/cli/mfRuntimePlugins/inject-node-fetch.js +0 -16
  35. package/dist/esm/cli/mfRuntimePlugins/resolve-entry-ipv4.js +0 -74
  36. package/dist/esm/cli/mfRuntimePlugins/shared-strategy.js +0 -25
  37. package/dist/esm/cli/server/data-fetch-server-plugin.js +0 -240
  38. package/dist/esm/cli/ssrPlugin.js +0 -219
  39. package/dist/esm/cli/utils.js +0 -53
  40. package/dist/esm/constant.js +0 -42
  41. package/dist/esm/interfaces/bundler.js +0 -0
  42. package/dist/esm/interfaces/global.js +0 -0
  43. package/dist/esm/logger.js +0 -7
  44. package/dist/esm/runtime/AwaitDataFetch.js +0 -131
  45. package/dist/esm/runtime/createRemoteComponent.js +0 -417
  46. package/dist/esm/runtime/index.js +0 -22
  47. package/dist/esm/runtime/wrapNoSSR.js +0 -12
  48. package/dist/esm/ssr-runtime/SSRLiveReload.js +0 -26
  49. package/dist/esm/ssr-runtime/devPlugin.js +0 -73
  50. package/dist/esm/ssr-runtime/downgrade.js +0 -150
  51. package/dist/esm/ssr-runtime/injectDataFetchFunctionPlugin.js +0 -177
  52. package/dist/esm/types/index.js +0 -0
  53. package/dist/esm/utils/dataFetch.js +0 -237
  54. package/dist/esm/utils/index.js +0 -28
  55. package/dist/esm-node/cli/configPlugin.js +0 -338
  56. package/dist/esm-node/cli/configPlugin.spec.js +0 -91
  57. package/dist/esm-node/cli/index.js +0 -62
  58. package/dist/esm-node/cli/manifest.js +0 -41
  59. package/dist/esm-node/cli/mfRuntimePlugins/auto-fetch-data.js +0 -68
  60. package/dist/esm-node/cli/mfRuntimePlugins/inject-node-fetch.js +0 -14
  61. package/dist/esm-node/cli/mfRuntimePlugins/resolve-entry-ipv4.js +0 -62
  62. package/dist/esm-node/cli/mfRuntimePlugins/shared-strategy.js +0 -23
  63. package/dist/esm-node/cli/server/data-fetch-server-plugin.js +0 -162
  64. package/dist/esm-node/cli/ssrPlugin.js +0 -200
  65. package/dist/esm-node/cli/utils.js +0 -53
  66. package/dist/esm-node/constant.js +0 -42
  67. package/dist/esm-node/interfaces/bundler.js +0 -0
  68. package/dist/esm-node/interfaces/global.js +0 -0
  69. package/dist/esm-node/logger.js +0 -7
  70. package/dist/esm-node/runtime/AwaitDataFetch.js +0 -109
  71. package/dist/esm-node/runtime/createRemoteComponent.js +0 -291
  72. package/dist/esm-node/runtime/index.js +0 -22
  73. package/dist/esm-node/runtime/wrapNoSSR.js +0 -11
  74. package/dist/esm-node/ssr-runtime/SSRLiveReload.js +0 -19
  75. package/dist/esm-node/ssr-runtime/devPlugin.js +0 -37
  76. package/dist/esm-node/ssr-runtime/downgrade.js +0 -88
  77. package/dist/esm-node/ssr-runtime/injectDataFetchFunctionPlugin.js +0 -101
  78. package/dist/esm-node/types/index.js +0 -0
  79. package/dist/esm-node/utils/dataFetch.js +0 -166
  80. package/dist/esm-node/utils/index.js +0 -27
  81. package/dist/types/cli/configPlugin.d.ts +0 -21
  82. package/dist/types/cli/configPlugin.spec.d.ts +0 -1
  83. package/dist/types/cli/index.d.ts +0 -6
  84. package/dist/types/cli/manifest.d.ts +0 -2
  85. package/dist/types/cli/mfRuntimePlugins/auto-fetch-data.d.ts +0 -3
  86. package/dist/types/cli/mfRuntimePlugins/inject-node-fetch.d.ts +0 -3
  87. package/dist/types/cli/mfRuntimePlugins/resolve-entry-ipv4.d.ts +0 -3
  88. package/dist/types/cli/mfRuntimePlugins/shared-strategy.d.ts +0 -3
  89. package/dist/types/cli/server/data-fetch-server-plugin.d.ts +0 -3
  90. package/dist/types/cli/ssrPlugin.d.ts +0 -6
  91. package/dist/types/cli/utils.d.ts +0 -6
  92. package/dist/types/constant.d.ts +0 -25
  93. package/dist/types/interfaces/bundler.d.ts +0 -18
  94. package/dist/types/interfaces/global.d.ts +0 -27
  95. package/dist/types/logger.d.ts +0 -2
  96. package/dist/types/runtime/AwaitDataFetch.d.ts +0 -19
  97. package/dist/types/runtime/createRemoteComponent.d.ts +0 -26
  98. package/dist/types/runtime/index.d.ts +0 -10
  99. package/dist/types/runtime/wrapNoSSR.d.ts +0 -9
  100. package/dist/types/ssr-runtime/SSRLiveReload.d.ts +0 -1
  101. package/dist/types/ssr-runtime/devPlugin.d.ts +0 -2
  102. package/dist/types/ssr-runtime/downgrade.d.ts +0 -4
  103. package/dist/types/ssr-runtime/injectDataFetchFunctionPlugin.d.ts +0 -7
  104. package/dist/types/types/index.d.ts +0 -24
  105. package/dist/types/utils/dataFetch.d.ts +0 -26
  106. package/dist/types/utils/index.d.ts +0 -15
@@ -1,136 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var injectDataFetchFunctionPlugin_exports = {};
30
- __export(injectDataFetchFunctionPlugin_exports, {
31
- injectDataFetchFunctionPlugin: () => injectDataFetchFunctionPlugin,
32
- setSSREnv: () => setSSREnv
33
- });
34
- module.exports = __toCommonJS(injectDataFetchFunctionPlugin_exports);
35
- var import_constant = require("../constant");
36
- var import_logger = __toESM(require("../logger"));
37
- var import_utils = require("../utils");
38
- var import_downgrade = require("./downgrade");
39
- function setSSREnv({ fetchServerQuery }) {
40
- globalThis.FEDERATION_SSR = true;
41
- globalThis.FEDERATION_SERVER_QUERY = fetchServerQuery;
42
- }
43
- const injectDataFetchFunctionPlugin = ({ fetchServerQuery }) => ({
44
- name: "@module-federation/inject-data-fetch-function-plugin",
45
- setup: (api) => {
46
- api.onBeforeRender(async () => {
47
- var _globalThis, _DATA_FETCH_FUNCTION;
48
- setSSREnv({
49
- fetchServerQuery
50
- });
51
- if (typeof window === "undefined") {
52
- return;
53
- }
54
- const dataFetchFunction = async function(options) {
55
- const [id, data, downgrade] = options;
56
- import_logger.default.debug("==========call data fetch function!");
57
- if (data) {
58
- if (!id) {
59
- throw new Error("id is required!");
60
- }
61
- if (!(0, import_utils.getDataFetchMap)()) {
62
- (0, import_utils.initDataFetchMap)();
63
- }
64
- const dataFetchItem = (0, import_utils.getDataFetchItem)(id);
65
- if (dataFetchItem) {
66
- var _dataFetchItem__, _dataFetchItem_;
67
- (_dataFetchItem_ = dataFetchItem[1]) === null || _dataFetchItem_ === void 0 ? void 0 : (_dataFetchItem__ = _dataFetchItem_[1]) === null || _dataFetchItem__ === void 0 ? void 0 : _dataFetchItem__.call(_dataFetchItem_, data);
68
- dataFetchItem[2] = import_constant.MF_DATA_FETCH_STATUS.LOADED;
69
- return;
70
- }
71
- if (!dataFetchItem) {
72
- const dataFetchMap = (0, import_utils.getDataFetchMap)();
73
- let res;
74
- let rej;
75
- const p = new Promise((resolve, reject) => {
76
- res = resolve;
77
- rej = reject;
78
- });
79
- dataFetchMap[id] = [
80
- [
81
- async () => async () => {
82
- return "";
83
- },
84
- import_constant.MF_DATA_FETCH_TYPE.FETCH_SERVER
85
- ],
86
- [
87
- p,
88
- res,
89
- rej
90
- ],
91
- import_constant.MF_DATA_FETCH_STATUS.LOADED
92
- ];
93
- res(data);
94
- return;
95
- }
96
- }
97
- if (downgrade) {
98
- const mfDowngrade2 = (0, import_downgrade.getDowngradeTag)();
99
- if (!mfDowngrade2) {
100
- globalThis[import_constant.DOWNGRADE_KEY] = id ? [
101
- id
102
- ] : true;
103
- } else if (Array.isArray(mfDowngrade2) && id && !mfDowngrade2.includes(id)) {
104
- mfDowngrade2.push(id);
105
- }
106
- }
107
- const mfDowngrade = (0, import_downgrade.getDowngradeTag)();
108
- if (typeof mfDowngrade === "boolean") {
109
- return (0, import_downgrade.callAllDowngrade)();
110
- }
111
- if (Array.isArray(mfDowngrade)) {
112
- if (!id) {
113
- globalThis[import_constant.DOWNGRADE_KEY] = true;
114
- return (0, import_downgrade.callAllDowngrade)();
115
- }
116
- if (!mfDowngrade.includes(id)) {
117
- mfDowngrade.push(id);
118
- }
119
- return (0, import_downgrade.callDowngrade)(id);
120
- }
121
- };
122
- globalThis[import_constant.FS_HREF] = window.location.href;
123
- (_globalThis = globalThis)[_DATA_FETCH_FUNCTION = import_constant.DATA_FETCH_FUNCTION] || (_globalThis[_DATA_FETCH_FUNCTION] = []);
124
- const dataFetch = globalThis[import_constant.DATA_FETCH_FUNCTION];
125
- await Promise.all(dataFetch.map(async (options) => {
126
- await dataFetchFunction(options);
127
- }));
128
- dataFetch.push = dataFetchFunction;
129
- });
130
- }
131
- });
132
- // Annotate the CommonJS export names for ESM import in node:
133
- 0 && (module.exports = {
134
- injectDataFetchFunctionPlugin,
135
- setSSREnv
136
- });
@@ -1,16 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
- var types_exports = {};
16
- module.exports = __toCommonJS(types_exports);
@@ -1,211 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var dataFetch_exports = {};
30
- __export(dataFetch_exports, {
31
- fetchData: () => fetchData,
32
- flushDataFetch: () => flushDataFetch,
33
- getDataFetchIdWithErrorMsgs: () => getDataFetchIdWithErrorMsgs,
34
- getDataFetchInfo: () => getDataFetchInfo,
35
- getDataFetchItem: () => getDataFetchItem,
36
- getDataFetchMap: () => getDataFetchMap,
37
- getDataFetchMapKey: () => getDataFetchMapKey,
38
- initDataFetchMap: () => initDataFetchMap,
39
- isDataLoaderExpose: () => isDataLoaderExpose,
40
- loadDataFetchModule: () => loadDataFetchModule,
41
- setDataFetchItemLoadedStatus: () => setDataFetchItemLoadedStatus,
42
- wrapDataFetchId: () => wrapDataFetchId
43
- });
44
- module.exports = __toCommonJS(dataFetch_exports);
45
- var import_sdk = require("@module-federation/sdk");
46
- var import_utils = require("../utils");
47
- var import_logger = __toESM(require("../logger"));
48
- var import_downgrade = require("../ssr-runtime/downgrade");
49
- var import_constant = require("../constant");
50
- var import_constant2 = require("@module-federation/rsbuild-plugin/constant");
51
- const getDataFetchInfo = ({ name, alias, id, remoteSnapshot }) => {
52
- if (!remoteSnapshot) {
53
- return;
54
- }
55
- if (!("modules" in remoteSnapshot)) {
56
- return;
57
- }
58
- const regex = new RegExp(`^${name}(/[^/].*|)$`);
59
- const nameOrAlias = regex.test(id) ? name : alias || name;
60
- const expose = id.replace(nameOrAlias, "");
61
- let dataFetchName = "";
62
- let dataFetchId = "";
63
- if (expose.startsWith("/")) {
64
- dataFetchName = `${expose.slice(1)}.${import_constant2.DATA_FETCH_IDENTIFIER}`;
65
- dataFetchId = `${id}.${import_constant2.DATA_FETCH_IDENTIFIER}`;
66
- } else if (expose === "") {
67
- dataFetchName = import_constant2.DATA_FETCH_IDENTIFIER;
68
- dataFetchId = `${id}/${import_constant2.DATA_FETCH_IDENTIFIER}`;
69
- } else {
70
- return;
71
- }
72
- if (!dataFetchName || !dataFetchId) {
73
- return;
74
- }
75
- if (!remoteSnapshot.modules.find((module2) => module2.moduleName === dataFetchName)) {
76
- return;
77
- }
78
- return {
79
- dataFetchName,
80
- dataFetchId
81
- };
82
- };
83
- function initDataFetchMap() {
84
- var _globalThis;
85
- (_globalThis = globalThis).__MF_DATA_FETCH_MAP__ || (_globalThis.__MF_DATA_FETCH_MAP__ = {});
86
- }
87
- function getDataFetchItem(id) {
88
- var _globalThis___MF_DATA_FETCH_MAP__;
89
- return (_globalThis___MF_DATA_FETCH_MAP__ = globalThis.__MF_DATA_FETCH_MAP__) === null || _globalThis___MF_DATA_FETCH_MAP__ === void 0 ? void 0 : _globalThis___MF_DATA_FETCH_MAP__[id];
90
- }
91
- function getDataFetchMap() {
92
- return globalThis.__MF_DATA_FETCH_MAP__;
93
- }
94
- const flushDataFetch = () => {
95
- globalThis.__MF_DATA_FETCH_MAP__ = {};
96
- globalThis[import_constant.DOWNGRADE_KEY] = void 0;
97
- };
98
- function setDataFetchItemLoadedStatus(id) {
99
- const dataFetchItem = getDataFetchItem(id);
100
- if (!dataFetchItem) {
101
- return;
102
- }
103
- dataFetchItem[2] = import_constant.MF_DATA_FETCH_STATUS.LOADED;
104
- }
105
- const wrapDataFetchId = (id) => {
106
- return `${import_constant.WRAP_DATA_FETCH_ID_IDENTIFIER}${id}${import_constant.WRAP_DATA_FETCH_ID_IDENTIFIER}`;
107
- };
108
- const getDataFetchIdWithErrorMsgs = (errMsgs) => {
109
- const firstIdentifierIndex = errMsgs.indexOf(import_constant.WRAP_DATA_FETCH_ID_IDENTIFIER);
110
- if (firstIdentifierIndex === -1) {
111
- return void 0;
112
- }
113
- const secondIdentifierIndex = errMsgs.indexOf(import_constant.WRAP_DATA_FETCH_ID_IDENTIFIER, firstIdentifierIndex + import_constant.WRAP_DATA_FETCH_ID_IDENTIFIER.length);
114
- if (secondIdentifierIndex === -1) {
115
- return void 0;
116
- }
117
- return errMsgs.substring(firstIdentifierIndex + import_constant.WRAP_DATA_FETCH_ID_IDENTIFIER.length, secondIdentifierIndex);
118
- };
119
- async function fetchData(id, params, remoteInfo) {
120
- const callFetchData = async () => {
121
- const item = getDataFetchItem(id);
122
- if (!item) {
123
- return;
124
- }
125
- const [fetchDataFnArr, ..._rest] = item;
126
- const fetchDataFn = await fetchDataFnArr[2];
127
- if (!fetchDataFn) {
128
- return;
129
- }
130
- return fetchDataFn(params);
131
- };
132
- if ((0, import_sdk.isBrowserEnv)()) {
133
- var _dataFetchItem_;
134
- const dataFetchItem = getDataFetchItem(id);
135
- if (!dataFetchItem) {
136
- throw new Error(`dataFetchItem not found, id: ${id}`);
137
- }
138
- if ((_dataFetchItem_ = dataFetchItem[1]) === null || _dataFetchItem_ === void 0 ? void 0 : _dataFetchItem_[0]) {
139
- return dataFetchItem[1][0];
140
- }
141
- if ((0, import_utils.isCSROnly)()) {
142
- import_logger.default.debug("==========csr only!");
143
- return callFetchData();
144
- }
145
- if (remoteInfo) {
146
- return (0, import_downgrade.callDowngrade)(id, params, remoteInfo);
147
- }
148
- const mfDowngrade = (0, import_downgrade.getDowngradeTag)();
149
- if (mfDowngrade) {
150
- if (typeof mfDowngrade === "boolean") {
151
- return (0, import_downgrade.callDowngrade)(id, {
152
- ...params,
153
- isDowngrade: true
154
- });
155
- }
156
- if (mfDowngrade.includes(id)) {
157
- return (0, import_downgrade.callDowngrade)(id, {
158
- ...params,
159
- isDowngrade: true
160
- });
161
- }
162
- }
163
- let res;
164
- let rej;
165
- const p = new Promise((resolve, reject) => {
166
- res = resolve;
167
- rej = reject;
168
- });
169
- dataFetchItem[1] = [
170
- p,
171
- res,
172
- rej
173
- ];
174
- dataFetchItem[2] = import_constant.MF_DATA_FETCH_STATUS.AWAIT;
175
- return dataFetchItem[1][0];
176
- }
177
- return callFetchData();
178
- }
179
- function getDataFetchMapKey(dataFetchInfo, hostInfo) {
180
- if (!dataFetchInfo || !hostInfo) {
181
- return;
182
- }
183
- const { dataFetchId } = dataFetchInfo;
184
- return (0, import_sdk.composeKeyWithSeparator)(dataFetchId, hostInfo.name, hostInfo.version);
185
- }
186
- async function loadDataFetchModule(instance, id) {
187
- return instance.loadRemote(id).then((m) => {
188
- if (m && typeof m === "object" && "fetchData" in m && typeof m.fetchData === "function") {
189
- return m.fetchData;
190
- }
191
- throw new Error(`fetchData not found in remote ${id}, ${JSON.stringify(m)}`);
192
- });
193
- }
194
- function isDataLoaderExpose(exposeKey) {
195
- return exposeKey.endsWith(import_constant2.DATA_FETCH_IDENTIFIER) || exposeKey.endsWith(import_constant2.DATA_FETCH_CLIENT_SUFFIX);
196
- }
197
- // Annotate the CommonJS export names for ESM import in node:
198
- 0 && (module.exports = {
199
- fetchData,
200
- flushDataFetch,
201
- getDataFetchIdWithErrorMsgs,
202
- getDataFetchInfo,
203
- getDataFetchItem,
204
- getDataFetchMap,
205
- getDataFetchMapKey,
206
- initDataFetchMap,
207
- isDataLoaderExpose,
208
- loadDataFetchModule,
209
- setDataFetchItemLoadedStatus,
210
- wrapDataFetchId
211
- });
@@ -1,54 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
- var utils_exports = {};
21
- __export(utils_exports, {
22
- getLoadedRemoteInfos: () => getLoadedRemoteInfos,
23
- isCSROnly: () => isCSROnly
24
- });
25
- module.exports = __toCommonJS(utils_exports);
26
- __reExport(utils_exports, require("./dataFetch"), module.exports);
27
- function getLoadedRemoteInfos(id, instance) {
28
- if (!instance) {
29
- return;
30
- }
31
- const { name, expose } = instance.remoteHandler.idToRemoteMap[id] || {};
32
- if (!name) {
33
- return;
34
- }
35
- const module2 = instance.moduleCache.get(name);
36
- if (!module2) {
37
- return;
38
- }
39
- const { remoteSnapshot } = instance.snapshotHandler.getGlobalRemoteInfo(module2.remoteInfo);
40
- return {
41
- ...module2.remoteInfo,
42
- snapshot: remoteSnapshot,
43
- expose
44
- };
45
- }
46
- function isCSROnly() {
47
- return window._SSR_DATA === void 0;
48
- }
49
- // Annotate the CommonJS export names for ESM import in node:
50
- 0 && (module.exports = {
51
- getLoadedRemoteInfos,
52
- isCSROnly,
53
- ...require("./dataFetch")
54
- });