@servicetitan/web-components 23.3.0 → 23.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/utils/web-component.d.ts +1 -1
- package/dist/utils/web-component.d.ts.map +1 -1
- package/dist/utils/web-component.js.map +1 -1
- package/package.json +8 -8
- package/src/__tests__/register-legacy-root.test.tsx +1 -0
- package/src/__tests__/register.test.tsx +2 -0
- package/src/loader.tsx +1 -1
- package/src/utils/web-component.tsx +1 -1
|
@@ -12,6 +12,6 @@ interface WebComponentProps {
|
|
|
12
12
|
logService?: Log;
|
|
13
13
|
LoadingFallback: () => JSX.Element;
|
|
14
14
|
}
|
|
15
|
-
export declare function webComponent(props: WebComponentProps): (props: LoaderDataProps) => JSX.Element;
|
|
15
|
+
export declare function webComponent(props: WebComponentProps): (props: LoaderDataProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
export {};
|
|
17
17
|
//# sourceMappingURL=web-component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-component.d.ts","sourceRoot":"","sources":["../../src/utils/web-component.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAC;AAGhD,OAAO,EAAE,mBAAmB,EAAiB,MAAM,WAAW,CAAC;AAE/D,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,UAAU,iBAAiB;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,UAAU,CAAC;IACvB,QAAQ,EAAE,QAAQ,CAAC;IACnB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,eAAe,EAAE,MAAM,GAAG,CAAC,OAAO,CAAC;CACtC;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,WAKlC,eAAe,
|
|
1
|
+
{"version":3,"file":"web-component.d.ts","sourceRoot":"","sources":["../../src/utils/web-component.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAC;AAGhD,OAAO,EAAE,mBAAmB,EAAiB,MAAM,WAAW,CAAC;AAE/D,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,UAAU,iBAAiB;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,UAAU,CAAC;IACvB,QAAQ,EAAE,QAAQ,CAAC;IACnB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,eAAe,EAAE,MAAM,GAAG,CAAC,OAAO,CAAC;CACtC;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,WAKlC,eAAe,6CAmDjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-component.js","sourceRoot":"","sources":["../../src/utils/web-component.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAMlE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAYpD,MAAM,UAAU,YAAY,CAAC,KAAwB;IACjD,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,mBAAmB,EAAE,UAAU,EAAE,eAAe,EAAE,GACtF,KAAK,CAAC;IACV,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,sBAAsB,EAAE,GAAG,UAAU,CAAC;IAEtE,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
3
|
+
"version": "23.4.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,18 +15,18 @@
|
|
|
15
15
|
"src"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@servicetitan/error-boundary": "23.
|
|
18
|
+
"@servicetitan/error-boundary": "23.4.0",
|
|
19
19
|
"lodash.get": "~4.4.2",
|
|
20
20
|
"mitt": "~3.0.1",
|
|
21
21
|
"semver": "~7.5.4"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@servicetitan/design-system": "~14.0.0",
|
|
25
|
-
"@servicetitan/log-service": "23.
|
|
26
|
-
"@servicetitan/react-ioc": "23.
|
|
25
|
+
"@servicetitan/log-service": "23.4.0",
|
|
26
|
+
"@servicetitan/react-ioc": "23.4.0",
|
|
27
27
|
"@testing-library/dom": "^9.0.0",
|
|
28
28
|
"@testing-library/jest-dom": "^6.4.2",
|
|
29
|
-
"@testing-library/react": "^14.2.
|
|
29
|
+
"@testing-library/react": "^14.2.2",
|
|
30
30
|
"@types/history": "~4.7.10",
|
|
31
31
|
"@types/lodash.get": "~4.4.6",
|
|
32
32
|
"@types/react": "~18.2.55",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@servicetitan/design-system": ">=12.6.2",
|
|
42
|
-
"@servicetitan/log-service": "23.
|
|
43
|
-
"@servicetitan/react-ioc": "23.
|
|
42
|
+
"@servicetitan/log-service": "23.4.0",
|
|
43
|
+
"@servicetitan/react-ioc": "23.4.0",
|
|
44
44
|
"history": "~4.10.1",
|
|
45
45
|
"react": ">=17.0.2",
|
|
46
46
|
"react-dom": ">=17.0.2"
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"cli": {
|
|
52
52
|
"webpack": false
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "94612136ff4d645bc38ae6b13fffad2ab0358666"
|
|
55
55
|
}
|
|
@@ -14,6 +14,7 @@ describe('[web-components] register', () => {
|
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
const subject = () => {
|
|
17
|
+
jest.spyOn(console, 'error').mockImplementation(jest.fn()); // suppress "ReactDOM.render deprecated" error
|
|
17
18
|
const Component: any = componentName;
|
|
18
19
|
return render(<Component />);
|
|
19
20
|
};
|
|
@@ -49,6 +49,8 @@ describe('[web-components] register', () => {
|
|
|
49
49
|
});
|
|
50
50
|
|
|
51
51
|
const subject = (props: Record<string, any> = {}, dataAttrs: Record<string, any> = {}) => {
|
|
52
|
+
jest.spyOn(console, 'error').mockImplementation(jest.fn()); // suppress "attempt to unmount root while rendering" error
|
|
53
|
+
|
|
52
54
|
const data = props && { 'data-mfe-data': JSON.stringify(props) };
|
|
53
55
|
const Component: any = componentName;
|
|
54
56
|
const renderResult = render(<Component ref={handleRef} {...data} {...dataAttrs} />);
|
package/src/loader.tsx
CHANGED
|
@@ -175,6 +175,6 @@ function lazyWebComponent(props: LazyLoaderProps) {
|
|
|
175
175
|
});
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
function getFallback(node: FallbackNode | undefined, message: string)
|
|
178
|
+
function getFallback(node: FallbackNode | undefined, message: string) {
|
|
179
179
|
return () => (node !== undefined ? (node as ReactElement) : <h2>{message}</h2>);
|
|
180
180
|
}
|
|
@@ -23,7 +23,7 @@ export function webComponent(props: WebComponentProps) {
|
|
|
23
23
|
props;
|
|
24
24
|
const { WebComponent, disposer, mfeSupportsRerendering } = bundleInfo;
|
|
25
25
|
|
|
26
|
-
return (props: LoaderDataProps)
|
|
26
|
+
return (props: LoaderDataProps) => {
|
|
27
27
|
const [isLoading, setIsLoading] = useState(true);
|
|
28
28
|
const [historyManager] = useOptionalDependencies(HistoryManager);
|
|
29
29
|
|