@gooddata/sdk-ui-pluggable-host 11.62.0-alpha.3 → 11.62.0-alpha.4
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/esm/components/HostUiContainer.d.ts.map +1 -1
- package/esm/components/HostUiContainer.js +4 -2
- package/esm/lib/stylesheetRegistry.d.ts +0 -9
- package/esm/lib/stylesheetRegistry.d.ts.map +1 -1
- package/esm/lib/stylesheetRegistry.js +4 -36
- package/esm/loader/federationRuntimePlugin.d.ts +1 -1
- package/esm/loader/federationRuntimePlugin.d.ts.map +1 -1
- package/esm/loader/federationRuntimePlugin.js +1 -11
- package/package.json +17 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HostUiContainer.d.ts","sourceRoot":"","sources":["../../src/components/HostUiContainer.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,EAA0B,KAAK,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AACpG,OAAO,EAGH,KAAK,gBAAgB,EAExB,MAAM,2CAA2C,CAAC;AAkBnD,OAAO,wBAAwB,CAAC;AAOhC,MAAM,WAAW,qBAAqB;IAClC,GAAG,EAAE,gBAAgB,CAAC;IACtB,IAAI,EAAE,gCAAgC,EAAE,CAAC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,gBAAgB,CAAC;IACjC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACtD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,EAAE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"HostUiContainer.d.ts","sourceRoot":"","sources":["../../src/components/HostUiContainer.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,EAA0B,KAAK,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AACpG,OAAO,EAGH,KAAK,gBAAgB,EAExB,MAAM,2CAA2C,CAAC;AAkBnD,OAAO,wBAAwB,CAAC;AAOhC,MAAM,WAAW,qBAAqB;IAClC,GAAG,EAAE,gBAAgB,CAAC;IACtB,IAAI,EAAE,gCAAgC,EAAE,CAAC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,gBAAgB,CAAC;IACjC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACtD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,EAAE,qBAAqB,2CA8XtG"}
|
|
@@ -128,11 +128,13 @@ export function HostUiContainer({ ctx, apps, pathname, routerNavigate, onError }
|
|
|
128
128
|
const navigate = useCallback((url) => {
|
|
129
129
|
runGuardedNavigation({
|
|
130
130
|
url,
|
|
131
|
-
|
|
131
|
+
// The page's, not the router's: an application moving its own router leaves the host
|
|
132
|
+
// router on the path it last navigated to.
|
|
133
|
+
currentPathname: window.location.pathname,
|
|
132
134
|
guardRef: appNavigationRequestRef,
|
|
133
135
|
navigate: (target) => void navigateRef.current(target),
|
|
134
136
|
});
|
|
135
|
-
}, [navigateRef
|
|
137
|
+
}, [navigateRef]);
|
|
136
138
|
const replace = useCallback((url) => {
|
|
137
139
|
void navigateRef.current(url, { replace: true });
|
|
138
140
|
}, [navigateRef]);
|
|
@@ -23,15 +23,6 @@ export declare function registerAppStylesheetScope(appId: string, remoteEntryUrl
|
|
|
23
23
|
* is resolved before an app renders inside it.
|
|
24
24
|
*/
|
|
25
25
|
export declare function reserveHostStylesheetScope(remoteEntryUrl: string): void;
|
|
26
|
-
/**
|
|
27
|
-
* Declares that the remote at `remoteEntryUrl` serves its assets from `assetBaseUrl`, so
|
|
28
|
-
* stylesheet links under that base belong to whichever app owns the remote entry URL.
|
|
29
|
-
*
|
|
30
|
-
* Call order relative to `registerAppStylesheetScope` does not matter. Refused with a warning
|
|
31
|
-
* when the base is an origin root or covers the host UI module's scope, because it would then
|
|
32
|
-
* claim host stylesheets.
|
|
33
|
-
*/
|
|
34
|
-
export declare function registerRemoteAssetBase(remoteEntryUrl: string, assetBaseUrl: string): void;
|
|
35
26
|
/**
|
|
36
27
|
* Re-enables all stylesheets attributed to the app. Safe to call before any of the
|
|
37
28
|
* app's CSS exists and repeatedly.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stylesheetRegistry.d.ts","sourceRoot":"","sources":["../../src/lib/stylesheetRegistry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stylesheetRegistry.d.ts","sourceRoot":"","sources":["../../src/lib/stylesheetRegistry.ts"],"names":[],"mappings":"AAkJA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,IAAI,CAiCtF;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAQvE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAM1D;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAM5D;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,IAAI,CAQ9C"}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
// (C) 2026 GoodData Corporation
|
|
2
2
|
const scopePrefixes = new Map();
|
|
3
3
|
const reservedHostPrefixes = new Set();
|
|
4
|
-
const assetBaseAliases = new Map();
|
|
5
4
|
const deactivatedApps = new Set();
|
|
6
5
|
let linkLoadStates = new WeakMap();
|
|
7
6
|
let retiredLinks = new WeakSet();
|
|
8
7
|
let observer;
|
|
9
|
-
function withAliases(prefix) {
|
|
10
|
-
return [prefix, ...(assetBaseAliases.get(prefix) ?? [])];
|
|
11
|
-
}
|
|
12
8
|
function deriveScopePrefix(remoteEntryUrl) {
|
|
13
9
|
try {
|
|
14
10
|
const url = new URL(remoteEntryUrl, document.baseURI);
|
|
@@ -25,11 +21,9 @@ function findOwnerOfHref(href) {
|
|
|
25
21
|
let longestPrefixLength = -1;
|
|
26
22
|
for (const [appId, prefixes] of scopePrefixes) {
|
|
27
23
|
for (const prefix of prefixes) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
longestPrefixLength = candidate.length;
|
|
32
|
-
}
|
|
24
|
+
if (href.startsWith(prefix) && prefix.length > longestPrefixLength) {
|
|
25
|
+
owner = appId;
|
|
26
|
+
longestPrefixLength = prefix.length;
|
|
33
27
|
}
|
|
34
28
|
}
|
|
35
29
|
}
|
|
@@ -38,7 +32,7 @@ function findOwnerOfHref(href) {
|
|
|
38
32
|
// An app prefix above a reserved host prefix would claim the host's own links.
|
|
39
33
|
function coversReservedHostScope(prefix) {
|
|
40
34
|
for (const reserved of reservedHostPrefixes) {
|
|
41
|
-
if (
|
|
35
|
+
if (reserved.startsWith(prefix)) {
|
|
42
36
|
return true;
|
|
43
37
|
}
|
|
44
38
|
}
|
|
@@ -177,31 +171,6 @@ export function reserveHostStylesheetScope(remoteEntryUrl) {
|
|
|
177
171
|
reservedHostPrefixes.add(prefix);
|
|
178
172
|
}
|
|
179
173
|
}
|
|
180
|
-
/**
|
|
181
|
-
* Declares that the remote at `remoteEntryUrl` serves its assets from `assetBaseUrl`, so
|
|
182
|
-
* stylesheet links under that base belong to whichever app owns the remote entry URL.
|
|
183
|
-
*
|
|
184
|
-
* Call order relative to `registerAppStylesheetScope` does not matter. Refused with a warning
|
|
185
|
-
* when the base is an origin root or covers the host UI module's scope, because it would then
|
|
186
|
-
* claim host stylesheets.
|
|
187
|
-
*/
|
|
188
|
-
export function registerRemoteAssetBase(remoteEntryUrl, assetBaseUrl) {
|
|
189
|
-
if (typeof document === "undefined") {
|
|
190
|
-
return;
|
|
191
|
-
}
|
|
192
|
-
const prefix = deriveScopePrefix(remoteEntryUrl);
|
|
193
|
-
const alias = deriveScopePrefix(assetBaseUrl.endsWith("/") ? assetBaseUrl : `${assetBaseUrl}/`);
|
|
194
|
-
if (!prefix || !alias || alias === prefix) {
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
if (new URL(alias).pathname === "/" || coversReservedHostScope(alias)) {
|
|
198
|
-
console.warn(`[host-runtime/stylesheet-registry] Not tracking stylesheets under asset base "${assetBaseUrl}" of remote "${remoteEntryUrl}": the base would also cover host stylesheets.`);
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
const aliases = assetBaseAliases.get(prefix) ?? new Set();
|
|
202
|
-
aliases.add(alias);
|
|
203
|
-
assetBaseAliases.set(prefix, aliases);
|
|
204
|
-
}
|
|
205
174
|
/**
|
|
206
175
|
* Re-enables all stylesheets attributed to the app. Safe to call before any of the
|
|
207
176
|
* app's CSS exists and repeatedly.
|
|
@@ -230,7 +199,6 @@ export function deactivateAppStylesheets(appId) {
|
|
|
230
199
|
export function resetStylesheetRegistry() {
|
|
231
200
|
scopePrefixes.clear();
|
|
232
201
|
reservedHostPrefixes.clear();
|
|
233
|
-
assetBaseAliases.clear();
|
|
234
202
|
deactivatedApps.clear();
|
|
235
203
|
linkLoadStates = new WeakMap();
|
|
236
204
|
retiredLinks = new WeakSet();
|
|
@@ -42,7 +42,7 @@ export declare function evictRemoteEntryLoadCache(remoteInfo: {
|
|
|
42
42
|
}): void;
|
|
43
43
|
/**
|
|
44
44
|
* Host-side Module Federation runtime plugin. Registered on the federation instance created
|
|
45
|
-
* by the remote loader;
|
|
45
|
+
* by the remote loader; both hooks work around behaviour of the MF runtime we cannot
|
|
46
46
|
* configure any other way.
|
|
47
47
|
*/
|
|
48
48
|
export declare function createHostFederationPlugin(): ModuleFederationRuntimePlugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"federationRuntimePlugin.d.ts","sourceRoot":"","sources":["../../src/loader/federationRuntimePlugin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"federationRuntimePlugin.d.ts","sourceRoot":"","sources":["../../src/loader/federationRuntimePlugin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAEhF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,QAAS,CAAC;AAE9C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,2BAA2B,oCAAoC,CAAC;AAK7E;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CAAC,UAAU,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAU3F;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,IAAI,6BAA6B,CAgB1E"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// (C) 2026 GoodData Corporation
|
|
2
|
-
import { registerRemoteAssetBase } from "../lib/stylesheetRegistry.js";
|
|
3
2
|
/**
|
|
4
3
|
* Timeout applied to every `<link rel="preload">` Module Federation creates.
|
|
5
4
|
*
|
|
@@ -47,7 +46,7 @@ export function evictRemoteEntryLoadCache(remoteInfo) {
|
|
|
47
46
|
}
|
|
48
47
|
/**
|
|
49
48
|
* Host-side Module Federation runtime plugin. Registered on the federation instance created
|
|
50
|
-
* by the remote loader;
|
|
49
|
+
* by the remote loader; both hooks work around behaviour of the MF runtime we cannot
|
|
51
50
|
* configure any other way.
|
|
52
51
|
*/
|
|
53
52
|
export function createHostFederationPlugin() {
|
|
@@ -63,14 +62,5 @@ export function createHostFederationPlugin() {
|
|
|
63
62
|
evictRemoteEntryLoadCache(remoteInfo);
|
|
64
63
|
}
|
|
65
64
|
},
|
|
66
|
-
// A manifest publicPath (e.g. the CDN base) moves the remote's CSS off its entry URL.
|
|
67
|
-
// The stylesheet registry must know that base to attribute those links to the app.
|
|
68
|
-
loadRemoteSnapshot: async (args) => {
|
|
69
|
-
const { moduleInfo, remoteSnapshot } = args;
|
|
70
|
-
if ("entry" in moduleInfo && "publicPath" in remoteSnapshot && remoteSnapshot.publicPath) {
|
|
71
|
-
registerRemoteAssetBase(moduleInfo.entry, remoteSnapshot.publicPath);
|
|
72
|
-
}
|
|
73
|
-
return args;
|
|
74
|
-
},
|
|
75
65
|
};
|
|
76
66
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-ui-pluggable-host",
|
|
3
|
-
"version": "11.62.0-alpha.
|
|
3
|
+
"version": "11.62.0-alpha.4",
|
|
4
4
|
"description": "GoodData SDK runtime for hosting pluggable applications — registry, loader, routing, platform context, default UI chrome",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "GoodData Corporation",
|
|
@@ -29,20 +29,20 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@module-federation/runtime": "2.6.0",
|
|
31
31
|
"lodash-es": "^4.17.23",
|
|
32
|
-
"@gooddata/sdk-backend-base": "11.62.0-alpha.
|
|
33
|
-
"@gooddata/sdk-
|
|
34
|
-
"@gooddata/sdk-backend-spi": "11.62.0-alpha.
|
|
35
|
-
"@gooddata/sdk-model": "11.62.0-alpha.
|
|
36
|
-
"@gooddata/sdk-
|
|
37
|
-
"@gooddata/sdk-
|
|
38
|
-
"@gooddata/sdk-
|
|
39
|
-
"@gooddata/sdk-
|
|
40
|
-
"@gooddata/sdk-ui-ext": "11.62.0-alpha.
|
|
41
|
-
"@gooddata/sdk-ui-
|
|
42
|
-
"@gooddata/sdk-ui-
|
|
43
|
-
"@gooddata/sdk-ui-
|
|
44
|
-
"@gooddata/sdk-ui-theme-provider": "11.62.0-alpha.
|
|
45
|
-
"@gooddata/util": "11.62.0-alpha.
|
|
32
|
+
"@gooddata/sdk-backend-base": "11.62.0-alpha.4",
|
|
33
|
+
"@gooddata/sdk-backend-tiger": "11.62.0-alpha.4",
|
|
34
|
+
"@gooddata/sdk-backend-spi": "11.62.0-alpha.4",
|
|
35
|
+
"@gooddata/sdk-model": "11.62.0-alpha.4",
|
|
36
|
+
"@gooddata/sdk-ui": "11.62.0-alpha.4",
|
|
37
|
+
"@gooddata/sdk-ui-application-header": "11.62.0-alpha.4",
|
|
38
|
+
"@gooddata/sdk-pluggable-application-model": "11.62.0-alpha.4",
|
|
39
|
+
"@gooddata/sdk-embedding": "11.62.0-alpha.4",
|
|
40
|
+
"@gooddata/sdk-ui-ext": "11.62.0-alpha.4",
|
|
41
|
+
"@gooddata/sdk-ui-semantic-search": "11.62.0-alpha.4",
|
|
42
|
+
"@gooddata/sdk-ui-gen-ai": "11.62.0-alpha.4",
|
|
43
|
+
"@gooddata/sdk-ui-kit": "11.62.0-alpha.4",
|
|
44
|
+
"@gooddata/sdk-ui-theme-provider": "11.62.0-alpha.4",
|
|
45
|
+
"@gooddata/util": "11.62.0-alpha.4"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@microsoft/api-documenter": "7.30.16",
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
"typescript": "7.0.2",
|
|
82
82
|
"vite": "8.0.16",
|
|
83
83
|
"vitest": "5.0.4",
|
|
84
|
-
"@gooddata/
|
|
85
|
-
"@gooddata/
|
|
84
|
+
"@gooddata/eslint-config": "11.62.0-alpha.4",
|
|
85
|
+
"@gooddata/oxlint-config": "11.62.0-alpha.4"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
88
|
"react": ">=18.3.1",
|