@servicetitan/lazy-module 26.2.0 → 26.4.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.js +4 -13
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -7,15 +7,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
11
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
12
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
13
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
14
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
15
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
16
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
11
|
/* eslint-disable react/no-set-state */
|
|
21
12
|
import { Component, Suspense, lazy, Fragment } from 'react';
|
|
@@ -72,23 +63,23 @@ export function lazyModule({ loader, name, loadingComponent: Loading = DefaultLo
|
|
|
72
63
|
}
|
|
73
64
|
render() {
|
|
74
65
|
const { hasError } = this.state;
|
|
75
|
-
return (_jsx(ErrorBoundary, { fallback: errorFallbackComponent, moduleName: name, children: hasError ? (_jsx(LoadingError, { onReload: this.onReload })) : (_jsx(Suspense, { fallback: _jsx(Loading, {}), children: _jsx(this.Lazy,
|
|
66
|
+
return (_jsx(ErrorBoundary, { fallback: errorFallbackComponent, moduleName: name, children: hasError ? (_jsx(LoadingError, { onReload: this.onReload })) : (_jsx(Suspense, { fallback: _jsx(Loading, {}), children: _jsx(this.Lazy, { ...this.props }) })) }));
|
|
76
67
|
}
|
|
77
68
|
/**
|
|
78
69
|
* Creates a onetime Lazy component with an error handler
|
|
79
70
|
* (it needed to re-create the Lazy component, when a loading error has occurred)
|
|
80
71
|
*/
|
|
81
72
|
createLazy() {
|
|
82
|
-
return lazy(() =>
|
|
73
|
+
return lazy(async () => {
|
|
83
74
|
try {
|
|
84
|
-
return { default:
|
|
75
|
+
return { default: await loader() };
|
|
85
76
|
}
|
|
86
77
|
catch (e) {
|
|
87
78
|
this.onError(e);
|
|
88
79
|
this.setState({ hasError: true });
|
|
89
80
|
}
|
|
90
81
|
return { default: Empty };
|
|
91
|
-
})
|
|
82
|
+
});
|
|
92
83
|
}
|
|
93
84
|
}
|
|
94
85
|
Object.defineProperty(LazyModule, "displayName", {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,uCAAuC;AACvC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAqB,MAAM,OAAO,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAC;AAUhD,aAAa;AACb;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAsC,EAC5D,MAAM,EACN,IAAI,EACJ,gBAAgB,EAAE,OAAO,GAAG,cAAc,EAC1C,qBAAqB,EAAE,YAAY,GAAG,mBAAmB,EACzD,sBAAsB,GACJ;IAClB,MAAM,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,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;gBACtC,CAAC;gBACD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;YAC9B,CAAC,CAAC,CAAC;QACP,CAAC;;IAvDM;;;;eAAc,cAAc,IAAI,GAAG;MAAxB,CAAyB;IAQ3B;QAFf,QAAQ,EAAE;QACV,gBAAgB,CAAC,GAAG,CAAC;kCACO,GAAG;kDAAC;IAkDrC,OAAO,UAAU,CAAC;AACtB,CAAC;AAMD,MAAM,CAAC,MAAM,cAAc,GAAO,GAAG,EAAE,CAAC,sCAAmB,CAAC;AAM5D,MAAM,CAAC,MAAM,mBAAmB,GAA0B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CACxE,MAAC,QAAQ,eACL,iDAA8B,EAC9B,iBAAQ,OAAO,EAAE,QAAQ,uBAAiB,IACnC,CACd,CAAC;AAEF,MAAM,KAAK,GAAY,GAAG,EAAE,CAAC,IAAI,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/lazy-module",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.4.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"homepage": "https://docs.st.dev/docs/frontend/lazy-module",
|
|
6
6
|
"repository": {
|
|
@@ -16,16 +16,16 @@
|
|
|
16
16
|
"src"
|
|
17
17
|
],
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@servicetitan/error-boundary": "26.
|
|
20
|
-
"@servicetitan/log-service": "26.
|
|
21
|
-
"@servicetitan/react-ioc": "26.
|
|
19
|
+
"@servicetitan/error-boundary": "26.4.0",
|
|
20
|
+
"@servicetitan/log-service": "26.4.0",
|
|
21
|
+
"@servicetitan/react-ioc": "26.4.0",
|
|
22
22
|
"@types/react": "~18.3.3",
|
|
23
23
|
"react": "~18.3.1"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@servicetitan/error-boundary": "26.
|
|
27
|
-
"@servicetitan/log-service": "26.
|
|
28
|
-
"@servicetitan/react-ioc": "26.
|
|
26
|
+
"@servicetitan/error-boundary": "26.4.0",
|
|
27
|
+
"@servicetitan/log-service": "26.4.0",
|
|
28
|
+
"@servicetitan/react-ioc": "26.4.0",
|
|
29
29
|
"react": ">=17.0.2"
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"cli": {
|
|
35
35
|
"webpack": false
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "2e4ea0f45727d1519f1d0b2925c9a21b1cb462e5"
|
|
38
38
|
}
|