@module-federation/retry-plugin 2.8.1 → 2.8.2
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/README.md +6 -1
- package/dist/CHANGELOG.md +8 -0
- package/dist/README.md +6 -1
- package/dist/esm/index.js +2 -1
- package/dist/index.js +2 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -100,7 +100,7 @@ export default () =>
|
|
|
100
100
|
| `successTimes` | `number` | `0` | Number of successful requests required |
|
|
101
101
|
| `domains` | `string[]` | `[]` | Alternative domains for script resources |
|
|
102
102
|
| `manifestDomains` | `string[]` | `[]` | Alternative domains for manifest files |
|
|
103
|
-
| `addQuery` | `boolean \| function` |
|
|
103
|
+
| `addQuery` | `boolean \| function` | See below | Add query parameters for cache busting |
|
|
104
104
|
| `fetchOptions` | `RequestInit` | `{}` | Additional fetch options |
|
|
105
105
|
| `onRetry` | `function` | `undefined` | Callback when retry occurs |
|
|
106
106
|
| `onSuccess` | `function` | `undefined` | Callback when request succeeds |
|
|
@@ -108,6 +108,11 @@ export default () =>
|
|
|
108
108
|
|
|
109
109
|
### addQuery Function
|
|
110
110
|
|
|
111
|
+
When omitted, `addQuery` defaults to `true` only for `esm` and `module` remote
|
|
112
|
+
entry retries. This gives failed dynamic imports a new URL because browsers cache
|
|
113
|
+
their failures by URL. Manifest, fetch, and classic script retries still default
|
|
114
|
+
to no query parameter. Set `addQuery: false` to disable the ESM/module default.
|
|
115
|
+
|
|
111
116
|
```ts
|
|
112
117
|
addQuery: ({ times, originalQuery }) => {
|
|
113
118
|
// Add retry count and timestamp for cache busting
|
package/dist/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @module-federation/retry-plugin
|
|
2
2
|
|
|
3
|
+
## 2.8.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- db13cf6: Fix retry-plugin recovery for ESM and module remote entry load failures, including default cache-busting retries.
|
|
8
|
+
- @module-federation/runtime@2.8.2
|
|
9
|
+
- @module-federation/sdk@2.8.2
|
|
10
|
+
|
|
3
11
|
## 2.8.1
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/dist/README.md
CHANGED
|
@@ -100,7 +100,7 @@ export default () =>
|
|
|
100
100
|
| `successTimes` | `number` | `0` | Number of successful requests required |
|
|
101
101
|
| `domains` | `string[]` | `[]` | Alternative domains for script resources |
|
|
102
102
|
| `manifestDomains` | `string[]` | `[]` | Alternative domains for manifest files |
|
|
103
|
-
| `addQuery` | `boolean \| function` |
|
|
103
|
+
| `addQuery` | `boolean \| function` | See below | Add query parameters for cache busting |
|
|
104
104
|
| `fetchOptions` | `RequestInit` | `{}` | Additional fetch options |
|
|
105
105
|
| `onRetry` | `function` | `undefined` | Callback when retry occurs |
|
|
106
106
|
| `onSuccess` | `function` | `undefined` | Callback when request succeeds |
|
|
@@ -108,6 +108,11 @@ export default () =>
|
|
|
108
108
|
|
|
109
109
|
### addQuery Function
|
|
110
110
|
|
|
111
|
+
When omitted, `addQuery` defaults to `true` only for `esm` and `module` remote
|
|
112
|
+
entry retries. This gives failed dynamic imports a new URL because browsers cache
|
|
113
|
+
their failures by URL. Manifest, fetch, and classic script retries still default
|
|
114
|
+
to no query parameter. Set `addQuery: false` to disable the ESM/module default.
|
|
115
|
+
|
|
111
116
|
```ts
|
|
112
117
|
addQuery: ({ times, originalQuery }) => {
|
|
113
118
|
// Add retry count and timestamp for cache busting
|
package/dist/esm/index.js
CHANGED
|
@@ -279,6 +279,7 @@ const RetryPlugin = (params) => {
|
|
|
279
279
|
});
|
|
280
280
|
},
|
|
281
281
|
async loadEntryError({ getRemoteEntry, origin, remoteInfo, remoteEntryExports, globalLoading, uniqueKey }) {
|
|
282
|
+
const retryAddQuery = addQuery === void 0 && (remoteInfo.type === "esm" || remoteInfo.type === "module") ? true : addQuery;
|
|
282
283
|
const beforeExecuteRetry = () => {
|
|
283
284
|
delete globalLoading[uniqueKey];
|
|
284
285
|
};
|
|
@@ -287,7 +288,7 @@ const RetryPlugin = (params) => {
|
|
|
287
288
|
retryTimes,
|
|
288
289
|
retryDelay,
|
|
289
290
|
domains,
|
|
290
|
-
addQuery,
|
|
291
|
+
addQuery: retryAddQuery,
|
|
291
292
|
onRetry,
|
|
292
293
|
onSuccess,
|
|
293
294
|
onError
|
package/dist/index.js
CHANGED
|
@@ -280,6 +280,7 @@ const RetryPlugin = (params) => {
|
|
|
280
280
|
});
|
|
281
281
|
},
|
|
282
282
|
async loadEntryError({ getRemoteEntry, origin, remoteInfo, remoteEntryExports, globalLoading, uniqueKey }) {
|
|
283
|
+
const retryAddQuery = addQuery === void 0 && (remoteInfo.type === "esm" || remoteInfo.type === "module") ? true : addQuery;
|
|
283
284
|
const beforeExecuteRetry = () => {
|
|
284
285
|
delete globalLoading[uniqueKey];
|
|
285
286
|
};
|
|
@@ -288,7 +289,7 @@ const RetryPlugin = (params) => {
|
|
|
288
289
|
retryTimes,
|
|
289
290
|
retryDelay,
|
|
290
291
|
domains,
|
|
291
|
-
addQuery,
|
|
292
|
+
addQuery: retryAddQuery,
|
|
292
293
|
onRetry,
|
|
293
294
|
onSuccess,
|
|
294
295
|
onError
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/retry-plugin",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.2",
|
|
4
4
|
"author": "danpeen <dapeen.feng@gmail.com>",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"@module-federation/runtime": "*"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@module-federation/runtime": "2.8.
|
|
39
|
+
"@module-federation/runtime": "2.8.2"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@module-federation/sdk": "2.8.
|
|
42
|
+
"@module-federation/sdk": "2.8.2"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "tsdown --config tsdown.config.ts && cp *.md dist",
|