@module-federation/retry-plugin 0.18.4 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,28 +1,110 @@
1
1
  import { ModuleFederationRuntimePlugin } from '@module-federation/runtime/types';
2
2
 
3
- interface FetchWithRetryOptions {
4
- manifestUrl?: string;
5
- options?: RequestInit;
3
+ type CommonRetryOptions = {
4
+ /**
5
+ * retry request options
6
+ */
7
+ fetchOptions?: RequestInit;
8
+ /**
9
+ * retry times
10
+ */
6
11
  retryTimes?: number;
12
+ /**
13
+ * retry success times
14
+ */
15
+ successTimes?: number;
16
+ /**
17
+ * retry delay
18
+ */
7
19
  retryDelay?: number;
8
- fallback?:
9
- | (() => string)
10
- | ((url: string | URL | globalThis.Request) => string);
20
+ /**
21
+ * retry path
22
+ */
11
23
  getRetryPath?: (url: string) => string;
12
- }
13
- interface ScriptWithRetryOptions {
14
- retryTimes?: number;
15
- retryDelay?: number;
16
- moduleName?: Array<string>;
17
- cb?: (resolve: (value: unknown) => void, error: any) => void;
18
- getRetryPath?: (url: string) => string;
19
- }
24
+ /**
25
+ * add query parameter
26
+ */
27
+ addQuery?:
28
+ | boolean
29
+ | ((context: { times: number; originalQuery: string }) => string);
30
+ /**
31
+ * retry domains
32
+ */
33
+ domains?: string[];
34
+ /**
35
+ * retry manifest domains
36
+ */
37
+ manifestDomains?: string[];
38
+ /**
39
+ * retry callback
40
+ */
41
+ onRetry?: ({
42
+ times,
43
+ domains,
44
+ url,
45
+ }: {
46
+ times?: number;
47
+ domains?: string[];
48
+ url?: string;
49
+ tagName?: string;
50
+ }) => void;
51
+ /**
52
+ * retry success callback
53
+ */
54
+ onSuccess?: ({
55
+ domains,
56
+ url,
57
+ tagName,
58
+ }: {
59
+ domains?: string[];
60
+ url?: string;
61
+ tagName?: string;
62
+ }) => void;
63
+ /**
64
+ * retry failure callback
65
+ */
66
+ onError?: ({
67
+ domains,
68
+ url,
69
+ tagName,
70
+ }: {
71
+ domains?: string[];
72
+ url?: string;
73
+ tagName?: string;
74
+ }) => void;
75
+ };
76
+
77
+ type FetchRetryOptions = {
78
+ url?: string;
79
+ fetchOptions?: RequestInit;
80
+ } & CommonRetryOptions;
20
81
 
21
- type RetryPluginParams = {
22
- fetch?: FetchWithRetryOptions;
23
- script?: ScriptWithRetryOptions;
82
+ type ScriptRetryOptions = {
83
+ retryOptions: CommonRetryOptions;
84
+ retryFn: (...args: any[]) => Promise<any> | (() => Promise<any>);
85
+ beforeExecuteRetry?: (...args: any[]) => void;
24
86
  };
25
87
 
26
- declare const RetryPlugin: (params: RetryPluginParams) => ModuleFederationRuntimePlugin;
88
+ declare function rewriteWithNextDomain(currentUrl: string, domains?: string[]): string | null;
89
+ declare function appendRetryCountQuery(url: string, retryIndex: number, key?: string): string;
90
+ declare function getRetryUrl(baseUrl: string, opts?: {
91
+ domains?: string[];
92
+ addQuery?: boolean | ((context: {
93
+ times: number;
94
+ originalQuery: string;
95
+ }) => string);
96
+ retryIndex?: number;
97
+ queryKey?: string;
98
+ }): string;
99
+ /**
100
+ * Extract domain/host info from a URL and combine it with path/query from another URL
101
+ * This is useful for domain rotation while preserving original path and query parameters
102
+ * @param domainUrl - URL containing the target domain/host
103
+ * @param pathQueryUrl - URL containing the target path and query parameters
104
+ * @returns Combined URL with domain from domainUrl and path/query from pathQueryUrl
105
+ */
106
+ declare function combineUrlDomainWithPathQuery(domainUrl: string, pathQueryUrl: string): string;
107
+
108
+ declare const RetryPlugin: (params?: CommonRetryOptions) => ModuleFederationRuntimePlugin;
27
109
 
28
- export { type FetchWithRetryOptions, RetryPlugin, type RetryPluginParams, type ScriptWithRetryOptions };
110
+ export { type CommonRetryOptions, type FetchRetryOptions, RetryPlugin, type ScriptRetryOptions, appendRetryCountQuery, combineUrlDomainWithPathQuery, getRetryUrl, rewriteWithNextDomain };
package/dist/index.js CHANGED
@@ -21,7 +21,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  // packages/retry-plugin/src/index.ts
22
22
  var src_exports = {};
23
23
  __export(src_exports, {
24
- RetryPlugin: () => RetryPlugin
24
+ RetryPlugin: () => RetryPlugin,
25
+ appendRetryCountQuery: () => appendRetryCountQuery,
26
+ combineUrlDomainWithPathQuery: () => combineUrlDomainWithPathQuery,
27
+ getRetryUrl: () => getRetryUrl,
28
+ rewriteWithNextDomain: () => rewriteWithNextDomain
25
29
  });
26
30
  module.exports = __toCommonJS(src_exports);
27
31
 
@@ -29,88 +33,280 @@ module.exports = __toCommonJS(src_exports);
29
33
  var defaultRetries = 3;
30
34
  var defaultRetryDelay = 1e3;
31
35
  var PLUGIN_IDENTIFIER = "[ Module Federation RetryPlugin ]";
36
+ var ERROR_ABANDONED = "The request failed and has now been abandoned";
32
37
 
33
38
  // packages/retry-plugin/src/logger.ts
34
39
  var import_sdk = require("@module-federation/sdk");
35
40
  var logger = (0, import_sdk.createLogger)(PLUGIN_IDENTIFIER);
36
41
  var logger_default = logger;
37
42
 
43
+ // packages/retry-plugin/src/utils.ts
44
+ function rewriteWithNextDomain(currentUrl, domains) {
45
+ if (!domains || domains.length === 0)
46
+ return null;
47
+ try {
48
+ const u = new URL(currentUrl);
49
+ const currentHostname = u.hostname;
50
+ const currentPort = u.port;
51
+ const currentHost = `${currentHostname}${currentPort ? `:${currentPort}` : ""}`;
52
+ const normalized = domains.map((d) => {
53
+ try {
54
+ const du = new URL(d.startsWith("http") ? d : `https://${d}`);
55
+ return {
56
+ hostname: du.hostname,
57
+ port: du.port,
58
+ protocol: du.protocol
59
+ };
60
+ } catch {
61
+ return {
62
+ hostname: d,
63
+ port: "",
64
+ protocol: u.protocol
65
+ };
66
+ }
67
+ }).filter((d) => !!d.hostname);
68
+ if (normalized.length === 0)
69
+ return null;
70
+ let idx = -1;
71
+ for (let i = normalized.length - 1; i >= 0; i--) {
72
+ const candHost = `${normalized[i].hostname}${normalized[i].port ? `:${normalized[i].port}` : ""}`;
73
+ if (candHost === currentHost) {
74
+ idx = i;
75
+ break;
76
+ }
77
+ }
78
+ const total = normalized.length;
79
+ for (let step = 1; step <= total; step++) {
80
+ const nextIdx = ((idx >= 0 ? idx : -1) + step) % total;
81
+ const candidate = normalized[nextIdx];
82
+ const candidateHost = `${candidate.hostname}${candidate.port ? `:${candidate.port}` : ""}`;
83
+ if (candidateHost !== currentHost) {
84
+ u.hostname = candidate.hostname;
85
+ if (candidate.port !== void 0 && candidate.port !== null && candidate.port !== "") {
86
+ u.port = candidate.port;
87
+ } else {
88
+ u.port = "";
89
+ }
90
+ u.protocol = candidate.protocol || u.protocol;
91
+ return u.toString();
92
+ }
93
+ }
94
+ return null;
95
+ } catch {
96
+ return null;
97
+ }
98
+ }
99
+ __name(rewriteWithNextDomain, "rewriteWithNextDomain");
100
+ function appendRetryCountQuery(url, retryIndex, key = "retryCount") {
101
+ try {
102
+ const u = new URL(url);
103
+ u.searchParams.delete(key);
104
+ u.searchParams.set(key, String(retryIndex));
105
+ return u.toString();
106
+ } catch {
107
+ return url;
108
+ }
109
+ }
110
+ __name(appendRetryCountQuery, "appendRetryCountQuery");
111
+ function getRetryUrl(baseUrl, opts = {}) {
112
+ const { domains, addQuery, retryIndex = 0, queryKey = "retryCount" } = opts;
113
+ let cleanBaseUrl = baseUrl;
114
+ try {
115
+ const urlObj = new URL(baseUrl);
116
+ urlObj.searchParams.delete(queryKey);
117
+ cleanBaseUrl = urlObj.toString();
118
+ } catch {
119
+ }
120
+ let nextUrl = rewriteWithNextDomain(cleanBaseUrl, domains) ?? cleanBaseUrl;
121
+ if (retryIndex > 0 && addQuery) {
122
+ try {
123
+ const u = new URL(nextUrl);
124
+ const originalUrl = new URL(baseUrl);
125
+ originalUrl.searchParams.delete(queryKey);
126
+ const originalQuery = originalUrl.search.startsWith("?") ? originalUrl.search.slice(1) : originalUrl.search;
127
+ if (typeof addQuery === "function") {
128
+ const newQuery = addQuery({
129
+ times: retryIndex,
130
+ originalQuery
131
+ });
132
+ u.search = newQuery ? `?${newQuery.replace(/^\?/, "")}` : "";
133
+ nextUrl = u.toString();
134
+ } else if (addQuery === true) {
135
+ u.searchParams.delete(queryKey);
136
+ u.searchParams.set(queryKey, String(retryIndex));
137
+ nextUrl = u.toString();
138
+ }
139
+ } catch {
140
+ if (addQuery === true) {
141
+ nextUrl = appendRetryCountQuery(nextUrl, retryIndex, queryKey);
142
+ }
143
+ }
144
+ }
145
+ return nextUrl;
146
+ }
147
+ __name(getRetryUrl, "getRetryUrl");
148
+ function combineUrlDomainWithPathQuery(domainUrl, pathQueryUrl) {
149
+ try {
150
+ const domainUrlObj = new URL(domainUrl);
151
+ const pathQueryUrlObj = new URL(pathQueryUrl);
152
+ domainUrlObj.pathname = pathQueryUrlObj.pathname;
153
+ domainUrlObj.search = pathQueryUrlObj.search;
154
+ return domainUrlObj.toString();
155
+ } catch {
156
+ return pathQueryUrl;
157
+ }
158
+ }
159
+ __name(combineUrlDomainWithPathQuery, "combineUrlDomainWithPathQuery");
160
+
38
161
  // packages/retry-plugin/src/fetch-retry.ts
39
- async function fetchWithRetry(params, userOriginalRetryTimes) {
40
- const { manifestUrl, options = {}, retryTimes = defaultRetries, retryDelay = defaultRetryDelay, fallback, getRetryPath } = params;
41
- const url = manifestUrl || params.url;
162
+ async function fetchRetry(params, lastRequestUrl, originalTotal) {
163
+ const {
164
+ url,
165
+ fetchOptions = {},
166
+ retryTimes = defaultRetries,
167
+ retryDelay = defaultRetryDelay,
168
+ // List of retry domains when resource loading fails. In the domains array, the first item is the default domain for static resources, and the subsequent items are backup domains. When a request to a domain fails, the system will find that domain in the array and replace it with the next domain in the array.
169
+ domains,
170
+ // Whether to add query parameters during resource retry to avoid being affected by browser and CDN cache. When set to true, retry=${times} will be added to the query, requesting in the order of retry=1, retry=2, retry=3.
171
+ addQuery,
172
+ onRetry,
173
+ onSuccess,
174
+ onError
175
+ } = params;
42
176
  if (!url) {
43
- throw new Error("[retry-plugin] manifestUrl or url is required");
177
+ throw new Error(`${PLUGIN_IDENTIFIER}: url is required in fetchWithRetry`);
178
+ }
179
+ const total = originalTotal ?? params.retryTimes ?? defaultRetries;
180
+ const isFirstAttempt = !lastRequestUrl;
181
+ let baseUrl = url;
182
+ if (!isFirstAttempt && lastRequestUrl) {
183
+ baseUrl = combineUrlDomainWithPathQuery(lastRequestUrl, url);
184
+ }
185
+ let requestUrl = baseUrl;
186
+ if (!isFirstAttempt) {
187
+ requestUrl = getRetryUrl(baseUrl, {
188
+ domains,
189
+ addQuery,
190
+ retryIndex: total - retryTimes,
191
+ queryKey: "retryCount"
192
+ });
44
193
  }
45
- const originalRetryTimes = userOriginalRetryTimes ?? params.retryTimes ?? defaultRetries;
46
- const isRetry = retryTimes !== originalRetryTimes;
47
- const retryUrl = isRetry && getRetryPath ? getRetryPath(url) : null;
48
- const requestUrl = retryUrl || url;
49
194
  try {
50
- const response = await fetch(requestUrl, options);
195
+ if (!isFirstAttempt && retryDelay > 0) {
196
+ await new Promise((resolve) => setTimeout(resolve, retryDelay));
197
+ }
198
+ const response = await fetch(requestUrl, fetchOptions);
51
199
  const responseClone = response.clone();
52
200
  if (!response.ok) {
53
- throw new Error(`Server error\uFF1A${response.status}`);
201
+ throw new Error(`${PLUGIN_IDENTIFIER}: Request failed: ${response.status} ${response.statusText || ""} | url: ${requestUrl}`);
54
202
  }
55
203
  await responseClone.json().catch((error) => {
56
- throw new Error(`Json parse error: ${error}, url is: ${requestUrl}`);
204
+ throw new Error(`${PLUGIN_IDENTIFIER}: JSON parse failed: ${error?.message || String(error)} | url: ${requestUrl}`);
57
205
  });
206
+ if (!isFirstAttempt) {
207
+ onSuccess && requestUrl && onSuccess({
208
+ domains,
209
+ url: requestUrl,
210
+ tagName: "fetch"
211
+ });
212
+ }
58
213
  return response;
59
214
  } catch (error) {
60
215
  if (retryTimes <= 0) {
61
- logger_default.log(`${PLUGIN_IDENTIFIER}: retry failed after ${defaultRetries} times for url: ${requestUrl}, now will try fallbackUrl url`);
62
- if (requestUrl && fallback && typeof fallback === "function") {
63
- return fetchWithRetry({
64
- manifestUrl: fallback(requestUrl),
65
- options,
66
- retryTimes: 0,
67
- retryDelay: 0
216
+ const attemptedRetries = total - retryTimes;
217
+ if (!isFirstAttempt && attemptedRetries > 0) {
218
+ onError && onError({
219
+ domains,
220
+ url: requestUrl,
221
+ tagName: "fetch"
68
222
  });
223
+ logger_default.log(`${PLUGIN_IDENTIFIER}: retry failed, no retries left for url: ${requestUrl}`);
69
224
  }
70
- if (error instanceof Error && error.message.includes("Json parse error")) {
71
- throw error;
72
- }
73
- throw new Error(`${PLUGIN_IDENTIFIER}: The request failed three times and has now been abandoned`);
225
+ throw new Error(`${PLUGIN_IDENTIFIER}: ${ERROR_ABANDONED}`);
74
226
  } else {
75
- retryDelay > 0 && await new Promise((resolve) => setTimeout(resolve, retryDelay));
76
- logger_default.log(`Trying again. Number of retries available\uFF1A${retryTimes - 1}`);
77
- return await fetchWithRetry({
227
+ const nextIndex = total - retryTimes + 1;
228
+ const predictedBaseUrl = combineUrlDomainWithPathQuery(requestUrl, url);
229
+ const predictedNextUrl = getRetryUrl(predictedBaseUrl, {
230
+ domains,
231
+ addQuery,
232
+ retryIndex: nextIndex,
233
+ queryKey: "retryCount"
234
+ });
235
+ onRetry && onRetry({
236
+ times: nextIndex,
237
+ domains,
238
+ url: predictedNextUrl,
239
+ tagName: "fetch"
240
+ });
241
+ logger_default.log(`${PLUGIN_IDENTIFIER}: Trying again. Number of retries left: ${retryTimes - 1}`);
242
+ return await fetchRetry({
78
243
  ...params,
79
244
  retryTimes: retryTimes - 1
80
- }, originalRetryTimes);
245
+ }, requestUrl, total);
81
246
  }
82
247
  }
83
248
  }
84
- __name(fetchWithRetry, "fetchWithRetry");
249
+ __name(fetchRetry, "fetchRetry");
85
250
 
86
251
  // packages/retry-plugin/src/script-retry.ts
87
- function scriptRetry({ scriptOption, moduleInfo, retryFn, beforeExecuteRetry = /* @__PURE__ */ __name(() => {
252
+ function scriptRetry({ retryOptions, retryFn, beforeExecuteRetry = /* @__PURE__ */ __name(() => {
88
253
  }, "beforeExecuteRetry") }) {
89
254
  return async function(params) {
90
255
  let retryWrapper;
91
- const { retryTimes = defaultRetries, retryDelay = defaultRetryDelay } = scriptOption || {};
92
- const shouldRetryThisModule = shouldRetryModule(scriptOption, moduleInfo);
93
- if (shouldRetryThisModule) {
94
- let attempts = 0;
95
- while (attempts < retryTimes) {
96
- try {
97
- beforeExecuteRetry();
256
+ let lastError;
257
+ let lastRequestUrl;
258
+ let originalUrl;
259
+ const { retryTimes = defaultRetries, retryDelay = defaultRetryDelay, domains, addQuery, onRetry, onSuccess, onError } = retryOptions || {};
260
+ let attempts = 0;
261
+ while (attempts < retryTimes) {
262
+ try {
263
+ beforeExecuteRetry();
264
+ if (retryDelay > 0) {
98
265
  await new Promise((resolve) => setTimeout(resolve, retryDelay));
99
- retryWrapper = await retryFn({
100
- ...params,
101
- // add getRetryPath to load entry url passed by user
102
- getEntryUrl: scriptOption?.getRetryPath
103
- });
104
- break;
105
- } catch (error) {
106
- attempts++;
107
- if (attempts < retryTimes) {
108
- logger_default.log(`${PLUGIN_IDENTIFIER}: script resource retrying ${attempts} times`);
109
- await new Promise((resolve) => setTimeout(resolve, retryDelay));
110
- } else {
111
- scriptOption?.cb && await new Promise((resolve) => scriptOption?.cb && scriptOption?.cb(resolve, error));
112
- throw error;
266
+ }
267
+ const retryIndex = attempts + 1;
268
+ retryWrapper = await retryFn({
269
+ ...params,
270
+ getEntryUrl: (url) => {
271
+ if (!originalUrl) {
272
+ originalUrl = url;
273
+ }
274
+ let baseUrl = originalUrl;
275
+ if (lastRequestUrl) {
276
+ baseUrl = combineUrlDomainWithPathQuery(lastRequestUrl, originalUrl);
277
+ }
278
+ const next = getRetryUrl(baseUrl, {
279
+ domains,
280
+ addQuery,
281
+ retryIndex,
282
+ queryKey: "retryCount"
283
+ });
284
+ onRetry && onRetry({
285
+ times: retryIndex,
286
+ domains,
287
+ url: next,
288
+ tagName: "script"
289
+ });
290
+ lastRequestUrl = next;
291
+ return next;
113
292
  }
293
+ });
294
+ onSuccess && lastRequestUrl && onSuccess({
295
+ domains,
296
+ url: lastRequestUrl,
297
+ tagName: "script"
298
+ });
299
+ break;
300
+ } catch (error) {
301
+ lastError = error;
302
+ attempts++;
303
+ if (attempts >= retryTimes) {
304
+ onError && lastRequestUrl && onError({
305
+ domains,
306
+ url: lastRequestUrl,
307
+ tagName: "script"
308
+ });
309
+ throw new Error(`${PLUGIN_IDENTIFIER}: ${ERROR_ABANDONED}`);
114
310
  }
115
311
  }
116
312
  }
@@ -118,67 +314,63 @@ function scriptRetry({ scriptOption, moduleInfo, retryFn, beforeExecuteRetry = /
118
314
  };
119
315
  }
120
316
  __name(scriptRetry, "scriptRetry");
121
- function shouldRetryModule(scriptOption, moduleInfo) {
122
- if (!scriptOption?.moduleName) {
123
- return true;
124
- }
125
- const moduleNames = scriptOption.moduleName;
126
- const currentModuleName = moduleInfo.name;
127
- const currentModuleAlias = moduleInfo?.alias;
128
- return moduleNames.some((targetName) => targetName === currentModuleName || targetName === currentModuleAlias);
129
- }
130
- __name(shouldRetryModule, "shouldRetryModule");
131
317
 
132
318
  // packages/retry-plugin/src/index.ts
133
- var loadEntryErrorCache = /* @__PURE__ */ new Set();
134
- var RetryPlugin = /* @__PURE__ */ __name(({ fetch: fetchOption, script: scriptOption }) => ({
135
- name: "retry-plugin",
136
- async fetch(manifestUrl, options) {
137
- const { retryTimes, fallback, getRetryPath } = fetchOption || {};
138
- if (fetchOption) {
139
- return fetchWithRetry({
140
- manifestUrl,
141
- options: {
319
+ var RetryPlugin = /* @__PURE__ */ __name((params) => {
320
+ if (params?.fetch || params?.script) {
321
+ logger_default.warn(`${PLUGIN_IDENTIFIER}: fetch or script config is deprecated, please use the new config style. See docs: https://module-federation.io/plugin/plugins/retry-plugin.html`);
322
+ }
323
+ const { fetchOptions = {}, retryTimes = defaultRetries, successTimes = 0, retryDelay = defaultRetryDelay, domains = [], manifestDomains = [], addQuery, onRetry, onSuccess, onError } = params || {};
324
+ return {
325
+ name: "retry-plugin",
326
+ async fetch(manifestUrl, options) {
327
+ return fetchRetry({
328
+ url: manifestUrl,
329
+ fetchOptions: {
142
330
  ...options,
143
- ...fetchOption?.options
331
+ ...fetchOptions
144
332
  },
333
+ domains: manifestDomains || domains,
334
+ addQuery,
335
+ onRetry,
336
+ onSuccess,
337
+ onError,
145
338
  retryTimes,
146
- fallback,
147
- getRetryPath
339
+ successTimes,
340
+ retryDelay
341
+ });
342
+ },
343
+ async loadEntryError({ getRemoteEntry, origin, remoteInfo, remoteEntryExports, globalLoading, uniqueKey }) {
344
+ const beforeExecuteRetry = /* @__PURE__ */ __name(() => {
345
+ delete globalLoading[uniqueKey];
346
+ }, "beforeExecuteRetry");
347
+ const getRemoteEntryRetry = scriptRetry({
348
+ retryOptions: {
349
+ retryTimes,
350
+ retryDelay,
351
+ domains,
352
+ addQuery,
353
+ onRetry,
354
+ onSuccess,
355
+ onError
356
+ },
357
+ retryFn: getRemoteEntry,
358
+ beforeExecuteRetry
148
359
  });
149
- }
150
- return fetch(manifestUrl, options);
151
- },
152
- async loadEntryError({ getRemoteEntry, origin, remoteInfo, remoteEntryExports, globalLoading, uniqueKey }) {
153
- if (!scriptOption || loadEntryErrorCache.has(uniqueKey)) {
154
- logger_default.log(`${PLUGIN_IDENTIFIER}: loadEntryError already processed for uniqueKey: ${uniqueKey}, skipping retry`);
155
- return;
156
- }
157
- loadEntryErrorCache.add(uniqueKey);
158
- const beforeExecuteRetry = /* @__PURE__ */ __name(() => {
159
- delete globalLoading[uniqueKey];
160
- }, "beforeExecuteRetry");
161
- const getRemoteEntryRetry = scriptRetry({
162
- scriptOption,
163
- moduleInfo: remoteInfo,
164
- retryFn: getRemoteEntry,
165
- beforeExecuteRetry
166
- });
167
- try {
168
360
  const result = await getRemoteEntryRetry({
169
361
  origin,
170
362
  remoteInfo,
171
363
  remoteEntryExports
172
364
  });
173
- loadEntryErrorCache.delete(uniqueKey);
174
365
  return result;
175
- } catch (error) {
176
- loadEntryErrorCache.delete(uniqueKey);
177
- throw error;
178
366
  }
179
- }
180
- }), "RetryPlugin");
367
+ };
368
+ }, "RetryPlugin");
181
369
  // Annotate the CommonJS export names for ESM import in node:
182
370
  0 && (module.exports = {
183
- RetryPlugin
371
+ RetryPlugin,
372
+ appendRetryCountQuery,
373
+ combineUrlDomainWithPathQuery,
374
+ getRetryUrl,
375
+ rewriteWithNextDomain
184
376
  });
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/retry-plugin",
3
- "version": "0.18.4",
3
+ "version": "0.19.0",
4
4
  "author": "danpeen <dapeen.feng@gmail.com>",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -8,7 +8,7 @@
8
8
  "license": "MIT",
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "https://github.com/module-federation/core/",
11
+ "url": "git+https://github.com/module-federation/core.git",
12
12
  "directory": "packages/retry-plugin"
13
13
  },
14
14
  "publishConfig": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/retry-plugin",
3
- "version": "0.18.4",
3
+ "version": "0.19.0",
4
4
  "author": "danpeen <dapeen.feng@gmail.com>",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -8,7 +8,7 @@
8
8
  "license": "MIT",
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "https://github.com/module-federation/core/",
11
+ "url": "git+https://github.com/module-federation/core.git",
12
12
  "directory": "packages/retry-plugin"
13
13
  },
14
14
  "publishConfig": {
@@ -33,9 +33,9 @@
33
33
  }
34
34
  },
35
35
  "devDependencies": {
36
- "@module-federation/runtime": "0.18.4"
36
+ "@module-federation/runtime": "0.19.0"
37
37
  },
38
38
  "dependencies": {
39
- "@module-federation/sdk": "0.18.4"
39
+ "@module-federation/sdk": "0.19.0"
40
40
  }
41
41
  }