@equinor/fusion-framework-app 11.0.10 → 11.0.11

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
- export declare const version = "11.0.10";
1
+ export declare const version = "11.0.11";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/fusion-framework-app",
3
- "version": "11.0.10",
3
+ "version": "11.0.11",
4
4
  "description": "",
5
5
  "main": "dist/esm/index.js",
6
6
  "types": "./dist/types/index.d.ts",
@@ -46,20 +46,20 @@
46
46
  },
47
47
  "dependencies": {
48
48
  "rxjs": "^7.8.1",
49
- "@equinor/fusion-framework": "8.0.10",
50
- "@equinor/fusion-framework-module": "6.1.0",
51
- "@equinor/fusion-framework-module-app": "8.0.2",
52
- "@equinor/fusion-framework-module-http": "8.0.3",
53
- "@equinor/fusion-framework-module-event": "6.0.0",
54
- "@equinor/fusion-framework-module-telemetry": "7.0.0",
55
- "@equinor/fusion-framework-module-msal": "10.0.1"
49
+ "@equinor/fusion-framework": "8.0.11",
50
+ "@equinor/fusion-framework-module": "6.1.1",
51
+ "@equinor/fusion-framework-module-app": "8.0.3",
52
+ "@equinor/fusion-framework-module-event": "6.0.1",
53
+ "@equinor/fusion-framework-module-msal": "10.0.2",
54
+ "@equinor/fusion-framework-module-telemetry": "7.0.1",
55
+ "@equinor/fusion-framework-module-http": "8.0.4"
56
56
  },
57
57
  "devDependencies": {
58
- "typescript": "^6.0.3",
59
- "@equinor/fusion-framework-module-bookmark": "^4.0.2"
58
+ "typescript": "^7.0.2",
59
+ "@equinor/fusion-framework-module-bookmark": "^4.0.3"
60
60
  },
61
61
  "peerDependencies": {
62
- "@equinor/fusion-framework-module-bookmark": "^4.0.2"
62
+ "@equinor/fusion-framework-module-bookmark": "^4.0.3"
63
63
  },
64
64
  "peerDependenciesMeta": {
65
65
  "@equinor/fusion-framework-module-bookmark": {
@@ -86,10 +86,10 @@ export interface IAppConfigurator<
86
86
  * `baseUri` and `defaultScopes` are excluded because they are
87
87
  * resolved from service discovery.
88
88
  */
89
- // TODO - rename
89
+ // TODO(#5060): rename
90
90
  useFrameworkServiceClient(
91
91
  serviceName: string,
92
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
92
+ // biome-ignore lint/suspicious/noExplicitAny: `HttpClientOptions<any>` widens to accept options for any request payload type
93
93
  options?: Omit<HttpClientOptions<any>, 'baseUri' | 'defaultScopes'>,
94
94
  ): void;
95
95
  }
@@ -153,6 +153,7 @@ export class AppConfigurator<
153
153
  */
154
154
  protected _configureHttpClientsFromAppConfig() {
155
155
  const { endpoints = {} } = this.env.config ?? {};
156
+ // Register an HTTP client for each endpoint defined in the app configuration.
156
157
  for (const [key, { url, scopes }] of Object.entries(endpoints)) {
157
158
  this.configureHttpClient(key, {
158
159
  baseUri: url,
@@ -196,7 +197,7 @@ export class AppConfigurator<
196
197
  */
197
198
  public useFrameworkServiceClient(
198
199
  serviceName: string,
199
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
200
+ // biome-ignore lint/suspicious/noExplicitAny: `HttpClientOptions<any>` widens to accept options for any request payload type
200
201
  options?: Omit<HttpClientOptions<any>, 'baseUri' | 'defaultScopes'>,
201
202
  ): void {
202
203
  this.addConfig({
@@ -204,6 +205,7 @@ export class AppConfigurator<
204
205
  configure: async (config, ref) => {
205
206
  // Service from serviceDiscovery with potential session override.
206
207
  const service = await ref?.serviceDiscovery.resolveService(serviceName);
208
+ // Guard: service must resolve before the HTTP client can be configured.
207
209
  if (!service) {
208
210
  throw Error(`failed to configure service [${serviceName}]`);
209
211
  }
@@ -92,13 +92,16 @@ export const configureModules =
92
92
  if (cb) {
93
93
  await Promise.resolve(cb(configurator, args));
94
94
  }
95
+ // Type cast is safe because AppConfigurator.initialize() returns the exact module
96
+ // instance that was registered and configured above. The intermediate 'unknown'
97
+ // cast is necessary due to TypeScript's generic inference limitations with the
98
+ // configurator's initialization chain, but the runtime value is guaranteed to match.
95
99
  const modules: AppModulesInstance<TModules> = (await configurator.initialize(
96
100
  args.fusion.modules,
97
- // TODO: type cast to unknown should not be needed in future
98
101
  )) as unknown as AppModulesInstance<TModules>;
99
102
 
100
103
  // Dispatch app modules loaded event for app lifecycle tracking
101
- // TODO - remove check after fusion-cli is updated (app module is not enabled in fusion-cli)
104
+ // TODO(#5061): remove check after fusion-cli is updated (app module is not enabled in fusion-cli)
102
105
  if (args.env.manifest?.appKey) {
103
106
  modules.event.dispatchEvent('onAppModulesLoaded', {
104
107
  detail: { appKey: args.env.manifest.appKey, manifest: args.env.manifest, modules },
@@ -44,6 +44,7 @@ export const enableBookmark = (config: IAppConfigurator): void => {
44
44
  initialize(args) {
45
45
  // get the bookmark provider from the ref (portal)
46
46
  const provider = args.ref?.bookmark;
47
+ // Bail out early if the portal did not expose a bookmark provider.
47
48
  if (!provider) {
48
49
  console.error('Bookmark provider not found');
49
50
  return {};
@@ -51,6 +52,7 @@ export const enableBookmark = (config: IAppConfigurator): void => {
51
52
  // create a proxy to intercept the addPayloadGenerator method
52
53
  return new Proxy(provider, {
53
54
  get(target, prop) {
55
+ // Intercept specific property access to wrap bookmark lifecycle management.
54
56
  switch (prop) {
55
57
  case 'addPayloadGenerator':
56
58
  return (generator: BookmarkPayloadGenerator) => {
@@ -82,6 +84,7 @@ export const enableBookmark = (config: IAppConfigurator): void => {
82
84
  });
83
85
  },
84
86
  dispose() {
87
+ // Run all registered cleanup functions to prevent memory leaks on module disposal.
85
88
  for (const teardown of cleanupFunctions) {
86
89
  teardown();
87
90
  }
package/src/types.ts CHANGED
@@ -141,4 +141,5 @@ export type AppModuleInitArgs<TRef extends Fusion = Fusion, TEnv = AppEnv> = {
141
141
  export type AppRenderFn<TFusion extends Fusion = Fusion, TEnv = AppEnv> = (
142
142
  el: HTMLHtmlElement,
143
143
  args: ComponentRenderArgs<TFusion, TEnv>,
144
+ // biome-ignore lint/suspicious/noConfusingVoidType: `void` here relies on TypeScript's special-cased "void-returning callback accepts any return value" behavior \u2014 `undefined` would break assignability of render functions that return a cleanup function
144
145
  ) => VoidFunction | void;
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '11.0.10';
2
+ export const version = '11.0.11';