@servicetitan/web-components 22.19.0 → 22.21.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/contexts/index.d.ts +3 -0
- package/dist/contexts/index.d.ts.map +1 -0
- package/dist/contexts/index.js +4 -0
- package/dist/contexts/index.js.map +1 -0
- package/dist/contexts/mfe-data-context.d.ts.map +1 -0
- package/dist/contexts/mfe-data-context.js.map +1 -0
- package/dist/contexts/mfe-metadata-context.d.ts +8 -0
- package/dist/contexts/mfe-metadata-context.d.ts.map +1 -0
- package/dist/contexts/mfe-metadata-context.js +7 -0
- package/dist/contexts/mfe-metadata-context.js.map +1 -0
- package/dist/contexts/tests/mfe-data-context.test.d.ts +2 -0
- package/dist/contexts/tests/mfe-data-context.test.d.ts.map +1 -0
- package/dist/contexts/tests/mfe-data-context.test.js +24 -0
- package/dist/contexts/tests/mfe-data-context.test.js.map +1 -0
- package/dist/contexts/tests/mfe-metadata-context.test.d.ts +2 -0
- package/dist/contexts/tests/mfe-metadata-context.test.d.ts.map +1 -0
- package/dist/contexts/tests/mfe-metadata-context.test.js +26 -0
- package/dist/contexts/tests/mfe-metadata-context.test.js.map +1 -0
- package/dist/get-mfe-supports-rerendering.d.ts +3 -0
- package/dist/get-mfe-supports-rerendering.d.ts.map +1 -0
- package/dist/get-mfe-supports-rerendering.js +21 -0
- package/dist/get-mfe-supports-rerendering.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/loader.d.ts +11 -1
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +10 -16
- package/dist/loader.js.map +1 -1
- package/dist/register.d.ts.map +1 -1
- package/dist/register.js +7 -2
- package/dist/register.js.map +1 -1
- package/package.json +8 -8
- package/src/__tests__/get-mfe-supports-rerendering.test.ts +76 -0
- package/src/__tests__/loader.test.tsx +3 -10
- package/src/__tests__/register.test.tsx +27 -3
- package/src/contexts/index.ts +3 -0
- package/src/contexts/mfe-metadata-context.ts +14 -0
- package/src/contexts/tests/mfe-metadata-context.test.tsx +34 -0
- package/src/get-mfe-supports-rerendering.ts +29 -0
- package/src/index.ts +1 -2
- package/src/loader.tsx +29 -28
- package/src/register.tsx +10 -2
- package/dist/mfe-data-context.d.ts.map +0 -1
- package/dist/mfe-data-context.js.map +0 -1
- /package/dist/{mfe-data-context.d.ts → contexts/mfe-data-context.d.ts} +0 -0
- /package/dist/{mfe-data-context.js → contexts/mfe-data-context.js} +0 -0
- /package/src/{mfe-data-context.ts → contexts/mfe-data-context.ts} +0 -0
- /package/src/{__tests__ → contexts/tests}/mfe-data-context.test.tsx +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contexts/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contexts/index.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mfe-data-context.d.ts","sourceRoot":"","sources":["../../src/contexts/mfe-data-context.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAIH,aAAK,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;AAGlE,aAAK,IAAI,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,EAAE,GAAG,IAAI,CAAA;CAAE,CAAC;AAG7D,oBAAY,cAAc,CAAC,CAAC,IAAI;KAC3B,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,aAAa,GACpC,CAAC,CAAC,CAAC,CAAC,GACJ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GACxB,cAAc,CAAC,CAAC,CAAC,EAAE,GACnB,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GACjB,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACpB,KAAK;CACd,CAAC;AAEF,eAAO,MAAM,cAAc,+BAA0B,CAAC;AAEtD,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,cAAc,CAAC,CAAC,CAAC,OAI5D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mfe-data-context.js","sourceRoot":"","sources":["../../src/contexts/mfe-data-context.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAkBlD,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAO,EAAE,CAAC,CAAC;AAEtD,MAAM,UAAU,iBAAiB;IAC7B,MAAM,OAAO,GAAG,UAAU,CAAC,cAAc,CAAM,CAAC;IAEhD,OAAO,OAAO,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface MFEMetadata {
|
|
3
|
+
shadowRoot: ShadowRoot;
|
|
4
|
+
portalShadowRoot: ShadowRoot;
|
|
5
|
+
}
|
|
6
|
+
export declare const MFEMetadataContext: import("react").Context<MFEMetadata>;
|
|
7
|
+
export declare function useMFEMetadataContext(): MFEMetadata;
|
|
8
|
+
//# sourceMappingURL=mfe-metadata-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mfe-metadata-context.d.ts","sourceRoot":"","sources":["../../src/contexts/mfe-metadata-context.ts"],"names":[],"mappings":";AAEA,MAAM,WAAW,WAAW;IACxB,UAAU,EAAE,UAAU,CAAC;IACvB,gBAAgB,EAAE,UAAU,CAAC;CAChC;AAED,eAAO,MAAM,kBAAkB,sCAAgD,CAAC;AAEhF,wBAAgB,qBAAqB,gBAIpC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
export const MFEMetadataContext = createContext({});
|
|
3
|
+
export function useMFEMetadataContext() {
|
|
4
|
+
const context = useContext(MFEMetadataContext);
|
|
5
|
+
return context;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=mfe-metadata-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mfe-metadata-context.js","sourceRoot":"","sources":["../../src/contexts/mfe-metadata-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAOlD,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,CAAc,EAAiB,CAAC,CAAC;AAEhF,MAAM,UAAU,qBAAqB;IACjC,MAAM,OAAO,GAAG,UAAU,CAAC,kBAAkB,CAAC,CAAC;IAE/C,OAAO,OAAO,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mfe-data-context.test.d.ts","sourceRoot":"","sources":["../../../src/contexts/tests/mfe-data-context.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { renderHook } from '@testing-library/react-hooks';
|
|
3
|
+
import { MFEDataContext, useMFEDataContext } from '../mfe-data-context';
|
|
4
|
+
describe(`[web-components] ${useMFEDataContext.name}`, () => {
|
|
5
|
+
const subject = (wrapper) => renderHook(() => useMFEDataContext(), { wrapper });
|
|
6
|
+
describe('when the MFEDataContext is provided by a parent', () => {
|
|
7
|
+
const data = { foo: 'bar' };
|
|
8
|
+
const Wrapper = ({ children }) => {
|
|
9
|
+
return _jsx(MFEDataContext.Provider, Object.assign({ value: data }, { children: children }));
|
|
10
|
+
};
|
|
11
|
+
test('returns the context', () => {
|
|
12
|
+
expect(subject(Wrapper).result.current).toEqual(data);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
describe('when the MFEDataContext is not provided by a parent', () => {
|
|
16
|
+
const Wrapper = ({ children }) => {
|
|
17
|
+
return _jsx("div", { children: children });
|
|
18
|
+
};
|
|
19
|
+
test('returns an empty object', () => {
|
|
20
|
+
expect(subject(Wrapper).result.current).toEqual({});
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=mfe-data-context.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mfe-data-context.test.js","sourceRoot":"","sources":["../../../src/contexts/tests/mfe-data-context.test.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExE,QAAQ,CAAC,oBAAoB,iBAAiB,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE;IACxD,MAAM,OAAO,GAAG,CAAC,OAAY,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,iBAAiB,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAErF,QAAQ,CAAC,iDAAiD,EAAE,GAAG,EAAE;QAC7D,MAAM,IAAI,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;QAC5B,MAAM,OAAO,GAAO,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;YACjC,OAAO,KAAC,cAAc,CAAC,QAAQ,kBAAC,KAAK,EAAE,IAAI,gBAAG,QAAQ,IAA2B,CAAC;QACtF,CAAC,CAAC;QAEF,IAAI,CAAC,qBAAqB,EAAE,GAAG,EAAE;YAC7B,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,qDAAqD,EAAE,GAAG,EAAE;QACjE,MAAM,OAAO,GAAO,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;YACjC,OAAO,wBAAM,QAAQ,GAAO,CAAC;QACjC,CAAC,CAAC;QAEF,IAAI,CAAC,yBAAyB,EAAE,GAAG,EAAE;YACjC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mfe-metadata-context.test.d.ts","sourceRoot":"","sources":["../../../src/contexts/tests/mfe-metadata-context.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { renderHook } from '@testing-library/react-hooks';
|
|
3
|
+
import { MFEMetadataContext, useMFEMetadataContext } from '../mfe-metadata-context';
|
|
4
|
+
describe(`[web-components] ${useMFEMetadataContext.name}`, () => {
|
|
5
|
+
const subject = (wrapper) => renderHook(() => useMFEMetadataContext(), { wrapper });
|
|
6
|
+
describe('when the MFEMetadataContext is provided by a parent', () => {
|
|
7
|
+
const shadowRoot = document.createElement('div').attachShadow({ mode: 'open' });
|
|
8
|
+
const portalShadowRoot = document.createElement('span').attachShadow({ mode: 'open' });
|
|
9
|
+
const metadata = { shadowRoot, portalShadowRoot };
|
|
10
|
+
const Wrapper = ({ children }) => {
|
|
11
|
+
return (_jsx(MFEMetadataContext.Provider, Object.assign({ value: metadata }, { children: children })));
|
|
12
|
+
};
|
|
13
|
+
test('returns the context', () => {
|
|
14
|
+
expect(subject(Wrapper).result.current).toEqual(metadata);
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
describe('when the MFEMetadataContext is not provided by a parent', () => {
|
|
18
|
+
const Wrapper = ({ children }) => {
|
|
19
|
+
return _jsx("div", { children: children });
|
|
20
|
+
};
|
|
21
|
+
test('returns an empty object', () => {
|
|
22
|
+
expect(subject(Wrapper).result.current).toEqual({});
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=mfe-metadata-context.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mfe-metadata-context.test.js","sourceRoot":"","sources":["../../../src/contexts/tests/mfe-metadata-context.test.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEpF,QAAQ,CAAC,oBAAoB,qBAAqB,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE;IAC5D,MAAM,OAAO,GAAG,CAAC,OAAY,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,qBAAqB,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAEzF,QAAQ,CAAC,qDAAqD,EAAE,GAAG,EAAE;QACjE,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;QAChF,MAAM,gBAAgB,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;QACvF,MAAM,QAAQ,GAAG,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC;QAClD,MAAM,OAAO,GAAO,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;YACjC,OAAO,CACH,KAAC,kBAAkB,CAAC,QAAQ,kBAAC,KAAK,EAAE,QAAQ,gBACvC,QAAQ,IACiB,CACjC,CAAC;QACN,CAAC,CAAC;QAEF,IAAI,CAAC,qBAAqB,EAAE,GAAG,EAAE;YAC7B,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC9D,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,yDAAyD,EAAE,GAAG,EAAE;QACrE,MAAM,OAAO,GAAO,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;YACjC,OAAO,wBAAM,QAAQ,GAAO,CAAC;QACjC,CAAC,CAAC;QAEF,IAAI,CAAC,yBAAyB,EAAE,GAAG,EAAE;YACjC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-mfe-supports-rerendering.d.ts","sourceRoot":"","sources":["../src/get-mfe-supports-rerendering.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAYpC,wBAAgB,yBAAyB,CACrC,WAAW,EAAE,QAAQ,CAAC,aAAa,CAAC,EACpC,YAAY,EAAE,QAAQ,CAAC,cAAc,CAAC,WAOzC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import semver from 'semver';
|
|
2
|
+
/*
|
|
3
|
+
* Check if the MFE supports re-rendering itself when data changes
|
|
4
|
+
*
|
|
5
|
+
* `bundledWith.@servicetitan/web-components` is checked first, as that guarantees support
|
|
6
|
+
* `dependencies.@servicetitan/web-components` is checked second, in the case of the MFE's startup
|
|
7
|
+
* hasn't been updated to add web-components to bundledWith yet, and the MFE's web-component
|
|
8
|
+
* dependency is set in it's own package's package.json instead of the monorepo's root package.json
|
|
9
|
+
* `bundledWith.@servicetitan/startup` is checked third, with the hope that the startup version
|
|
10
|
+
* matches web-components
|
|
11
|
+
*/
|
|
12
|
+
export function getMFESupportsRerendering(bundledWith, dependencies) {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
return !!((_b = (_a = isSupportedVersion(bundledWith === null || bundledWith === void 0 ? void 0 : bundledWith['@servicetitan/web-components'])) !== null && _a !== void 0 ? _a : isSupportedVersion(dependencies === null || dependencies === void 0 ? void 0 : dependencies['@servicetitan/web-components'])) !== null && _b !== void 0 ? _b : isSupportedVersion(bundledWith === null || bundledWith === void 0 ? void 0 : bundledWith['@servicetitan/startup']));
|
|
15
|
+
}
|
|
16
|
+
function isSupportedVersion(version) {
|
|
17
|
+
if (version) {
|
|
18
|
+
return semver.gte(version, '22.12.0');
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=get-mfe-supports-rerendering.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-mfe-supports-rerendering.js","sourceRoot":"","sources":["../src/get-mfe-supports-rerendering.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAG5B;;;;;;;;;GASG;AACH,MAAM,UAAU,yBAAyB,CACrC,WAAoC,EACpC,YAAsC;;IAEtC,OAAO,CAAC,CAAC,CACL,MAAA,MAAA,kBAAkB,CAAC,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAG,8BAA8B,CAAC,CAAC,mCACjE,kBAAkB,CAAC,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAG,8BAA8B,CAAC,CAAC,mCAClE,kBAAkB,CAAC,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAG,uBAAuB,CAAC,CAAC,CAC7D,CAAC;AACN,CAAC;AAED,SAAS,kBAAkB,CAAC,OAAgB;IACxC,IAAI,OAAO,EAAE;QACT,OAAO,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;KACzC;AACL,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from './common';
|
|
2
2
|
export * from './event-bus';
|
|
3
3
|
export * from './history-manager';
|
|
4
|
-
export
|
|
4
|
+
export * from './contexts';
|
|
5
5
|
export * from './register';
|
|
6
6
|
export * from './loader';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
export * from './common';
|
|
2
2
|
export * from './event-bus';
|
|
3
3
|
export * from './history-manager';
|
|
4
|
-
|
|
5
|
-
export { useMFEDataContext } from './mfe-data-context';
|
|
4
|
+
export * from './contexts';
|
|
6
5
|
export * from './register';
|
|
7
6
|
export * from './loader';
|
|
8
7
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC"}
|
package/dist/loader.d.ts
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import { ReactElement, ReactNode, Ref } from 'react';
|
|
2
2
|
import { GetJsonError } from './common';
|
|
3
3
|
import { EventBus } from './event-bus';
|
|
4
|
-
import { MFEContextData } from './mfe-data-context';
|
|
4
|
+
import { MFEContextData } from './contexts/mfe-data-context';
|
|
5
|
+
export interface Metadata {
|
|
6
|
+
name: string;
|
|
7
|
+
bundledWith?: Record<string, string | undefined>;
|
|
8
|
+
sharedDependencies: Record<string, string>;
|
|
9
|
+
dependencies?: Record<string, string>;
|
|
10
|
+
entrypoints?: Record<string, {
|
|
11
|
+
css: string[];
|
|
12
|
+
js: string[];
|
|
13
|
+
}>;
|
|
14
|
+
}
|
|
5
15
|
export declare type LoaderRef = EventBus;
|
|
6
16
|
export interface LoaderProps<T> {
|
|
7
17
|
src: string;
|
package/dist/loader.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAQH,YAAY,EACZ,SAAS,EACT,GAAG,EACN,MAAM,OAAO,CAAC;AAUf,OAAO,EAKH,YAAY,EAEf,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,QAAQ,EAAgC,MAAM,aAAa,CAAC;AAIrE,OAAO,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAQH,YAAY,EACZ,SAAS,EACT,GAAG,EACN,MAAM,OAAO,CAAC;AAUf,OAAO,EAKH,YAAY,EAEf,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"}
|
package/dist/loader.js
CHANGED
|
@@ -19,6 +19,7 @@ import { EVENT_BUS_TOKEN, useEventBus } from './event-bus';
|
|
|
19
19
|
import { HistoryManager } from './history-manager';
|
|
20
20
|
import { EXPOSED_DEPENDENCIES } from './globals';
|
|
21
21
|
import { getVersionMismatches, isVersionedUrl } from './utils';
|
|
22
|
+
import { getMFESupportsRerendering } from './get-mfe-supports-rerendering';
|
|
22
23
|
function getEntrypoints(url, cache, signal) {
|
|
23
24
|
return __awaiter(this, void 0, void 0, function* () {
|
|
24
25
|
try {
|
|
@@ -74,8 +75,6 @@ function getBundleInfo(mainPackageUrl, fallbackPackageUrl, exposedDependencies =
|
|
|
74
75
|
const withBaseUrl = (path) => {
|
|
75
76
|
return `${exactPackageUrl}/dist/bundle/${bundleType}/${path}`;
|
|
76
77
|
};
|
|
77
|
-
// Check if the MFE's startup supports re-rendering the MFE component when data changes
|
|
78
|
-
const supportWatchForDataChanges = startupVersion && semver.gte(startupVersion, '22.12.0');
|
|
79
78
|
let entrypoints;
|
|
80
79
|
if ((_b = metadata.entrypoints) === null || _b === void 0 ? void 0 : _b[bundleType]) {
|
|
81
80
|
entrypoints = metadata.entrypoints[bundleType];
|
|
@@ -98,7 +97,7 @@ function getBundleInfo(mainPackageUrl, fallbackPackageUrl, exposedDependencies =
|
|
|
98
97
|
}
|
|
99
98
|
},
|
|
100
99
|
mismatch: hasMismatch ? mismatch : undefined,
|
|
101
|
-
|
|
100
|
+
mfeSupportsRerendering: getMFESupportsRerendering(metadata.bundledWith, dependencies),
|
|
102
101
|
};
|
|
103
102
|
});
|
|
104
103
|
}
|
|
@@ -130,7 +129,7 @@ export const Loader = forwardRef(({ src, fallbackSrc, data = {}, basename, loadi
|
|
|
130
129
|
}
|
|
131
130
|
throw e;
|
|
132
131
|
}
|
|
133
|
-
const { urls, WebComponent, disposer, mismatch,
|
|
132
|
+
const { urls, WebComponent, disposer, mismatch, mfeSupportsRerendering, } = bundleInfo;
|
|
134
133
|
if (mismatch) {
|
|
135
134
|
logService === null || logService === void 0 ? void 0 : logService.warning({
|
|
136
135
|
category: 'MicroFrontends.DependenciesMismatch',
|
|
@@ -185,8 +184,7 @@ export const Loader = forwardRef(({ src, fallbackSrc, data = {}, basename, loadi
|
|
|
185
184
|
});
|
|
186
185
|
};
|
|
187
186
|
return {
|
|
188
|
-
default: (props)
|
|
189
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
187
|
+
default: function LazyComponent(props) {
|
|
190
188
|
const stringifiedData = useMemo(() => JSON.stringify(props.data), [props.data]);
|
|
191
189
|
/*
|
|
192
190
|
* Set key for rendering the web component so that if the data from the Host change,
|
|
@@ -194,24 +192,20 @@ export const Loader = forwardRef(({ src, fallbackSrc, data = {}, basename, loadi
|
|
|
194
192
|
* the web component will be re-mounted whenever the data changes.
|
|
195
193
|
* This is only used as a fallback when the MFE's version is older.
|
|
196
194
|
*/
|
|
197
|
-
const key =
|
|
195
|
+
const key = mfeSupportsRerendering
|
|
198
196
|
? undefined
|
|
199
197
|
: stringifiedData;
|
|
200
198
|
/*
|
|
201
199
|
* Convert camelCase data props to kebab-case data attributes, prepended with data-
|
|
202
200
|
* Ex: fooBar -> data-foo-bar
|
|
203
201
|
*/
|
|
204
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
205
202
|
const dataAttrs = useMemo(() => {
|
|
206
203
|
var _a;
|
|
207
|
-
return
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
letter.toLowerCase()),
|
|
213
|
-
value,
|
|
214
|
-
]));
|
|
204
|
+
return Object.fromEntries(Object.entries((_a = props.data) !== null && _a !== void 0 ? _a : {}).map(([key, value]) => [
|
|
205
|
+
'data-' +
|
|
206
|
+
key.replace(/[A-Z]/g, letter => '-' + letter.toLowerCase()),
|
|
207
|
+
value,
|
|
208
|
+
]));
|
|
215
209
|
}, [props.data]);
|
|
216
210
|
return (_jsx(WebComponent, Object.assign({ ref: handleRef, class: props.className }, (urls.css.length
|
|
217
211
|
? {
|
package/dist/loader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EACH,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,OAAO,EACP,QAAQ,EACR,UAAU,EACV,mBAAmB,GAItB,MAAM,OAAO,CAAC;AAEf,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,GAAG,MAAM,YAAY,CAAC;AAE7B,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,EAEH,0BAA0B,EAC1B,cAAc,EACd,OAAO,GAGV,MAAM,UAAU,CAAC;AAClB,OAAO,EAAY,eAAe,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EACH,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,OAAO,EACP,QAAQ,EACR,UAAU,EACV,mBAAmB,GAItB,MAAM,OAAO,CAAC;AAEf,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,GAAG,MAAM,YAAY,CAAC;AAE7B,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;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,GAAG,EAAE,CAAC,GAAG,EAAE;QACP,IAAI,aAAa,KAAK,SAAS,EAAE;YAC7B,OAAO,aAA6B,CAAC;SACxC;QAED,OAAO,gDAA6B,CAAC;IACzC,CAAC,EACD,CAAC,aAAa,CAAC,CAClB,CAAC;IAEF,OAAO,CACH,MAAC,aAAa,kBAAC,UAAU,EAAE,GAAG,EAAE,QAAQ,EAAE,aAAa,iBAClD,SAAS,IAAI,KAAC,eAAe,KAAG,EACjC,KAAC,QAAQ,kBAAC,QAAQ,EAAE,IAAI,gBACpB,KAAC,MAAM,IAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,GAAI,IAC/C,KACC,CACnB,CAAC;AACN,CAAC,CACJ,CAAC"}
|
package/dist/register.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../src/register.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAM,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../src/register.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAM,aAAa,EAAE,MAAM,OAAO,CAAC;AAoC1C,wBAAgB,QAAQ,CAAC,SAAS,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,QAoMhE"}
|
package/dist/register.js
CHANGED
|
@@ -7,7 +7,8 @@ import { EXPOSED_DEPENDENCIES_TOKEN, BASENAME_TOKEN, IS_WEB_COMPONENT_TOKEN, REN
|
|
|
7
7
|
import { EVENT_BUS_TOKEN } from './event-bus';
|
|
8
8
|
import { HistoryManager } from './history-manager';
|
|
9
9
|
import { WEB_COMPONENT_NAME } from './globals';
|
|
10
|
-
import { MFEDataContext } from './mfe-data-context';
|
|
10
|
+
import { MFEDataContext } from './contexts/mfe-data-context';
|
|
11
|
+
import { MFEMetadataContext } from './contexts/mfe-metadata-context';
|
|
11
12
|
function createLink(url, onLoad) {
|
|
12
13
|
const element = document.createElement('link');
|
|
13
14
|
element.href = url;
|
|
@@ -143,6 +144,10 @@ export function register(Component, light) {
|
|
|
143
144
|
* and is instead passing data through separate data-attributes, so we want to
|
|
144
145
|
* spread all of those instead
|
|
145
146
|
*/ Object.assign({}, this.dataset);
|
|
147
|
+
const metadata = {
|
|
148
|
+
shadowRoot: this.root,
|
|
149
|
+
portalShadowRoot: this.portal,
|
|
150
|
+
};
|
|
146
151
|
render(_jsx(Provider, Object.assign({ singletons: [
|
|
147
152
|
{ provide: IS_WEB_COMPONENT_TOKEN, useValue: true },
|
|
148
153
|
{ provide: RENDER_ROOT_TOKEN, useValue: this.root },
|
|
@@ -155,7 +160,7 @@ export function register(Component, light) {
|
|
|
155
160
|
},
|
|
156
161
|
{ provide: EVENT_BUS_TOKEN, useValue: this.eventBus },
|
|
157
162
|
{ provide: BASENAME_TOKEN, useValue: this.basename },
|
|
158
|
-
].filter(({ useValue }) => useValue !== undefined) }, { children: _jsx(MFEDataContext.Provider, Object.assign({ value: Object.assign({}, mfeData) }, { children: _jsx(Component, Object.assign({}, mfeData)) })) })) })) })) })), this.root, this.onReady);
|
|
163
|
+
].filter(({ useValue }) => useValue !== undefined) }, { children: _jsx(MFEDataContext.Provider, Object.assign({ value: Object.assign({}, mfeData) }, { children: _jsx(MFEMetadataContext.Provider, Object.assign({ value: metadata }, { children: _jsx(Component, Object.assign({}, mfeData)) })) })) })) })) })) })), this.root, this.onReady);
|
|
159
164
|
}
|
|
160
165
|
}
|
|
161
166
|
});
|
package/dist/register.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.js","sourceRoot":"","sources":["../src/register.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAE3D,OAAO,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,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OAAO;aACV;YACD,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;gBACxC,OAAO,CAAC,MAAM,EAAE,CAAC;aACpB;YAED,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAClC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,MAAO,CAAC,IAAI,CAAC,CAAC;YAC7C,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;YACtB,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;YAExB,MAAA,IAAI,CAAC,SAAS,oDAAI,CAAC;QACvB,CAAC;QAED,0FAA0F;QAC1F,MAAM,KAAK,kBAAkB;YACzB,OAAO,CAAC,eAAe,CAAC,CAAC;QAC7B,CAAC;QAED,wBAAwB;YACpB,IAAI,CAAC,MAAM,EAAE,CAAC;QAClB,CAAC;KAoGJ;IAED,IAAI,CAAC,kBAAkB,EAAE;QACrB,sCAAsC;QACtC,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;QACtD,OAAO;KACV;IAED,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAC;AACnE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/web-components",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.21.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,17 +15,17 @@
|
|
|
15
15
|
"src"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@servicetitan/error-boundary": "22.
|
|
18
|
+
"@servicetitan/error-boundary": "22.21.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": "~12.6.2",
|
|
25
|
-
"@servicetitan/log-service": "22.
|
|
26
|
-
"@servicetitan/react-ioc": "22.
|
|
25
|
+
"@servicetitan/log-service": "22.21.0",
|
|
26
|
+
"@servicetitan/react-ioc": "22.21.0",
|
|
27
27
|
"@testing-library/dom": "^8.20.1",
|
|
28
|
-
"@testing-library/jest-dom": "^6.
|
|
28
|
+
"@testing-library/jest-dom": "^6.3.0",
|
|
29
29
|
"@testing-library/react": "^12.1.5",
|
|
30
30
|
"@testing-library/react-hooks": "^8.0.1",
|
|
31
31
|
"@types/history": "~4.7.10",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@servicetitan/design-system": "~12.6.2",
|
|
43
|
-
"@servicetitan/log-service": "22.
|
|
44
|
-
"@servicetitan/react-ioc": "22.
|
|
43
|
+
"@servicetitan/log-service": "22.21.0",
|
|
44
|
+
"@servicetitan/react-ioc": "22.21.0",
|
|
45
45
|
"history": "~4.10.1",
|
|
46
46
|
"react": "~17.0.2",
|
|
47
47
|
"react-dom": "~17.0.2"
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"cli": {
|
|
53
53
|
"webpack": false
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "729b7ca4eb38c323ac538a73573cadd54a4ff839"
|
|
56
56
|
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { getMFESupportsRerendering } from '../get-mfe-supports-rerendering';
|
|
2
|
+
import { Metadata } from '../loader';
|
|
3
|
+
|
|
4
|
+
describe(`[web-components] ${getMFESupportsRerendering.name}`, () => {
|
|
5
|
+
let metadata: Required<Pick<Metadata, 'bundledWith' | 'dependencies'>>;
|
|
6
|
+
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
metadata = {
|
|
9
|
+
bundledWith: {},
|
|
10
|
+
dependencies: {},
|
|
11
|
+
};
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
function itReturns(value: boolean) {
|
|
15
|
+
test(`returns ${value}`, () => {
|
|
16
|
+
expect(subject()).toBe(value);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function subject() {
|
|
21
|
+
return getMFESupportsRerendering(metadata.bundledWith, metadata.dependencies);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
itReturns(false);
|
|
25
|
+
|
|
26
|
+
const bundledWith: { name: string; version: string; expected: boolean }[] = [
|
|
27
|
+
{ name: 'startup', version: '22.11.0', expected: false },
|
|
28
|
+
{ name: 'startup', version: '22.12.0', expected: true },
|
|
29
|
+
{ name: 'web-components', version: '22.11.0', expected: false },
|
|
30
|
+
{ name: 'web-components', version: '22.12.0', expected: true },
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
describe.each(bundledWith)(
|
|
34
|
+
`when bundledWith $name version $version`,
|
|
35
|
+
({ name, version, expected }) => {
|
|
36
|
+
beforeEach(() => (metadata.bundledWith[`@servicetitan/${name}`] = version));
|
|
37
|
+
itReturns(expected);
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
const dependencies: { name: string; version: string; expected: boolean }[] = [
|
|
42
|
+
{ name: 'web-components', version: '22.11.0', expected: false },
|
|
43
|
+
{ name: 'web-components', version: '22.12.0', expected: true },
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
describe.each(dependencies)(
|
|
47
|
+
`when dependencies contains $name version $version`,
|
|
48
|
+
({ name, version, expected }) => {
|
|
49
|
+
beforeEach(() => (metadata.dependencies[`@servicetitan/${name}`] = version));
|
|
50
|
+
test(`returns ${expected}`, () => expect(subject()).toBe(expected));
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
describe('when bundledWith startup version 22.12.0 and dependencies contains web-components 22.11.0', () => {
|
|
55
|
+
beforeEach(() => {
|
|
56
|
+
metadata = {
|
|
57
|
+
bundledWith: { '@servicetitan/startup': '22.12.0' },
|
|
58
|
+
dependencies: { '@servicetitan/web-components': '22.11.0' },
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
itReturns(false);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
describe('when bundledWith startup version 22.12.0 and bundledWith web-components version is 22.11.0', () => {
|
|
65
|
+
beforeEach(() => {
|
|
66
|
+
metadata = {
|
|
67
|
+
bundledWith: {
|
|
68
|
+
'@servicetitan/startup': '22.12.0',
|
|
69
|
+
'@servicetitan/web-components': '22.11.0',
|
|
70
|
+
},
|
|
71
|
+
dependencies: {},
|
|
72
|
+
};
|
|
73
|
+
});
|
|
74
|
+
itReturns(false);
|
|
75
|
+
});
|
|
76
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Loader, LoaderProps } from '../loader';
|
|
1
|
+
import { Metadata, Loader, LoaderProps } from '../loader';
|
|
2
2
|
import { act, render, screen, waitFor } from '@testing-library/react';
|
|
3
3
|
import '@testing-library/jest-dom';
|
|
4
4
|
import { Entries, EXPOSED_DEPENDENCIES_TOKEN } from '../common';
|
|
@@ -34,13 +34,7 @@ describe('[web-components] Loader', () => {
|
|
|
34
34
|
let singletons: ProviderProps['singletons'];
|
|
35
35
|
let getJsonMockFns: Record<string, Function>;
|
|
36
36
|
|
|
37
|
-
let metadata:
|
|
38
|
-
name: string;
|
|
39
|
-
bundledWith?: Record<string, string | undefined>;
|
|
40
|
-
sharedDependencies?: Record<string, string>;
|
|
41
|
-
dependencies?: Record<string, string>;
|
|
42
|
-
entrypoints?: Record<string, { css: string[]; js: string[] }>;
|
|
43
|
-
};
|
|
37
|
+
let metadata: Metadata;
|
|
44
38
|
|
|
45
39
|
function setStartupVersion(version: string | undefined) {
|
|
46
40
|
if (!version) {
|
|
@@ -280,9 +274,8 @@ describe('[web-components] Loader', () => {
|
|
|
280
274
|
});
|
|
281
275
|
});
|
|
282
276
|
|
|
283
|
-
describe('when
|
|
277
|
+
describe('when data is passed in as a prop', () => {
|
|
284
278
|
beforeEach(() => {
|
|
285
|
-
setStartupVersion('22.11.0');
|
|
286
279
|
props.data = { fooBar: 'foobar' };
|
|
287
280
|
});
|
|
288
281
|
|
|
@@ -5,7 +5,7 @@ import { screen } from 'shadow-dom-testing-library';
|
|
|
5
5
|
import '@testing-library/jest-dom';
|
|
6
6
|
|
|
7
7
|
import { IWebComponent } from '../common';
|
|
8
|
-
import { useMFEDataContext } from '../
|
|
8
|
+
import { useMFEDataContext, useMFEMetadataContext } from '../contexts';
|
|
9
9
|
|
|
10
10
|
describe('[web-components] register', () => {
|
|
11
11
|
let onloadRefs: Function[];
|
|
@@ -16,17 +16,26 @@ describe('[web-components] register', () => {
|
|
|
16
16
|
onDispose: jest.fn(),
|
|
17
17
|
});
|
|
18
18
|
};
|
|
19
|
+
function stringifyValue(value: any) {
|
|
20
|
+
return JSON.stringify(value, (_key, value) =>
|
|
21
|
+
value instanceof ShadowRoot ? 'ShadowRoot' : value
|
|
22
|
+
);
|
|
23
|
+
}
|
|
19
24
|
const TestComponent: FC<Record<string, any>> = props => {
|
|
20
25
|
const data = useMFEDataContext();
|
|
26
|
+
const metadata = useMFEMetadataContext();
|
|
21
27
|
const popupProps = useContext(TablePopupPropsContext);
|
|
22
28
|
|
|
23
29
|
return (
|
|
24
30
|
<div>
|
|
25
31
|
{Object.entries(props).map(([name, value]) => (
|
|
26
|
-
<span key={name}>{`Prop: ${name}, Value: ${
|
|
32
|
+
<span key={name}>{`Prop: ${name}, Value: ${stringifyValue(value)}`}</span>
|
|
27
33
|
))}
|
|
28
34
|
{Object.entries(data).map(([name, value]) => (
|
|
29
|
-
<span key={name}>{`Data: ${name}, Value: ${
|
|
35
|
+
<span key={name}>{`Data: ${name}, Value: ${stringifyValue(value)}`}</span>
|
|
36
|
+
))}
|
|
37
|
+
{Object.entries(metadata).map(([name, value]) => (
|
|
38
|
+
<span key={name}>{`Metadata: ${name}, Value: ${stringifyValue(value)}`}</span>
|
|
30
39
|
))}
|
|
31
40
|
<span>TablePopupPropsContext appendTo: {String(popupProps({}).appendTo)}</span>
|
|
32
41
|
</div>
|
|
@@ -87,6 +96,21 @@ describe('[web-components] register', () => {
|
|
|
87
96
|
return renderResult;
|
|
88
97
|
};
|
|
89
98
|
|
|
99
|
+
test('useMFEMetadataContext exposes metadata', () => {
|
|
100
|
+
subject();
|
|
101
|
+
|
|
102
|
+
const metadata = {
|
|
103
|
+
shadowRoot: 'ShadowRoot',
|
|
104
|
+
portalShadowRoot: 'ShadowRoot',
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
Object.entries(metadata).forEach(([name, value]) =>
|
|
108
|
+
expect(
|
|
109
|
+
screen.getByShadowText(`Metadata: ${name}, Value: ${JSON.stringify(value)}`)
|
|
110
|
+
).toBeInTheDocument()
|
|
111
|
+
);
|
|
112
|
+
});
|
|
113
|
+
|
|
90
114
|
describe('when component has style urls', () => {
|
|
91
115
|
let styleUrls: string[];
|
|
92
116
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface MFEMetadata {
|
|
4
|
+
shadowRoot: ShadowRoot;
|
|
5
|
+
portalShadowRoot: ShadowRoot;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const MFEMetadataContext = createContext<MFEMetadata>({} as MFEMetadata);
|
|
9
|
+
|
|
10
|
+
export function useMFEMetadataContext() {
|
|
11
|
+
const context = useContext(MFEMetadataContext);
|
|
12
|
+
|
|
13
|
+
return context;
|
|
14
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { renderHook } from '@testing-library/react-hooks';
|
|
3
|
+
import { MFEMetadataContext, useMFEMetadataContext } from '../mfe-metadata-context';
|
|
4
|
+
|
|
5
|
+
describe(`[web-components] ${useMFEMetadataContext.name}`, () => {
|
|
6
|
+
const subject = (wrapper?: FC) => renderHook(() => useMFEMetadataContext(), { wrapper });
|
|
7
|
+
|
|
8
|
+
describe('when the MFEMetadataContext is provided by a parent', () => {
|
|
9
|
+
const shadowRoot = document.createElement('div').attachShadow({ mode: 'open' });
|
|
10
|
+
const portalShadowRoot = document.createElement('span').attachShadow({ mode: 'open' });
|
|
11
|
+
const metadata = { shadowRoot, portalShadowRoot };
|
|
12
|
+
const Wrapper: FC = ({ children }) => {
|
|
13
|
+
return (
|
|
14
|
+
<MFEMetadataContext.Provider value={metadata}>
|
|
15
|
+
{children}
|
|
16
|
+
</MFEMetadataContext.Provider>
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
test('returns the context', () => {
|
|
21
|
+
expect(subject(Wrapper).result.current).toEqual(metadata);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
describe('when the MFEMetadataContext is not provided by a parent', () => {
|
|
26
|
+
const Wrapper: FC = ({ children }) => {
|
|
27
|
+
return <div>{children}</div>;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
test('returns an empty object', () => {
|
|
31
|
+
expect(subject(Wrapper).result.current).toEqual({});
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import semver from 'semver';
|
|
2
|
+
import { Metadata } from './loader';
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
* Check if the MFE supports re-rendering itself when data changes
|
|
6
|
+
*
|
|
7
|
+
* `bundledWith.@servicetitan/web-components` is checked first, as that guarantees support
|
|
8
|
+
* `dependencies.@servicetitan/web-components` is checked second, in the case of the MFE's startup
|
|
9
|
+
* hasn't been updated to add web-components to bundledWith yet, and the MFE's web-component
|
|
10
|
+
* dependency is set in it's own package's package.json instead of the monorepo's root package.json
|
|
11
|
+
* `bundledWith.@servicetitan/startup` is checked third, with the hope that the startup version
|
|
12
|
+
* matches web-components
|
|
13
|
+
*/
|
|
14
|
+
export function getMFESupportsRerendering(
|
|
15
|
+
bundledWith: Metadata['bundledWith'],
|
|
16
|
+
dependencies: Metadata['dependencies']
|
|
17
|
+
) {
|
|
18
|
+
return !!(
|
|
19
|
+
isSupportedVersion(bundledWith?.['@servicetitan/web-components']) ??
|
|
20
|
+
isSupportedVersion(dependencies?.['@servicetitan/web-components']) ??
|
|
21
|
+
isSupportedVersion(bundledWith?.['@servicetitan/startup'])
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function isSupportedVersion(version?: string) {
|
|
26
|
+
if (version) {
|
|
27
|
+
return semver.gte(version, '22.12.0');
|
|
28
|
+
}
|
|
29
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from './common';
|
|
2
2
|
export * from './event-bus';
|
|
3
3
|
export * from './history-manager';
|
|
4
|
-
|
|
5
|
-
export { useMFEDataContext } from './mfe-data-context';
|
|
4
|
+
export * from './contexts';
|
|
6
5
|
export * from './register';
|
|
7
6
|
export * from './loader';
|
package/src/loader.tsx
CHANGED
|
@@ -31,7 +31,16 @@ import { EventBus, EVENT_BUS_TOKEN, useEventBus } from './event-bus';
|
|
|
31
31
|
import { HistoryManager } from './history-manager';
|
|
32
32
|
import { EXPOSED_DEPENDENCIES } from './globals';
|
|
33
33
|
import { getVersionMismatches, isVersionedUrl } from './utils';
|
|
34
|
-
import { MFEContextData } from './mfe-data-context';
|
|
34
|
+
import { MFEContextData } from './contexts/mfe-data-context';
|
|
35
|
+
import { getMFESupportsRerendering } from './get-mfe-supports-rerendering';
|
|
36
|
+
|
|
37
|
+
export interface Metadata {
|
|
38
|
+
name: string;
|
|
39
|
+
bundledWith?: Record<string, string | undefined>;
|
|
40
|
+
sharedDependencies: Record<string, string>;
|
|
41
|
+
dependencies?: Record<string, string>;
|
|
42
|
+
entrypoints?: Record<string, { css: string[]; js: string[] }>;
|
|
43
|
+
}
|
|
35
44
|
|
|
36
45
|
interface EntryPoints {
|
|
37
46
|
css: string[];
|
|
@@ -63,7 +72,7 @@ async function getBundleInfo(
|
|
|
63
72
|
retries?: number,
|
|
64
73
|
onRequestError?: (error: GetJsonError) => void
|
|
65
74
|
) {
|
|
66
|
-
const { data: metadata, url: packageUrl } = await getJson(
|
|
75
|
+
const { data: metadata, url: packageUrl } = await getJson<Metadata>(
|
|
67
76
|
`${mainPackageUrl}/dist/metadata.json`,
|
|
68
77
|
{
|
|
69
78
|
cache: isVersionedUrl(mainPackageUrl) ? undefined : 'no-store',
|
|
@@ -87,7 +96,7 @@ async function getBundleInfo(
|
|
|
87
96
|
const exactPackageUrl = packageUrl.replace('/dist/metadata.json', '');
|
|
88
97
|
const cache = isVersionedUrl(exactPackageUrl) ? undefined : 'no-store';
|
|
89
98
|
|
|
90
|
-
let dependencies
|
|
99
|
+
let dependencies: NonNullable<Metadata['dependencies']>;
|
|
91
100
|
|
|
92
101
|
if (metadata.dependencies) {
|
|
93
102
|
dependencies = metadata.dependencies;
|
|
@@ -116,9 +125,6 @@ async function getBundleInfo(
|
|
|
116
125
|
return `${exactPackageUrl}/dist/bundle/${bundleType}/${path}`;
|
|
117
126
|
};
|
|
118
127
|
|
|
119
|
-
// Check if the MFE's startup supports re-rendering the MFE component when data changes
|
|
120
|
-
const supportWatchForDataChanges = startupVersion && semver.gte(startupVersion, '22.12.0');
|
|
121
|
-
|
|
122
128
|
let entrypoints: EntryPoints;
|
|
123
129
|
|
|
124
130
|
if (metadata.entrypoints?.[bundleType]) {
|
|
@@ -142,7 +148,7 @@ async function getBundleInfo(
|
|
|
142
148
|
}
|
|
143
149
|
},
|
|
144
150
|
mismatch: hasMismatch ? mismatch : undefined,
|
|
145
|
-
|
|
151
|
+
mfeSupportsRerendering: getMFESupportsRerendering(metadata.bundledWith, dependencies),
|
|
146
152
|
};
|
|
147
153
|
}
|
|
148
154
|
|
|
@@ -237,7 +243,7 @@ export const Loader: <T>(props: LoaderProps<T> & { ref?: Ref<LoaderRef> }) => Re
|
|
|
237
243
|
WebComponent,
|
|
238
244
|
disposer,
|
|
239
245
|
mismatch,
|
|
240
|
-
|
|
246
|
+
mfeSupportsRerendering,
|
|
241
247
|
} = bundleInfo;
|
|
242
248
|
|
|
243
249
|
if (mismatch) {
|
|
@@ -304,8 +310,7 @@ export const Loader: <T>(props: LoaderProps<T> & { ref?: Ref<LoaderRef> }) => Re
|
|
|
304
310
|
};
|
|
305
311
|
|
|
306
312
|
return {
|
|
307
|
-
default: (props: DataProps)
|
|
308
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
313
|
+
default: function LazyComponent(props: DataProps) {
|
|
309
314
|
const stringifiedData = useMemo(
|
|
310
315
|
() => JSON.stringify(props.data),
|
|
311
316
|
[props.data]
|
|
@@ -317,7 +322,7 @@ export const Loader: <T>(props: LoaderProps<T> & { ref?: Ref<LoaderRef> }) => Re
|
|
|
317
322
|
* the web component will be re-mounted whenever the data changes.
|
|
318
323
|
* This is only used as a fallback when the MFE's version is older.
|
|
319
324
|
*/
|
|
320
|
-
const key =
|
|
325
|
+
const key = mfeSupportsRerendering
|
|
321
326
|
? undefined
|
|
322
327
|
: stringifiedData;
|
|
323
328
|
|
|
@@ -325,25 +330,21 @@ export const Loader: <T>(props: LoaderProps<T> & { ref?: Ref<LoaderRef> }) => Re
|
|
|
325
330
|
* Convert camelCase data props to kebab-case data attributes, prepended with data-
|
|
326
331
|
* Ex: fooBar -> data-foo-bar
|
|
327
332
|
*/
|
|
328
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
329
333
|
const dataAttrs = useMemo(
|
|
330
334
|
() =>
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
]
|
|
345
|
-
)
|
|
346
|
-
),
|
|
335
|
+
Object.fromEntries(
|
|
336
|
+
Object.entries(props.data ?? {}).map(
|
|
337
|
+
([key, value]) => [
|
|
338
|
+
'data-' +
|
|
339
|
+
key.replace(
|
|
340
|
+
/[A-Z]/g,
|
|
341
|
+
letter =>
|
|
342
|
+
'-' + letter.toLowerCase()
|
|
343
|
+
),
|
|
344
|
+
value,
|
|
345
|
+
]
|
|
346
|
+
)
|
|
347
|
+
),
|
|
347
348
|
[props.data]
|
|
348
349
|
);
|
|
349
350
|
|
package/src/register.tsx
CHANGED
|
@@ -17,7 +17,8 @@ import {
|
|
|
17
17
|
import { EventBus, EVENT_BUS_TOKEN } from './event-bus';
|
|
18
18
|
import { HistoryManager } from './history-manager';
|
|
19
19
|
import { WEB_COMPONENT_NAME } from './globals';
|
|
20
|
-
import { MFEDataContext } from './mfe-data-context';
|
|
20
|
+
import { MFEDataContext } from './contexts/mfe-data-context';
|
|
21
|
+
import { MFEMetadataContext } from './contexts/mfe-metadata-context';
|
|
21
22
|
|
|
22
23
|
function createLink(url: string, onLoad: () => void) {
|
|
23
24
|
const element = document.createElement('link');
|
|
@@ -173,6 +174,11 @@ export function register(Component: ComponentType, light: boolean) {
|
|
|
173
174
|
*/
|
|
174
175
|
{ ...this.dataset };
|
|
175
176
|
|
|
177
|
+
const metadata = {
|
|
178
|
+
shadowRoot: this.root,
|
|
179
|
+
portalShadowRoot: this.portal!,
|
|
180
|
+
};
|
|
181
|
+
|
|
176
182
|
render(
|
|
177
183
|
<Provider
|
|
178
184
|
singletons={[
|
|
@@ -202,7 +208,9 @@ export function register(Component: ComponentType, light: boolean) {
|
|
|
202
208
|
].filter(({ useValue }) => useValue !== undefined)}
|
|
203
209
|
>
|
|
204
210
|
<MFEDataContext.Provider value={{ ...mfeData }}>
|
|
205
|
-
<
|
|
211
|
+
<MFEMetadataContext.Provider value={metadata}>
|
|
212
|
+
<Component {...mfeData} />
|
|
213
|
+
</MFEMetadataContext.Provider>
|
|
206
214
|
</MFEDataContext.Provider>
|
|
207
215
|
</Provider>
|
|
208
216
|
</TablePopupPropsContext.Provider>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mfe-data-context.d.ts","sourceRoot":"","sources":["../src/mfe-data-context.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAIH,aAAK,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;AAGlE,aAAK,IAAI,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,EAAE,GAAG,IAAI,CAAA;CAAE,CAAC;AAG7D,oBAAY,cAAc,CAAC,CAAC,IAAI;KAC3B,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,aAAa,GACpC,CAAC,CAAC,CAAC,CAAC,GACJ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GACxB,cAAc,CAAC,CAAC,CAAC,EAAE,GACnB,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GACjB,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACpB,KAAK;CACd,CAAC;AAEF,eAAO,MAAM,cAAc,+BAA0B,CAAC;AAEtD,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,cAAc,CAAC,CAAC,CAAC,OAI5D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mfe-data-context.js","sourceRoot":"","sources":["../src/mfe-data-context.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAkBlD,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAO,EAAE,CAAC,CAAC;AAEtD,MAAM,UAAU,iBAAiB;IAC7B,MAAM,OAAO,GAAG,UAAU,CAAC,cAAc,CAAM,CAAC;IAEhD,OAAO,OAAO,CAAC;AACnB,CAAC"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|