@servicetitan/web-components 40.3.0 → 41.0.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/common.d.ts +22 -6
- package/dist/common.d.ts.map +1 -1
- package/dist/common.js +7 -2
- package/dist/common.js.map +1 -1
- package/dist/globals.d.ts +9 -7
- package/dist/globals.d.ts.map +1 -1
- package/dist/globals.js +17 -6
- package/dist/globals.js.map +1 -1
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +22 -23
- package/dist/loader.js.map +1 -1
- package/dist/register.d.ts.map +1 -1
- package/dist/register.js +28 -5
- package/dist/register.js.map +1 -1
- package/dist/use-host-shared-dependencies.d.ts +7 -0
- package/dist/use-host-shared-dependencies.d.ts.map +1 -0
- package/dist/use-host-shared-dependencies.js +17 -0
- package/dist/use-host-shared-dependencies.js.map +1 -0
- package/dist/use-prefetch.d.ts.map +1 -1
- package/dist/use-prefetch.js +7 -8
- package/dist/use-prefetch.js.map +1 -1
- package/dist/utils/get-bundle-info.d.ts +6 -5
- package/dist/utils/get-bundle-info.d.ts.map +1 -1
- package/dist/utils/get-bundle-info.js +3 -3
- package/dist/utils/get-bundle-info.js.map +1 -1
- package/dist/utils/get-mfe-has-compatible-launchdarkly-version.d.ts +6 -6
- package/dist/utils/get-mfe-has-compatible-launchdarkly-version.d.ts.map +1 -1
- package/dist/utils/get-mfe-has-compatible-launchdarkly-version.js +7 -7
- package/dist/utils/get-mfe-has-compatible-launchdarkly-version.js.map +1 -1
- package/dist/utils/validate-bundle-info.d.ts +5 -5
- package/dist/utils/validate-bundle-info.d.ts.map +1 -1
- package/dist/utils/validate-bundle-info.js +6 -5
- package/dist/utils/validate-bundle-info.js.map +1 -1
- package/dist/utils/web-component.d.ts +4 -4
- package/dist/utils/web-component.d.ts.map +1 -1
- package/dist/utils/web-component.js +14 -9
- package/dist/utils/web-component.js.map +1 -1
- package/package.json +11 -11
- package/src/common.ts +27 -6
- package/src/globals.ts +26 -8
- package/src/loader.tsx +27 -35
- package/src/register.tsx +34 -7
- package/src/use-host-shared-dependencies.ts +26 -0
- package/src/use-prefetch.ts +6 -12
- package/src/utils/get-bundle-info.ts +9 -8
- package/src/utils/get-mfe-has-compatible-launchdarkly-version.ts +7 -7
- package/src/utils/validate-bundle-info.ts +9 -8
- package/src/utils/web-component.tsx +19 -13
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/use-host-shared-dependencies.ts"],"sourcesContent":["import { useOptionalDependencies } from '@servicetitan/react-ioc';\nimport {\n EXPOSED_DEPENDENCIES_TOKEN,\n EXPOSED_INSTANCE_DEPENDENCIES_TOKEN,\n SHARED_DEPENDENCIES_TOKEN,\n SHARED_INSTANCE_DEPENDENCIES_TOKEN,\n} from './common';\nimport { SHARED_DEPENDENCIES, SHARED_INSTANCE_DEPENDENCIES } from './globals';\n\n/**\n * Resolves the host's shared dependencies from the DI container, falling back to the\n * deprecated EXPOSED_* tokens (still provided by consumers and older versions of\n * web-components) and then to the build-time globals.\n */\nexport function useHostSharedDependencies() {\n const [shared, deprecatedShared, instance, deprecatedInstance] = useOptionalDependencies(\n SHARED_DEPENDENCIES_TOKEN,\n EXPOSED_DEPENDENCIES_TOKEN,\n SHARED_INSTANCE_DEPENDENCIES_TOKEN,\n EXPOSED_INSTANCE_DEPENDENCIES_TOKEN\n );\n return [\n shared ?? deprecatedShared ?? SHARED_DEPENDENCIES,\n instance ?? deprecatedInstance ?? SHARED_INSTANCE_DEPENDENCIES,\n ] as const;\n}\n"],"names":["useOptionalDependencies","EXPOSED_DEPENDENCIES_TOKEN","EXPOSED_INSTANCE_DEPENDENCIES_TOKEN","SHARED_DEPENDENCIES_TOKEN","SHARED_INSTANCE_DEPENDENCIES_TOKEN","SHARED_DEPENDENCIES","SHARED_INSTANCE_DEPENDENCIES","useHostSharedDependencies","shared","instance","deprecatedShared","deprecatedInstance"],"mappings":"AAAA,SAASA,uBAAuB,QAAQ,0BAA0B;AAClE,SACIC,0BAA0B,EAC1BC,mCAAmC,EACnCC,yBAAyB,EACzBC,kCAAkC,QAC/B,WAAW;AAClB,SAASC,mBAAmB,EAAEC,4BAA4B,QAAQ,YAAY;AAE9E;;;;CAIC,GACD,OAAO,SAASC;QAQRC,MACAC;IARJ,MAAM,CAACD,QAAQE,kBAAkBD,UAAUE,mBAAmB,GAAGX,wBAC7DG,2BACAF,4BACAG,oCACAF;IAEJ,OAAO;SACHM,OAAAA,mBAAAA,oBAAAA,SAAUE,8BAAVF,kBAAAA,OAA8BH;SAC9BI,QAAAA,qBAAAA,sBAAAA,WAAYE,gCAAZF,mBAAAA,QAAkCH;KACrC;AACL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-prefetch.d.ts","sourceRoot":"","sources":["../src/use-prefetch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-prefetch.d.ts","sourceRoot":"","sources":["../src/use-prefetch.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAIvC;;;GAGG;AACH,wBAAgB,WAAW;oBAIP,MAAM,cAAkB,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;EAmC1E"}
|
package/dist/use-prefetch.js
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { Log } from '@servicetitan/log-service';
|
|
2
2
|
import { useOptionalDependencies } from '@servicetitan/react-ioc';
|
|
3
3
|
import { useCallback, useMemo } from 'react';
|
|
4
|
-
import {
|
|
5
|
-
import { EXPOSED_DEPENDENCIES, EXPOSED_INSTANCE_DEPENDENCIES } from './globals';
|
|
4
|
+
import { useHostSharedDependencies } from './use-host-shared-dependencies';
|
|
6
5
|
import { getBundleInfo, supportsPrefetch } from './utils';
|
|
7
6
|
/**
|
|
8
7
|
* Returns a stable `prefetch` function that prefetches and caches an MFE's bundle,
|
|
9
8
|
* so that Loader can load it faster later.
|
|
10
9
|
*/ export function usePrefetch() {
|
|
11
|
-
const [logService
|
|
12
|
-
const [
|
|
10
|
+
const [logService] = useOptionalDependencies(Log);
|
|
11
|
+
const [hostSharedDependencies, sharedInstanceDependencies] = useHostSharedDependencies();
|
|
13
12
|
const prefetch = useCallback(async (src, { cache = -1 } = {})=>{
|
|
14
13
|
try {
|
|
15
14
|
const bundleInfo = await getBundleInfo({
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
hostSharedDependencies,
|
|
16
|
+
sharedInstanceDependencies,
|
|
18
17
|
mainPackageUrl: src,
|
|
19
18
|
cache,
|
|
20
19
|
retries: 0
|
|
@@ -51,8 +50,8 @@ import { getBundleInfo, supportsPrefetch } from './utils';
|
|
|
51
50
|
}
|
|
52
51
|
}, [
|
|
53
52
|
logService,
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
hostSharedDependencies,
|
|
54
|
+
sharedInstanceDependencies
|
|
56
55
|
]);
|
|
57
56
|
return useMemo(()=>({
|
|
58
57
|
prefetch
|
package/dist/use-prefetch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/use-prefetch.ts"],"sourcesContent":["import { Log } from '@servicetitan/log-service';\nimport { useOptionalDependencies } from '@servicetitan/react-ioc';\nimport { useCallback, useMemo } from 'react';\nimport {
|
|
1
|
+
{"version":3,"sources":["../src/use-prefetch.ts"],"sourcesContent":["import { Log } from '@servicetitan/log-service';\nimport { useOptionalDependencies } from '@servicetitan/react-ioc';\nimport { useCallback, useMemo } from 'react';\nimport { LoaderProps } from './loader';\nimport { useHostSharedDependencies } from './use-host-shared-dependencies';\nimport { getBundleInfo, supportsPrefetch } from './utils';\n\n/**\n * Returns a stable `prefetch` function that prefetches and caches an MFE's bundle,\n * so that Loader can load it faster later.\n */\nexport function usePrefetch() {\n const [logService] = useOptionalDependencies(Log);\n const [hostSharedDependencies, sharedInstanceDependencies] = useHostSharedDependencies();\n const prefetch = useCallback(\n async (src: string, { cache = -1 }: Pick<LoaderProps<any>, 'cache'> = {}) => {\n try {\n const bundleInfo = await getBundleInfo({\n hostSharedDependencies,\n sharedInstanceDependencies,\n mainPackageUrl: src,\n cache,\n retries: 0,\n });\n\n if (bundleInfo.cacheHit) {\n return;\n }\n\n const { css, js } = bundleInfo.urls;\n if (supportsPrefetch()) {\n addLinks([\n ...css.map(href => ({ href, as: 'style' })),\n ...js.map(href => ({ href, as: 'script' })),\n ]);\n } else {\n await Promise.all([...css, ...js].map(url => fetch(url, { priority: 'low' })));\n }\n } catch (e: any) {\n logService?.warning({\n category: 'Microfrontends.Prefetch',\n message: `Failed to prefetch ${src}`,\n data: e,\n });\n }\n },\n [logService, hostSharedDependencies, sharedInstanceDependencies]\n );\n\n return useMemo(() => ({ prefetch }), [prefetch]);\n}\n\ninterface Link {\n as: string;\n href: string;\n}\n\nfunction addLinks(links: Link[]) {\n const existingLinks = document.head.getElementsByTagName('link');\n const existingHrefs = new Set(Array.from(existingLinks).map(({ href }) => href));\n\n links.forEach(({ as, href }) => {\n if (!existingHrefs.has(href)) {\n const link = document.createElement('link');\n link.as = as;\n link.crossOrigin = 'anonymous';\n link.href = href;\n link.rel = 'prefetch';\n document.head.append(link);\n }\n });\n}\n"],"names":["Log","useOptionalDependencies","useCallback","useMemo","useHostSharedDependencies","getBundleInfo","supportsPrefetch","usePrefetch","logService","hostSharedDependencies","sharedInstanceDependencies","prefetch","src","cache","bundleInfo","mainPackageUrl","retries","cacheHit","css","js","urls","addLinks","map","href","as","Promise","all","url","fetch","priority","e","warning","category","message","data","links","existingLinks","document","head","getElementsByTagName","existingHrefs","Set","Array","from","forEach","has","link","createElement","crossOrigin","rel","append"],"mappings":"AAAA,SAASA,GAAG,QAAQ,4BAA4B;AAChD,SAASC,uBAAuB,QAAQ,0BAA0B;AAClE,SAASC,WAAW,EAAEC,OAAO,QAAQ,QAAQ;AAE7C,SAASC,yBAAyB,QAAQ,iCAAiC;AAC3E,SAASC,aAAa,EAAEC,gBAAgB,QAAQ,UAAU;AAE1D;;;CAGC,GACD,OAAO,SAASC;IACZ,MAAM,CAACC,WAAW,GAAGP,wBAAwBD;IAC7C,MAAM,CAACS,wBAAwBC,2BAA2B,GAAGN;IAC7D,MAAMO,WAAWT,YACb,OAAOU,KAAa,EAAEC,QAAQ,CAAC,CAAC,EAAmC,GAAG,CAAC,CAAC;QACpE,IAAI;YACA,MAAMC,aAAa,MAAMT,cAAc;gBACnCI;gBACAC;gBACAK,gBAAgBH;gBAChBC;gBACAG,SAAS;YACb;YAEA,IAAIF,WAAWG,QAAQ,EAAE;gBACrB;YACJ;YAEA,MAAM,EAAEC,GAAG,EAAEC,EAAE,EAAE,GAAGL,WAAWM,IAAI;YACnC,IAAId,oBAAoB;gBACpBe,SAAS;uBACFH,IAAII,GAAG,CAACC,CAAAA,OAAS,CAAA;4BAAEA;4BAAMC,IAAI;wBAAQ,CAAA;uBACrCL,GAAGG,GAAG,CAACC,CAAAA,OAAS,CAAA;4BAAEA;4BAAMC,IAAI;wBAAS,CAAA;iBAC3C;YACL,OAAO;gBACH,MAAMC,QAAQC,GAAG,CAAC;uBAAIR;uBAAQC;iBAAG,CAACG,GAAG,CAACK,CAAAA,MAAOC,MAAMD,KAAK;wBAAEE,UAAU;oBAAM;YAC9E;QACJ,EAAE,OAAOC,GAAQ;YACbtB,uBAAAA,iCAAAA,WAAYuB,OAAO,CAAC;gBAChBC,UAAU;gBACVC,SAAS,CAAC,mBAAmB,EAAErB,KAAK;gBACpCsB,MAAMJ;YACV;QACJ;IACJ,GACA;QAACtB;QAAYC;QAAwBC;KAA2B;IAGpE,OAAOP,QAAQ,IAAO,CAAA;YAAEQ;QAAS,CAAA,GAAI;QAACA;KAAS;AACnD;AAOA,SAASU,SAASc,KAAa;IAC3B,MAAMC,gBAAgBC,SAASC,IAAI,CAACC,oBAAoB,CAAC;IACzD,MAAMC,gBAAgB,IAAIC,IAAIC,MAAMC,IAAI,CAACP,eAAed,GAAG,CAAC,CAAC,EAAEC,IAAI,EAAE,GAAKA;IAE1EY,MAAMS,OAAO,CAAC,CAAC,EAAEpB,EAAE,EAAED,IAAI,EAAE;QACvB,IAAI,CAACiB,cAAcK,GAAG,CAACtB,OAAO;YAC1B,MAAMuB,OAAOT,SAASU,aAAa,CAAC;YACpCD,KAAKtB,EAAE,GAAGA;YACVsB,KAAKE,WAAW,GAAG;YACnBF,KAAKvB,IAAI,GAAGA;YACZuB,KAAKG,GAAG,GAAG;YACXZ,SAASC,IAAI,CAACY,MAAM,CAACJ;QACzB;IACJ;AACJ"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { SharedDependencies } from '@servicetitan/startup-utils';
|
|
2
|
+
import { GetJsonError, SharedInstanceDependencies } from '../common';
|
|
3
3
|
import { EntryPoints } from './get-entry-points';
|
|
4
4
|
export type BundleInfo = Awaited<ReturnType<typeof getBundleInfo>>;
|
|
5
5
|
interface GetBundleInfoProps {
|
|
6
6
|
cache: boolean | number;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
/** The host's shared dependencies and their versions. */
|
|
8
|
+
hostSharedDependencies?: SharedDependencies;
|
|
9
|
+
sharedInstanceDependencies?: SharedInstanceDependencies;
|
|
9
10
|
fallbackPackageUrl?: string;
|
|
10
11
|
isHeadless?: boolean;
|
|
11
12
|
mainPackageUrl: string;
|
|
12
13
|
onRequestError?: (error: GetJsonError) => void;
|
|
13
14
|
retries?: number;
|
|
14
15
|
}
|
|
15
|
-
export declare function getBundleInfo({ cache, mainPackageUrl, fallbackPackageUrl,
|
|
16
|
+
export declare function getBundleInfo({ cache, mainPackageUrl, fallbackPackageUrl, hostSharedDependencies, sharedInstanceDependencies, isHeadless, retries, onRequestError, }: GetBundleInfoProps): Promise<{
|
|
16
17
|
bundledWith: Record<string, string | undefined> | undefined;
|
|
17
18
|
cacheHit: boolean | undefined;
|
|
18
19
|
mfeSupportsRerendering: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-bundle-info.d.ts","sourceRoot":"","sources":["../../src/utils/get-bundle-info.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"get-bundle-info.d.ts","sourceRoot":"","sources":["../../src/utils/get-bundle-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEvF,OAAO,EAAW,YAAY,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAK9E,OAAO,EAAE,WAAW,EAAkB,MAAM,oBAAoB,CAAC;AAMjE,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC;AAEnE,UAAU,kBAAkB;IACxB,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;IACxB,yDAAyD;IACzD,sBAAsB,CAAC,EAAE,kBAAkB,CAAC;IAC5C,0BAA0B,CAAC,EAAE,0BAA0B,CAAC;IACxD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,aAAa,CAAC,EAChC,KAAK,EACL,cAAc,EACd,kBAAkB,EAClB,sBAA2B,EAC3B,0BAA+B,EAC/B,UAAU,EACV,OAAO,EACP,cAAc,GACjB,EAAE,kBAAkB;;;;;;;;;;;;;;;;;GAoFpB"}
|
|
@@ -9,7 +9,7 @@ import { getMFEHasCompatibleLaunchDarklyVersion } from './get-mfe-has-compatible
|
|
|
9
9
|
import { getMFEHasUniqueChunkNamespace } from './get-mfe-has-unique-chunk-namespace';
|
|
10
10
|
import { getMFESupportsRerendering } from './get-mfe-supports-rerendering';
|
|
11
11
|
import { getMFESupportsVersionedLDClient } from './get-mfe-supports-versioned-ld-client';
|
|
12
|
-
export async function getBundleInfo({ cache, mainPackageUrl, fallbackPackageUrl,
|
|
12
|
+
export async function getBundleInfo({ cache, mainPackageUrl, fallbackPackageUrl, hostSharedDependencies = {}, sharedInstanceDependencies = {}, isHeadless, retries, onRequestError }) {
|
|
13
13
|
var _metadata_entrypoints;
|
|
14
14
|
const { cacheHit, data: metadata, url: packageUrl } = await getCachedMetadata({
|
|
15
15
|
cache,
|
|
@@ -36,7 +36,7 @@ export async function getBundleInfo({ cache, mainPackageUrl, fallbackPackageUrl,
|
|
|
36
36
|
if (isHeadless) {
|
|
37
37
|
resolvedBundleType = 'headless';
|
|
38
38
|
} else {
|
|
39
|
-
mismatch = getVersionMismatches(
|
|
39
|
+
mismatch = getVersionMismatches(hostSharedDependencies, dependencies, sharedDependencies);
|
|
40
40
|
const startupVersion = bundledWith === null || bundledWith === void 0 ? void 0 : bundledWith['@servicetitan/startup'];
|
|
41
41
|
const supportLightBundles = !!startupVersion && semver.gte(startupVersion, '17.0.0');
|
|
42
42
|
const embed = !mismatch && supportLightBundles;
|
|
@@ -66,7 +66,7 @@ export async function getBundleInfo({ cache, mainPackageUrl, fallbackPackageUrl,
|
|
|
66
66
|
cacheHit,
|
|
67
67
|
mfeSupportsRerendering: getMFESupportsRerendering(bundledWith, dependencies),
|
|
68
68
|
mfeHasUniqueChunkNamespace: getMFEHasUniqueChunkNamespace(bundledWith),
|
|
69
|
-
mfeHasCompatibleLaunchDarklyVersion: getMFEHasCompatibleLaunchDarklyVersion(bundledWith,
|
|
69
|
+
mfeHasCompatibleLaunchDarklyVersion: getMFEHasCompatibleLaunchDarklyVersion(bundledWith, sharedInstanceDependencies),
|
|
70
70
|
mfeSupportsVersionedLDClient: getMFESupportsVersionedLDClient(bundledWith),
|
|
71
71
|
mfeMaybeUsesKendoGrid: getMFEMaybeUsesKendoGrid(dependencies),
|
|
72
72
|
mismatch,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/get-bundle-info.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../src/utils/get-bundle-info.ts"],"sourcesContent":["import { getVersionMismatches, SharedDependencies } from '@servicetitan/startup-utils';\nimport semver from 'semver';\nimport { getJson, GetJsonError, SharedInstanceDependencies } from '../common';\nimport { getMFEMaybeUsesKendoGrid } from '../patches/kendo-scrollbar-width';\nimport type { Metadata } from '../types';\nimport { getCacheSetting } from './get-cache-setting';\nimport { getCachedMetadata } from './get-cached-metadata';\nimport { EntryPoints, getEntrypoints } from './get-entry-points';\nimport { getMFEHasCompatibleLaunchDarklyVersion } from './get-mfe-has-compatible-launchdarkly-version';\nimport { getMFEHasUniqueChunkNamespace } from './get-mfe-has-unique-chunk-namespace';\nimport { getMFESupportsRerendering } from './get-mfe-supports-rerendering';\nimport { getMFESupportsVersionedLDClient } from './get-mfe-supports-versioned-ld-client';\n\nexport type BundleInfo = Awaited<ReturnType<typeof getBundleInfo>>;\n\ninterface GetBundleInfoProps {\n cache: boolean | number;\n /** The host's shared dependencies and their versions. */\n hostSharedDependencies?: SharedDependencies;\n sharedInstanceDependencies?: SharedInstanceDependencies;\n fallbackPackageUrl?: string;\n isHeadless?: boolean;\n mainPackageUrl: string;\n onRequestError?: (error: GetJsonError) => void;\n retries?: number;\n}\n\nexport async function getBundleInfo({\n cache,\n mainPackageUrl,\n fallbackPackageUrl,\n hostSharedDependencies = {},\n sharedInstanceDependencies = {},\n isHeadless,\n retries,\n onRequestError,\n}: GetBundleInfoProps) {\n const {\n cacheHit,\n data: metadata,\n url: packageUrl,\n } = await getCachedMetadata({\n cache,\n fallbackPackageUrl,\n mainPackageUrl,\n onRequestError,\n retries,\n });\n\n const { bundledWith, name, sharedDependencies } = metadata;\n const exactPackageUrl = packageUrl.replace('/dist/metadata.json', '');\n const requestCache = getCacheSetting(exactPackageUrl);\n\n let dependencies: NonNullable<Metadata['dependencies']>;\n if (metadata.dependencies) {\n dependencies = metadata.dependencies;\n } else {\n const { data: packageJson } = await getJson(`${exactPackageUrl}/package.json`, {\n cache: requestCache,\n retries,\n });\n\n dependencies = packageJson.dependencies;\n }\n\n let mismatch: ReturnType<typeof getVersionMismatches>;\n let resolvedBundleType: 'headless' | 'light' | 'full';\n\n if (isHeadless) {\n resolvedBundleType = 'headless';\n } else {\n mismatch = getVersionMismatches(hostSharedDependencies, dependencies, sharedDependencies);\n const startupVersion = bundledWith?.['@servicetitan/startup'];\n const supportLightBundles = !!startupVersion && semver.gte(startupVersion, '17.0.0');\n const embed = !mismatch && supportLightBundles;\n resolvedBundleType = embed ? 'light' : 'full';\n }\n\n const bundleBaseUrl = `${exactPackageUrl}/dist/bundle/${resolvedBundleType}`;\n\n let entrypoints: EntryPoints;\n if (metadata.entrypoints?.[resolvedBundleType]) {\n entrypoints = metadata.entrypoints[resolvedBundleType];\n } else {\n entrypoints = await getEntrypoints(`${bundleBaseUrl}/entrypoints.json`, requestCache);\n }\n\n let baseUrl = bundleBaseUrl;\n // Per-MFE dev-server port only happens during local development\n if (process.env.NODE_ENV !== 'production' && entrypoints.port) {\n const url = new URL(baseUrl);\n url.port = String(entrypoints.port);\n baseUrl = url.toString();\n }\n\n const urls: EntryPoints = {\n css: entrypoints.css.map(path => `${baseUrl}/${path}`),\n js: entrypoints.js.map(path => `${baseUrl}/${path}`),\n };\n\n const elementName = resolvedBundleType === 'headless' ? `headless-${name}` : name;\n\n return {\n bundledWith,\n cacheHit,\n mfeSupportsRerendering: getMFESupportsRerendering(bundledWith, dependencies),\n mfeHasUniqueChunkNamespace: getMFEHasUniqueChunkNamespace(bundledWith),\n mfeHasCompatibleLaunchDarklyVersion: getMFEHasCompatibleLaunchDarklyVersion(\n bundledWith,\n sharedInstanceDependencies\n ),\n mfeSupportsVersionedLDClient: getMFESupportsVersionedLDClient(bundledWith),\n mfeMaybeUsesKendoGrid: getMFEMaybeUsesKendoGrid(dependencies),\n mismatch,\n resolvedBundleType,\n urls,\n WebComponent: elementName,\n version: metadata.version,\n module: entrypoints.module,\n };\n}\n"],"names":["getVersionMismatches","semver","getJson","getMFEMaybeUsesKendoGrid","getCacheSetting","getCachedMetadata","getEntrypoints","getMFEHasCompatibleLaunchDarklyVersion","getMFEHasUniqueChunkNamespace","getMFESupportsRerendering","getMFESupportsVersionedLDClient","getBundleInfo","cache","mainPackageUrl","fallbackPackageUrl","hostSharedDependencies","sharedInstanceDependencies","isHeadless","retries","onRequestError","metadata","cacheHit","data","url","packageUrl","bundledWith","name","sharedDependencies","exactPackageUrl","replace","requestCache","dependencies","packageJson","mismatch","resolvedBundleType","startupVersion","supportLightBundles","gte","embed","bundleBaseUrl","entrypoints","baseUrl","process","env","NODE_ENV","port","URL","String","toString","urls","css","map","path","js","elementName","mfeSupportsRerendering","mfeHasUniqueChunkNamespace","mfeHasCompatibleLaunchDarklyVersion","mfeSupportsVersionedLDClient","mfeMaybeUsesKendoGrid","WebComponent","version","module"],"mappings":"AAAA,SAASA,oBAAoB,QAA4B,8BAA8B;AACvF,OAAOC,YAAY,SAAS;AAC5B,SAASC,OAAO,QAAkD,YAAY;AAC9E,SAASC,wBAAwB,QAAQ,mCAAmC;AAE5E,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SAAsBC,cAAc,QAAQ,qBAAqB;AACjE,SAASC,sCAAsC,QAAQ,gDAAgD;AACvG,SAASC,6BAA6B,QAAQ,uCAAuC;AACrF,SAASC,yBAAyB,QAAQ,iCAAiC;AAC3E,SAASC,+BAA+B,QAAQ,yCAAyC;AAgBzF,OAAO,eAAeC,cAAc,EAChCC,KAAK,EACLC,cAAc,EACdC,kBAAkB,EAClBC,yBAAyB,CAAC,CAAC,EAC3BC,6BAA6B,CAAC,CAAC,EAC/BC,UAAU,EACVC,OAAO,EACPC,cAAc,EACG;QA6CbC;IA5CJ,MAAM,EACFC,QAAQ,EACRC,MAAMF,QAAQ,EACdG,KAAKC,UAAU,EAClB,GAAG,MAAMnB,kBAAkB;QACxBO;QACAE;QACAD;QACAM;QACAD;IACJ;IAEA,MAAM,EAAEO,WAAW,EAAEC,IAAI,EAAEC,kBAAkB,EAAE,GAAGP;IAClD,MAAMQ,kBAAkBJ,WAAWK,OAAO,CAAC,uBAAuB;IAClE,MAAMC,eAAe1B,gBAAgBwB;IAErC,IAAIG;IACJ,IAAIX,SAASW,YAAY,EAAE;QACvBA,eAAeX,SAASW,YAAY;IACxC,OAAO;QACH,MAAM,EAAET,MAAMU,WAAW,EAAE,GAAG,MAAM9B,QAAQ,GAAG0B,gBAAgB,aAAa,CAAC,EAAE;YAC3EhB,OAAOkB;YACPZ;QACJ;QAEAa,eAAeC,YAAYD,YAAY;IAC3C;IAEA,IAAIE;IACJ,IAAIC;IAEJ,IAAIjB,YAAY;QACZiB,qBAAqB;IACzB,OAAO;QACHD,WAAWjC,qBAAqBe,wBAAwBgB,cAAcJ;QACtE,MAAMQ,iBAAiBV,wBAAAA,kCAAAA,WAAa,CAAC,wBAAwB;QAC7D,MAAMW,sBAAsB,CAAC,CAACD,kBAAkBlC,OAAOoC,GAAG,CAACF,gBAAgB;QAC3E,MAAMG,QAAQ,CAACL,YAAYG;QAC3BF,qBAAqBI,QAAQ,UAAU;IAC3C;IAEA,MAAMC,gBAAgB,GAAGX,gBAAgB,aAAa,EAAEM,oBAAoB;IAE5E,IAAIM;IACJ,KAAIpB,wBAAAA,SAASoB,WAAW,cAApBpB,4CAAAA,qBAAsB,CAACc,mBAAmB,EAAE;QAC5CM,cAAcpB,SAASoB,WAAW,CAACN,mBAAmB;IAC1D,OAAO;QACHM,cAAc,MAAMlC,eAAe,GAAGiC,cAAc,iBAAiB,CAAC,EAAET;IAC5E;IAEA,IAAIW,UAAUF;IACd,gEAAgE;IAChE,IAAIG,QAAQC,GAAG,CAACC,QAAQ,KAAK,gBAAgBJ,YAAYK,IAAI,EAAE;QAC3D,MAAMtB,MAAM,IAAIuB,IAAIL;QACpBlB,IAAIsB,IAAI,GAAGE,OAAOP,YAAYK,IAAI;QAClCJ,UAAUlB,IAAIyB,QAAQ;IAC1B;IAEA,MAAMC,OAAoB;QACtBC,KAAKV,YAAYU,GAAG,CAACC,GAAG,CAACC,CAAAA,OAAQ,GAAGX,QAAQ,CAAC,EAAEW,MAAM;QACrDC,IAAIb,YAAYa,EAAE,CAACF,GAAG,CAACC,CAAAA,OAAQ,GAAGX,QAAQ,CAAC,EAAEW,MAAM;IACvD;IAEA,MAAME,cAAcpB,uBAAuB,aAAa,CAAC,SAAS,EAAER,MAAM,GAAGA;IAE7E,OAAO;QACHD;QACAJ;QACAkC,wBAAwB9C,0BAA0BgB,aAAaM;QAC/DyB,4BAA4BhD,8BAA8BiB;QAC1DgC,qCAAqClD,uCACjCkB,aACAT;QAEJ0C,8BAA8BhD,gCAAgCe;QAC9DkC,uBAAuBxD,yBAAyB4B;QAChDE;QACAC;QACAe;QACAW,cAAcN;QACdO,SAASzC,SAASyC,OAAO;QACzBC,QAAQtB,YAAYsB,MAAM;IAC9B;AACJ"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SharedInstanceDependencies } from '../common';
|
|
2
2
|
import type { Metadata } from '../types';
|
|
3
3
|
/**
|
|
4
|
-
* @param bundledWith
|
|
5
|
-
* @param
|
|
4
|
+
* @param bundledWith The MFE's metadata.bundledWith.
|
|
5
|
+
* @param sharedInstanceDependencies The host's SHARED_INSTANCE_DEPENDENCIES, if any.
|
|
6
6
|
* @returns Returns true when host and MFE use compatible version of LaunchDarkly
|
|
7
|
-
* and returns false when host and
|
|
8
|
-
* Returns undefined when either the host or MFE doesn't
|
|
7
|
+
* and returns false when host and MFE use incompatible version.
|
|
8
|
+
* Returns undefined when either the host or MFE doesn't share LaunchDarkly.
|
|
9
9
|
*/
|
|
10
|
-
export declare function getMFEHasCompatibleLaunchDarklyVersion(bundledWith: Metadata['bundledWith'],
|
|
10
|
+
export declare function getMFEHasCompatibleLaunchDarklyVersion(bundledWith: Metadata['bundledWith'], sharedInstanceDependencies: SharedInstanceDependencies): boolean | undefined;
|
|
11
11
|
//# sourceMappingURL=get-mfe-has-compatible-launchdarkly-version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-mfe-has-compatible-launchdarkly-version.d.ts","sourceRoot":"","sources":["../../src/utils/get-mfe-has-compatible-launchdarkly-version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"get-mfe-has-compatible-launchdarkly-version.d.ts","sourceRoot":"","sources":["../../src/utils/get-mfe-has-compatible-launchdarkly-version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC;;;;;;GAMG;AACH,wBAAgB,sCAAsC,CAClD,WAAW,EAAE,QAAQ,CAAC,aAAa,CAAC,EACpC,0BAA0B,EAAE,0BAA0B,uBAOzD"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @param bundledWith
|
|
3
|
-
* @param
|
|
2
|
+
* @param bundledWith The MFE's metadata.bundledWith.
|
|
3
|
+
* @param sharedInstanceDependencies The host's SHARED_INSTANCE_DEPENDENCIES, if any.
|
|
4
4
|
* @returns Returns true when host and MFE use compatible version of LaunchDarkly
|
|
5
|
-
* and returns false when host and
|
|
6
|
-
* Returns undefined when either the host or MFE doesn't
|
|
7
|
-
*/ export function getMFEHasCompatibleLaunchDarklyVersion(bundledWith,
|
|
8
|
-
var
|
|
5
|
+
* and returns false when host and MFE use incompatible version.
|
|
6
|
+
* Returns undefined when either the host or MFE doesn't share LaunchDarkly.
|
|
7
|
+
*/ export function getMFEHasCompatibleLaunchDarklyVersion(bundledWith, sharedInstanceDependencies) {
|
|
8
|
+
var _sharedInstanceDependencies_launchDarkly;
|
|
9
9
|
const mfeVersion = bundledWith === null || bundledWith === void 0 ? void 0 : bundledWith['launchdarkly-js-client-sdk'];
|
|
10
|
-
const hostVersion = (
|
|
10
|
+
const hostVersion = (_sharedInstanceDependencies_launchDarkly = sharedInstanceDependencies.launchDarkly) === null || _sharedInstanceDependencies_launchDarkly === void 0 ? void 0 : _sharedInstanceDependencies_launchDarkly.version;
|
|
11
11
|
if (hostVersion && mfeVersion) {
|
|
12
12
|
return hostVersion === mfeVersion;
|
|
13
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/get-mfe-has-compatible-launchdarkly-version.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../src/utils/get-mfe-has-compatible-launchdarkly-version.ts"],"sourcesContent":["import { SharedInstanceDependencies } from '../common';\nimport type { Metadata } from '../types';\n\n/**\n * @param bundledWith The MFE's metadata.bundledWith.\n * @param sharedInstanceDependencies The host's SHARED_INSTANCE_DEPENDENCIES, if any.\n * @returns Returns true when host and MFE use compatible version of LaunchDarkly\n * and returns false when host and MFE use incompatible version.\n * Returns undefined when either the host or MFE doesn't share LaunchDarkly.\n */\nexport function getMFEHasCompatibleLaunchDarklyVersion(\n bundledWith: Metadata['bundledWith'],\n sharedInstanceDependencies: SharedInstanceDependencies\n) {\n const mfeVersion = bundledWith?.['launchdarkly-js-client-sdk'];\n const hostVersion = sharedInstanceDependencies.launchDarkly?.version;\n if (hostVersion && mfeVersion) {\n return hostVersion === mfeVersion;\n }\n}\n"],"names":["getMFEHasCompatibleLaunchDarklyVersion","bundledWith","sharedInstanceDependencies","mfeVersion","hostVersion","launchDarkly","version"],"mappings":"AAGA;;;;;;CAMC,GACD,OAAO,SAASA,uCACZC,WAAoC,EACpCC,0BAAsD;QAGlCA;IADpB,MAAMC,aAAaF,wBAAAA,kCAAAA,WAAa,CAAC,6BAA6B;IAC9D,MAAMG,eAAcF,2CAAAA,2BAA2BG,YAAY,cAAvCH,+DAAAA,yCAAyCI,OAAO;IACpE,IAAIF,eAAeD,YAAY;QAC3B,OAAOC,gBAAgBD;IAC3B;AACJ"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Log } from '@servicetitan/log-service';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { SharedDependencies } from '@servicetitan/startup-utils';
|
|
3
|
+
import { SharedInstanceDependencies } from '../common';
|
|
4
4
|
import { BundleInfo } from './get-bundle-info';
|
|
5
5
|
interface Context {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
hostSharedDependencies?: SharedDependencies;
|
|
7
|
+
sharedInstanceDependencies?: SharedInstanceDependencies;
|
|
8
8
|
logService?: Log;
|
|
9
9
|
packageUrl: string;
|
|
10
10
|
}
|
|
11
|
-
export declare function validateBundleInfo({ mismatch, mfeHasCompatibleLaunchDarklyVersion }: BundleInfo, {
|
|
11
|
+
export declare function validateBundleInfo({ mismatch, mfeHasCompatibleLaunchDarklyVersion }: BundleInfo, { hostSharedDependencies, sharedInstanceDependencies, logService, packageUrl }: Context): void;
|
|
12
12
|
export {};
|
|
13
13
|
//# sourceMappingURL=validate-bundle-info.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-bundle-info.d.ts","sourceRoot":"","sources":["../../src/utils/validate-bundle-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAC;AAChD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"validate-bundle-info.d.ts","sourceRoot":"","sources":["../../src/utils/validate-bundle-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,UAAU,OAAO;IACb,sBAAsB,CAAC,EAAE,kBAAkB,CAAC;IAC5C,0BAA0B,CAAC,EAAE,0BAA0B,CAAC;IACxD,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACtB;AACD,wBAAgB,kBAAkB,CAC9B,EAAE,QAAQ,EAAE,mCAAmC,EAAE,EAAE,UAAU,EAC7D,EAAE,sBAA2B,EAAE,0BAA0B,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,OAAO,QAyC/F"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function validateBundleInfo({ mismatch, mfeHasCompatibleLaunchDarklyVersion }, {
|
|
1
|
+
export function validateBundleInfo({ mismatch, mfeHasCompatibleLaunchDarklyVersion }, { hostSharedDependencies = {}, sharedInstanceDependencies, logService, packageUrl }) {
|
|
2
2
|
if (!logService) {
|
|
3
3
|
return;
|
|
4
4
|
}
|
|
@@ -7,10 +7,11 @@ export function validateBundleInfo({ mismatch, mfeHasCompatibleLaunchDarklyVersi
|
|
|
7
7
|
package: packageUrl,
|
|
8
8
|
dependencies: JSON.stringify(mismatch)
|
|
9
9
|
};
|
|
10
|
-
if (Object.keys(
|
|
10
|
+
if (Object.keys(hostSharedDependencies).length === 0) {
|
|
11
11
|
logService.warning({
|
|
12
|
+
// Legacy category name kept so existing log monitors keep matching
|
|
12
13
|
category: 'MicroFrontends.NoExposedDependencies',
|
|
13
|
-
message: 'Cannot use light bundle because the host is not
|
|
14
|
+
message: 'Cannot use light bundle because the host is not providing shared dependencies or the list of shared dependencies is empty.',
|
|
14
15
|
data
|
|
15
16
|
});
|
|
16
17
|
} else {
|
|
@@ -26,10 +27,10 @@ export function validateBundleInfo({ mismatch, mfeHasCompatibleLaunchDarklyVersi
|
|
|
26
27
|
* or the MFE isn't using LaunchDarkly at all.
|
|
27
28
|
*/ if (mfeHasCompatibleLaunchDarklyVersion === false) {
|
|
28
29
|
var _ref;
|
|
29
|
-
var
|
|
30
|
+
var _sharedInstanceDependencies_launchDarkly;
|
|
30
31
|
const data = {
|
|
31
32
|
package: packageUrl,
|
|
32
|
-
hostVersion: (_ref =
|
|
33
|
+
hostVersion: (_ref = sharedInstanceDependencies === null || sharedInstanceDependencies === void 0 ? void 0 : (_sharedInstanceDependencies_launchDarkly = sharedInstanceDependencies.launchDarkly) === null || _sharedInstanceDependencies_launchDarkly === void 0 ? void 0 : _sharedInstanceDependencies_launchDarkly.version) !== null && _ref !== void 0 ? _ref : ''
|
|
33
34
|
};
|
|
34
35
|
logService.warning({
|
|
35
36
|
category: 'MicroFrontends.LaunchDarklyMismatch',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/validate-bundle-info.ts"],"sourcesContent":["import { Log } from '@servicetitan/log-service';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/utils/validate-bundle-info.ts"],"sourcesContent":["import { Log } from '@servicetitan/log-service';\nimport { SharedDependencies } from '@servicetitan/startup-utils';\nimport { SharedInstanceDependencies } from '../common';\nimport { BundleInfo } from './get-bundle-info';\n\ninterface Context {\n hostSharedDependencies?: SharedDependencies;\n sharedInstanceDependencies?: SharedInstanceDependencies;\n logService?: Log;\n packageUrl: string;\n}\nexport function validateBundleInfo(\n { mismatch, mfeHasCompatibleLaunchDarklyVersion }: BundleInfo,\n { hostSharedDependencies = {}, sharedInstanceDependencies, logService, packageUrl }: Context\n) {\n if (!logService) {\n return;\n }\n\n if (mismatch) {\n const data = { package: packageUrl, dependencies: JSON.stringify(mismatch) };\n if (Object.keys(hostSharedDependencies).length === 0) {\n logService.warning({\n // Legacy category name kept so existing log monitors keep matching\n category: 'MicroFrontends.NoExposedDependencies',\n message:\n 'Cannot use light bundle because the host is not providing shared dependencies or the list of shared dependencies is empty.',\n data,\n });\n } else {\n logService.warning({\n category: 'MicroFrontends.DependenciesMismatch',\n message: 'Some of the package dependencies have incompatible versions.',\n data,\n });\n }\n }\n\n /**\n * Note, only checking false here because the value is undefined when the host\n * or the MFE isn't using LaunchDarkly at all.\n */\n\n if (mfeHasCompatibleLaunchDarklyVersion === false) {\n const data = {\n package: packageUrl,\n hostVersion: sharedInstanceDependencies?.launchDarkly?.version ?? '',\n };\n logService.warning({\n category: 'MicroFrontends.LaunchDarklyMismatch',\n message: 'LaunchDarkly versions are incompatible',\n data,\n });\n }\n}\n"],"names":["validateBundleInfo","mismatch","mfeHasCompatibleLaunchDarklyVersion","hostSharedDependencies","sharedInstanceDependencies","logService","packageUrl","data","package","dependencies","JSON","stringify","Object","keys","length","warning","category","message","hostVersion","launchDarkly","version"],"mappings":"AAWA,OAAO,SAASA,mBACZ,EAAEC,QAAQ,EAAEC,mCAAmC,EAAc,EAC7D,EAAEC,yBAAyB,CAAC,CAAC,EAAEC,0BAA0B,EAAEC,UAAU,EAAEC,UAAU,EAAW;IAE5F,IAAI,CAACD,YAAY;QACb;IACJ;IAEA,IAAIJ,UAAU;QACV,MAAMM,OAAO;YAAEC,SAASF;YAAYG,cAAcC,KAAKC,SAAS,CAACV;QAAU;QAC3E,IAAIW,OAAOC,IAAI,CAACV,wBAAwBW,MAAM,KAAK,GAAG;YAClDT,WAAWU,OAAO,CAAC;gBACf,mEAAmE;gBACnEC,UAAU;gBACVC,SACI;gBACJV;YACJ;QACJ,OAAO;YACHF,WAAWU,OAAO,CAAC;gBACfC,UAAU;gBACVC,SAAS;gBACTV;YACJ;QACJ;IACJ;IAEA;;;KAGC,GAED,IAAIL,wCAAwC,OAAO;;YAG9BE;QAFjB,MAAMG,OAAO;YACTC,SAASF;YACTY,WAAW,UAAEd,uCAAAA,kDAAAA,2CAAAA,2BAA4Be,YAAY,cAAxCf,+DAAAA,yCAA0CgB,OAAO,uCAAI;QACtE;QACAf,WAAWU,OAAO,CAAC;YACfC,UAAU;YACVC,SAAS;YACTV;QACJ;IACJ;AACJ"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type LDService } from '@servicetitan/launchdarkly-service';
|
|
2
2
|
import { Log } from '@servicetitan/log-service';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { SharedDependencies } from '@servicetitan/startup-utils';
|
|
4
|
+
import { SharedInstanceDependencies } from '../common';
|
|
5
5
|
import { EventBus } from '../event-bus';
|
|
6
6
|
import { LoaderDataProps } from '../loader';
|
|
7
7
|
import { BundleInfo } from './get-bundle-info';
|
|
@@ -9,8 +9,8 @@ interface WebComponentProps {
|
|
|
9
9
|
basename?: string;
|
|
10
10
|
bundleInfo: BundleInfo;
|
|
11
11
|
eventBus: EventBus;
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
hostSharedDependencies?: SharedDependencies;
|
|
13
|
+
sharedInstanceDependencies?: SharedInstanceDependencies;
|
|
14
14
|
ldService?: LDService;
|
|
15
15
|
logService?: Log;
|
|
16
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-component.d.ts","sourceRoot":"","sources":["../../src/utils/web-component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAC;AAEhD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"web-component.d.ts","sourceRoot":"","sources":["../../src/utils/web-component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAC;AAEhD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEjE,OAAO,EAAiB,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAEtE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/C,UAAU,iBAAiB;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,UAAU,CAAC;IACvB,QAAQ,EAAE,QAAQ,CAAC;IACnB,sBAAsB,CAAC,EAAE,kBAAkB,CAAC;IAC5C,0BAA0B,CAAC,EAAE,0BAA0B,CAAC;IACxD,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,UAAU,CAAC,EAAE,GAAG,CAAC;CACpB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,IAgBzC,oCAAoC,eAAe,6CA0E9D"}
|
|
@@ -6,10 +6,10 @@ import { setKendoScrollbarWidth } from '../patches/kendo-scrollbar-width';
|
|
|
6
6
|
import { getElementName } from './get-element-name';
|
|
7
7
|
export function webComponent(props) {
|
|
8
8
|
var _bundleInfo_bundledWith;
|
|
9
|
-
const { basename, bundleInfo, eventBus,
|
|
9
|
+
const { basename, bundleInfo, eventBus, hostSharedDependencies, ldService, logService } = props;
|
|
10
10
|
const { WebComponent, resolvedBundleType, mfeSupportsRerendering, mfeMaybeUsesKendoGrid, version } = bundleInfo;
|
|
11
11
|
const elementName = getElementName(bundleInfo);
|
|
12
|
-
const
|
|
12
|
+
const sharedInstanceDependencies = ensureLDVersion(props.sharedInstanceDependencies, (_bundleInfo_bundledWith = bundleInfo.bundledWith) === null || _bundleInfo_bundledWith === void 0 ? void 0 : _bundleInfo_bundledWith['launchdarkly-js-client-sdk']);
|
|
13
13
|
return ({ LoadingFallback, ...innerProps })=>{
|
|
14
14
|
const [isLoading, setIsLoading] = useState(true);
|
|
15
15
|
const [historyManager] = useOptionalDependencies(HistoryManager);
|
|
@@ -20,8 +20,13 @@ export function webComponent(props) {
|
|
|
20
20
|
ldService,
|
|
21
21
|
logService,
|
|
22
22
|
historyManager,
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
sharedDependencies: hostSharedDependencies,
|
|
24
|
+
sharedInstanceDependencies,
|
|
25
|
+
/*
|
|
26
|
+
* Continue to pass the deprecated names for backwards compatibility,
|
|
27
|
+
* in case the Host has updated web-components, but the MFE has not
|
|
28
|
+
*/ exposedDependencies: hostSharedDependencies,
|
|
29
|
+
exposedInstanceDependencies: sharedInstanceDependencies,
|
|
25
30
|
eventBus,
|
|
26
31
|
basename,
|
|
27
32
|
onReady: ()=>{
|
|
@@ -84,17 +89,17 @@ export function webComponent(props) {
|
|
|
84
89
|
value
|
|
85
90
|
]));
|
|
86
91
|
}
|
|
87
|
-
function ensureLDVersion(
|
|
88
|
-
var
|
|
89
|
-
if (version && !((
|
|
92
|
+
function ensureLDVersion(sharedInstanceDependencies = {}, version) {
|
|
93
|
+
var _sharedInstanceDependencies_launchDarkly;
|
|
94
|
+
if (version && !((_sharedInstanceDependencies_launchDarkly = sharedInstanceDependencies.launchDarkly) === null || _sharedInstanceDependencies_launchDarkly === void 0 ? void 0 : _sharedInstanceDependencies_launchDarkly.ldService)) {
|
|
90
95
|
return {
|
|
91
|
-
...
|
|
96
|
+
...sharedInstanceDependencies,
|
|
92
97
|
launchDarkly: {
|
|
93
98
|
version
|
|
94
99
|
}
|
|
95
100
|
};
|
|
96
101
|
}
|
|
97
|
-
return
|
|
102
|
+
return sharedInstanceDependencies;
|
|
98
103
|
}
|
|
99
104
|
function getStyleUrls({ urls }) {
|
|
100
105
|
if (urls.css.length) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/web-component.tsx"],"sourcesContent":["import { type LDService } from '@servicetitan/launchdarkly-service';\nimport { Log } from '@servicetitan/log-service';\nimport { useOptionalDependencies } from '@servicetitan/react-ioc';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/utils/web-component.tsx"],"sourcesContent":["import { type LDService } from '@servicetitan/launchdarkly-service';\nimport { Log } from '@servicetitan/log-service';\nimport { useOptionalDependencies } from '@servicetitan/react-ioc';\nimport { SharedDependencies } from '@servicetitan/startup-utils';\nimport { Fragment, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport { IWebComponent, SharedInstanceDependencies } from '../common';\nimport { MFEContextData } from '../contexts/mfe-data-context';\nimport { EventBus } from '../event-bus';\nimport { HistoryManager } from '../history-manager';\nimport { LoaderDataProps } from '../loader';\nimport { setKendoScrollbarWidth } from '../patches/kendo-scrollbar-width';\nimport { BundleInfo } from './get-bundle-info';\nimport { getElementName } from './get-element-name';\n\ninterface WebComponentProps {\n basename?: string;\n bundleInfo: BundleInfo;\n eventBus: EventBus;\n hostSharedDependencies?: SharedDependencies;\n sharedInstanceDependencies?: SharedInstanceDependencies;\n ldService?: LDService;\n logService?: Log;\n}\n\nexport function webComponent(props: WebComponentProps) {\n const { basename, bundleInfo, eventBus, hostSharedDependencies, ldService, logService } = props;\n const {\n WebComponent,\n resolvedBundleType,\n mfeSupportsRerendering,\n mfeMaybeUsesKendoGrid,\n version,\n } = bundleInfo;\n const elementName = getElementName(bundleInfo);\n\n const sharedInstanceDependencies = ensureLDVersion(\n props.sharedInstanceDependencies,\n bundleInfo.bundledWith?.['launchdarkly-js-client-sdk']\n );\n\n return ({ LoadingFallback, ...innerProps }: LoaderDataProps) => {\n const [isLoading, setIsLoading] = useState(true);\n const [historyManager] = useOptionalDependencies(HistoryManager);\n const elementRef = useRef<(IWebComponent & HTMLElement) | null>(null);\n\n const handleRef = (webComponent: (IWebComponent & HTMLElement) | null) => {\n elementRef.current = webComponent;\n webComponent?.provide({\n ldService,\n logService,\n historyManager,\n sharedDependencies: hostSharedDependencies,\n sharedInstanceDependencies,\n /*\n * Continue to pass the deprecated names for backwards compatibility,\n * in case the Host has updated web-components, but the MFE has not\n */\n exposedDependencies: hostSharedDependencies,\n exposedInstanceDependencies: sharedInstanceDependencies,\n eventBus,\n basename,\n onReady: () => {\n setIsLoading(false);\n },\n });\n };\n\n // Stringify data object so that it can be passed as a data-attribute\n const stringifiedData = useMemo(() => JSON.stringify(innerProps.data), [innerProps.data]);\n\n /*\n * Set key for rendering the web component so that if the data from the Host change,\n * and the MFE's version of startup doesn't support watching for data changes, then\n * the web component will be re-mounted whenever the data changes.\n * This is only used as a fallback when the MFE's version is older.\n */\n const key = mfeSupportsRerendering ? undefined : stringifiedData;\n\n // Measure after the element is visible, since a hidden element has no scrollbar.\n useLayoutEffect(() => {\n if (mfeMaybeUsesKendoGrid && !isLoading && elementRef.current) {\n setKendoScrollbarWidth(elementRef.current, elementName);\n }\n }, [isLoading]);\n\n const dataAttrs = useMemo(() => composeDataAttributes(innerProps.data), [innerProps.data]);\n const styleUrls = getStyleUrls(bundleInfo);\n\n return (\n <Fragment>\n {isLoading && <LoadingFallback />}\n <WebComponent\n key={key}\n ref={handleRef}\n class={innerProps.className}\n {...(styleUrls && { 'style-urls': styleUrls })}\n /*\n * Continue to spread data as separate data attributes for backwards compatibility,\n * in case the Host has updated web-components, but the MFE has not\n */\n {...dataAttrs}\n data-mfe-data={stringifiedData}\n data-mfe-name={elementName}\n {...(version && { 'data-mfe-version': version })}\n // @ts-expect-error style exists on HTMLElement\n style={\n isLoading || resolvedBundleType === 'headless'\n ? { display: 'none' }\n : undefined\n }\n />\n </Fragment>\n );\n };\n}\n\n/*\n * Convert camelCase data props to kebab-case data attributes, prepended with data-\n * Ex: fooBar -> data-foo-bar\n */\nfunction composeDataAttributes(data: MFEContextData<{}> | undefined = {}) {\n return Object.fromEntries(\n Object.entries(data).map(([key, value]) => [\n 'data-' + key.replace(/[A-Z]/g, letter => '-' + letter.toLowerCase()),\n value,\n ])\n );\n}\n\nfunction ensureLDVersion(\n sharedInstanceDependencies: SharedInstanceDependencies = {},\n version?: string\n) {\n if (version && !sharedInstanceDependencies.launchDarkly?.ldService) {\n return { ...sharedInstanceDependencies, launchDarkly: { version } };\n }\n return sharedInstanceDependencies;\n}\n\nfunction getStyleUrls({ urls }: Pick<BundleInfo, 'urls'>) {\n if (urls.css.length) {\n return encodeURIComponent(JSON.stringify(urls.css));\n }\n}\n"],"names":["useOptionalDependencies","Fragment","useLayoutEffect","useMemo","useRef","useState","HistoryManager","setKendoScrollbarWidth","getElementName","webComponent","props","bundleInfo","basename","eventBus","hostSharedDependencies","ldService","logService","WebComponent","resolvedBundleType","mfeSupportsRerendering","mfeMaybeUsesKendoGrid","version","elementName","sharedInstanceDependencies","ensureLDVersion","bundledWith","LoadingFallback","innerProps","isLoading","setIsLoading","historyManager","elementRef","handleRef","current","provide","sharedDependencies","exposedDependencies","exposedInstanceDependencies","onReady","stringifiedData","JSON","stringify","data","key","undefined","dataAttrs","composeDataAttributes","styleUrls","getStyleUrls","ref","class","className","data-mfe-data","data-mfe-name","style","display","Object","fromEntries","entries","map","value","replace","letter","toLowerCase","launchDarkly","urls","css","length","encodeURIComponent"],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/web-components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "41.0.0",
|
|
4
4
|
"description": "Framework to build, register, and load Microfrontends into host applications",
|
|
5
5
|
"homepage": "https://docs.st.dev/docs/frontend/uikit/web-components",
|
|
6
6
|
"repository": {
|
|
@@ -35,19 +35,19 @@
|
|
|
35
35
|
"!**/*.test.*"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@servicetitan/error-boundary": "
|
|
39
|
-
"@servicetitan/startup-utils": "
|
|
38
|
+
"@servicetitan/error-boundary": "41.0.0",
|
|
39
|
+
"@servicetitan/startup-utils": "41.0.0",
|
|
40
40
|
"mitt": "~3.0.1",
|
|
41
41
|
"semver": "^7.8.6"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@servicetitan/anvil2": "^3.
|
|
44
|
+
"@servicetitan/anvil2": "^3.21.0",
|
|
45
45
|
"@servicetitan/design-system": "~14.5.12",
|
|
46
|
-
"@servicetitan/launchdarkly-service": "
|
|
47
|
-
"@servicetitan/log-service": "
|
|
48
|
-
"@servicetitan/react-ioc": "
|
|
46
|
+
"@servicetitan/launchdarkly-service": "41.0.0",
|
|
47
|
+
"@servicetitan/log-service": "41.0.0",
|
|
48
|
+
"@servicetitan/react-ioc": "41.0.0",
|
|
49
49
|
"@testing-library/dom": "^10.4.2",
|
|
50
|
-
"@testing-library/jest-dom": "^
|
|
50
|
+
"@testing-library/jest-dom": "^8.0.0",
|
|
51
51
|
"@testing-library/react": "^16.3.3",
|
|
52
52
|
"@types/history": "~4.7.10",
|
|
53
53
|
"@types/react": "~18.3.3",
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"@servicetitan/anvil2": ">=1.5.0",
|
|
63
63
|
"@servicetitan/design-system": ">=14.5.3",
|
|
64
|
-
"@servicetitan/launchdarkly-service": "
|
|
65
|
-
"@servicetitan/log-service": "
|
|
66
|
-
"@servicetitan/react-ioc": "
|
|
64
|
+
"@servicetitan/launchdarkly-service": "41.0.0",
|
|
65
|
+
"@servicetitan/log-service": "41.0.0",
|
|
66
|
+
"@servicetitan/react-ioc": "41.0.0",
|
|
67
67
|
"history": "~4.10.1",
|
|
68
68
|
"react": ">=17.0.2",
|
|
69
69
|
"react-dom": ">=17.0.2"
|
package/src/common.ts
CHANGED
|
@@ -1,19 +1,33 @@
|
|
|
1
1
|
import { type LDService } from '@servicetitan/launchdarkly-service';
|
|
2
2
|
import { Log } from '@servicetitan/log-service';
|
|
3
3
|
import { symbolToken } from '@servicetitan/react-ioc';
|
|
4
|
-
import {
|
|
4
|
+
import { SharedDependencies } from '@servicetitan/startup-utils';
|
|
5
5
|
import { EventBus } from './event-bus';
|
|
6
6
|
import { HistoryManager } from './history-manager';
|
|
7
7
|
|
|
8
|
-
export interface
|
|
8
|
+
export interface SharedInstanceDependencies {
|
|
9
9
|
launchDarkly?: { version: string; ldService?: LDService };
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
/** @deprecated Use `SharedInstanceDependencies` */
|
|
13
|
+
export type ExposedInstanceDependencies = SharedInstanceDependencies;
|
|
14
|
+
|
|
12
15
|
export const BASENAME_TOKEN = symbolToken<string>('BASENAME_TOKEN');
|
|
13
|
-
export const
|
|
16
|
+
export const SHARED_DEPENDENCIES_TOKEN = symbolToken<SharedDependencies>(
|
|
17
|
+
'SHARED_DEPENDENCIES_TOKEN'
|
|
18
|
+
);
|
|
19
|
+
export const SHARED_INSTANCE_DEPENDENCIES_TOKEN = symbolToken<SharedInstanceDependencies>(
|
|
20
|
+
'SHARED_INSTANCE_DEPENDENCIES_TOKEN'
|
|
21
|
+
);
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated Use `SHARED_DEPENDENCIES_TOKEN`. Still provided to MFEs for consumers and
|
|
24
|
+
* older versions of web-components that read it; to be removed in a future major release.
|
|
25
|
+
*/
|
|
26
|
+
export const EXPOSED_DEPENDENCIES_TOKEN = symbolToken<SharedDependencies>(
|
|
14
27
|
'EXPOSED_DEPENDENCIES_TOKEN'
|
|
15
28
|
);
|
|
16
|
-
|
|
29
|
+
/** @deprecated Use `SHARED_INSTANCE_DEPENDENCIES_TOKEN`. See `EXPOSED_DEPENDENCIES_TOKEN`. */
|
|
30
|
+
export const EXPOSED_INSTANCE_DEPENDENCIES_TOKEN = symbolToken<SharedInstanceDependencies>(
|
|
17
31
|
'EXPOSED_INSTANCE_DEPENDENCIES_TOKEN'
|
|
18
32
|
);
|
|
19
33
|
export const IS_WEB_COMPONENT_TOKEN = symbolToken<boolean>('IS_WEB_COMPONENT_TOKEN');
|
|
@@ -23,8 +37,15 @@ export interface Entries {
|
|
|
23
37
|
ldService?: LDService;
|
|
24
38
|
logService?: Log;
|
|
25
39
|
historyManager?: HistoryManager;
|
|
26
|
-
|
|
27
|
-
|
|
40
|
+
sharedDependencies?: SharedDependencies;
|
|
41
|
+
sharedInstanceDependencies?: SharedInstanceDependencies;
|
|
42
|
+
/**
|
|
43
|
+
* @deprecated Use `sharedDependencies`. Hosts still send this for MFEs built with older
|
|
44
|
+
* versions of web-components, and MFEs still read it from older hosts.
|
|
45
|
+
*/
|
|
46
|
+
exposedDependencies?: SharedDependencies;
|
|
47
|
+
/** @deprecated Use `sharedInstanceDependencies`. See `exposedDependencies`. */
|
|
48
|
+
exposedInstanceDependencies?: SharedInstanceDependencies;
|
|
28
49
|
eventBus?: EventBus;
|
|
29
50
|
basename?: string;
|
|
30
51
|
onReady?: () => void;
|