@gooddata/sdk-ui-pluggable-host 11.62.0-alpha.3 → 11.62.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.
@@ -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,2CA4XtG"}
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
- currentPathname: latestMountStateRef.current.pathname,
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, latestMountStateRef]);
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":"AA4JA;;;;;;;;;;;;;;;;;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;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAkB1F;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,CAS9C"}
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
- for (const candidate of withAliases(prefix)) {
29
- if (href.startsWith(candidate) && candidate.length > longestPrefixLength) {
30
- owner = appId;
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 (withAliases(reserved).some((candidate) => candidate.startsWith(prefix))) {
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; its hooks work around behaviour of the MF runtime we cannot
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;AAIhF;;;;;;;;;;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,CA0B1E"}
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; its hooks work around behaviour of the MF runtime we cannot
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",
3
+ "version": "11.62.0",
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.3",
33
- "@gooddata/sdk-embedding": "11.62.0-alpha.3",
34
- "@gooddata/sdk-backend-spi": "11.62.0-alpha.3",
35
- "@gooddata/sdk-model": "11.62.0-alpha.3",
36
- "@gooddata/sdk-backend-tiger": "11.62.0-alpha.3",
37
- "@gooddata/sdk-pluggable-application-model": "11.62.0-alpha.3",
38
- "@gooddata/sdk-ui": "11.62.0-alpha.3",
39
- "@gooddata/sdk-ui-application-header": "11.62.0-alpha.3",
40
- "@gooddata/sdk-ui-ext": "11.62.0-alpha.3",
41
- "@gooddata/sdk-ui-gen-ai": "11.62.0-alpha.3",
42
- "@gooddata/sdk-ui-kit": "11.62.0-alpha.3",
43
- "@gooddata/sdk-ui-semantic-search": "11.62.0-alpha.3",
44
- "@gooddata/sdk-ui-theme-provider": "11.62.0-alpha.3",
45
- "@gooddata/util": "11.62.0-alpha.3"
32
+ "@gooddata/sdk-backend-base": "11.62.0",
33
+ "@gooddata/sdk-backend-spi": "11.62.0",
34
+ "@gooddata/sdk-backend-tiger": "11.62.0",
35
+ "@gooddata/sdk-embedding": "11.62.0",
36
+ "@gooddata/sdk-model": "11.62.0",
37
+ "@gooddata/sdk-ui": "11.62.0",
38
+ "@gooddata/sdk-pluggable-application-model": "11.62.0",
39
+ "@gooddata/sdk-ui-ext": "11.62.0",
40
+ "@gooddata/sdk-ui-application-header": "11.62.0",
41
+ "@gooddata/sdk-ui-gen-ai": "11.62.0",
42
+ "@gooddata/sdk-ui-kit": "11.62.0",
43
+ "@gooddata/sdk-ui-semantic-search": "11.62.0",
44
+ "@gooddata/sdk-ui-theme-provider": "11.62.0",
45
+ "@gooddata/util": "11.62.0"
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/oxlint-config": "11.62.0-alpha.3",
85
- "@gooddata/eslint-config": "11.62.0-alpha.3"
84
+ "@gooddata/eslint-config": "11.62.0",
85
+ "@gooddata/oxlint-config": "11.62.0"
86
86
  },
87
87
  "peerDependencies": {
88
88
  "react": ">=18.3.1",