@ovineko/spa-guard-react 0.0.1-alpha-29 → 0.0.1-alpha-31
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.
|
@@ -5,7 +5,7 @@ export type { LazyRetryOptions } from "./types";
|
|
|
5
5
|
* Creates a lazy-loaded React component with automatic retry on chunk load failures.
|
|
6
6
|
*
|
|
7
7
|
* On import failure, retries with configurable delays before falling back to
|
|
8
|
-
* `
|
|
8
|
+
* `triggerRetry()` for a full page reload.
|
|
9
9
|
*
|
|
10
10
|
* @param importFn - Function that performs the dynamic import
|
|
11
11
|
* @param options - Per-import options that override global lazyRetry options
|
package/dist/react/types.d.ts
CHANGED
|
@@ -10,8 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
export interface LazyRetryOptions {
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
* If true, triggers page reload logic after all retries fail.
|
|
13
|
+
* If true, triggers a full page reload via triggerRetry() after all retry attempts are exhausted.
|
|
15
14
|
* If false, only throws the error to the error boundary without reload.
|
|
16
15
|
* Overrides the global `window.__SPA_GUARD_OPTIONS__.lazyRetry.callReloadOnFailure`.
|
|
17
16
|
*
|
|
@@ -42,7 +42,7 @@ var ErrorBoundaryImpl = class extends Component {
|
|
|
42
42
|
componentDidUpdate(prevProps) {
|
|
43
43
|
const { resetKeys = [] } = this.props;
|
|
44
44
|
const prevResetKeys = prevProps.resetKeys ?? [];
|
|
45
|
-
if (resetKeys.length !== prevResetKeys.length || resetKeys.some((key, i) => key !== prevResetKeys[i])) {
|
|
45
|
+
if (this.state.error !== null && (resetKeys.length !== prevResetKeys.length || resetKeys.some((key, i) => key !== prevResetKeys[i]))) {
|
|
46
46
|
this.resetError();
|
|
47
47
|
}
|
|
48
48
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ovineko/spa-guard-react",
|
|
3
|
-
"version": "0.0.1-alpha-
|
|
3
|
+
"version": "0.0.1-alpha-31",
|
|
4
4
|
"description": "React hooks, components, and error boundaries for spa-guard",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"spa",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
],
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"react": "^19",
|
|
39
|
-
"@ovineko/spa-guard": "0.0.1-alpha-
|
|
39
|
+
"@ovineko/spa-guard": "0.0.1-alpha-31"
|
|
40
40
|
},
|
|
41
41
|
"engines": {
|
|
42
42
|
"node": ">=22.15.0"
|