@equinor/fusion-framework-app 10.4.9 → 11.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/CHANGELOG.md +49 -6
- package/README.md +162 -18
- package/dist/esm/AppConfigurator.js +56 -12
- package/dist/esm/AppConfigurator.js.map +1 -1
- package/dist/esm/configure-modules.js +31 -16
- package/dist/esm/configure-modules.js.map +1 -1
- package/dist/esm/enable-bookmark.js +25 -5
- package/dist/esm/enable-bookmark.js.map +1 -1
- package/dist/esm/index.js +20 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/AppConfigurator.d.ts +106 -32
- package/dist/types/configure-modules.d.ts +26 -12
- package/dist/types/enable-bookmark.d.ts +25 -5
- package/dist/types/index.d.ts +20 -0
- package/dist/types/types.d.ts +75 -23
- package/dist/types/version.d.ts +1 -1
- package/package.json +11 -11
- package/src/AppConfigurator.ts +108 -35
- package/src/configure-modules.ts +31 -16
- package/src/enable-bookmark.ts +25 -5
- package/src/index.ts +21 -1
- package/src/types.ts +75 -23
- package/src/version.ts +1 -1
|
@@ -3,41 +3,92 @@ import { type AnyModule, type IModulesConfigurator, ModulesConfigurator } from '
|
|
|
3
3
|
import { configureHttpClient, configureHttp, type HttpClientOptions } from '@equinor/fusion-framework-module-http';
|
|
4
4
|
import type { AppEnv, AppModules } from './types';
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Contract for configuring Fusion application modules.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* `IAppConfigurator` extends the base module configurator with application-specific
|
|
9
|
+
* methods for setting up HTTP clients and integrating with Fusion service discovery.
|
|
10
|
+
* Use this interface when typing configuration callbacks that receive the configurator.
|
|
11
|
+
*
|
|
12
|
+
* @template TModules - Additional application-specific modules to register beyond the defaults.
|
|
13
|
+
* @template TRef - The resolved Fusion modules instance used as a reference during initialization.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* import type { IAppConfigurator } from '@equinor/fusion-framework-app';
|
|
18
|
+
*
|
|
19
|
+
* const configure = (configurator: IAppConfigurator) => {
|
|
20
|
+
* configurator.configureHttpClient('myApi', {
|
|
21
|
+
* baseUri: 'https://api.example.com',
|
|
22
|
+
* defaultScopes: ['api://client-id/.default'],
|
|
23
|
+
* });
|
|
24
|
+
* };
|
|
25
|
+
* ```
|
|
10
26
|
*/
|
|
11
27
|
export interface IAppConfigurator<TModules extends Array<AnyModule> | unknown = unknown, TRef extends FusionModulesInstance = FusionModulesInstance> extends IModulesConfigurator<AppModules<TModules>, TRef> {
|
|
12
28
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
29
|
+
* Configure the HTTP module with custom settings.
|
|
30
|
+
*
|
|
31
|
+
* Delegates to the framework `configureHttp` helper. Use this when you need
|
|
32
|
+
* low-level control over the HTTP module configuration. For most applications,
|
|
33
|
+
* prefer {@link IAppConfigurator.configureHttpClient | configureHttpClient} instead.
|
|
34
|
+
*
|
|
35
|
+
* @param args - Arguments forwarded to the framework `configureHttp` function.
|
|
15
36
|
*/
|
|
16
37
|
configureHttp(...args: Parameters<typeof configureHttp>): void;
|
|
17
38
|
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
39
|
+
* Register a named HTTP client with explicit base URI and authentication scopes.
|
|
40
|
+
*
|
|
41
|
+
* Use this method when the application needs to call a specific API endpoint
|
|
42
|
+
* that is not provided through Fusion service discovery.
|
|
43
|
+
*
|
|
44
|
+
* @param args - Arguments forwarded to the framework `configureHttpClient` function.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* configurator.configureHttpClient('myClient', {
|
|
49
|
+
* baseUri: 'https://foo.bar',
|
|
50
|
+
* defaultScopes: ['api://client-id/.default'],
|
|
51
|
+
* });
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
31
54
|
configureHttpClient(...args: Parameters<typeof configureHttpClient>): void;
|
|
32
55
|
/**
|
|
33
|
-
*
|
|
56
|
+
* Register a named HTTP client resolved through Fusion service discovery.
|
|
34
57
|
*
|
|
35
|
-
*
|
|
58
|
+
* The `serviceName` is looked up in the portal’s service-discovery registry at
|
|
59
|
+
* initialization time. Base URI and default scopes are resolved automatically.
|
|
60
|
+
* Use this instead of {@link IAppConfigurator.configureHttpClient | configureHttpClient}
|
|
61
|
+
* when the service is registered with the Fusion portal.
|
|
36
62
|
*
|
|
37
|
-
* @param serviceName - name of the service
|
|
63
|
+
* @param serviceName - Registered name of the service in Fusion service discovery.
|
|
64
|
+
* @param options - Optional HTTP client overrides (headers, interceptors, etc.).
|
|
65
|
+
* `baseUri` and `defaultScopes` are excluded because they are
|
|
66
|
+
* resolved from service discovery.
|
|
38
67
|
*/
|
|
39
68
|
useFrameworkServiceClient(serviceName: string, options?: Omit<HttpClientOptions<any>, 'baseUri' | 'defaultScopes'>): void;
|
|
40
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Configurator that bootstraps default Fusion application modules and provides
|
|
72
|
+
* helper methods for HTTP client and service-discovery setup.
|
|
73
|
+
*
|
|
74
|
+
* `AppConfigurator` is created internally by {@link configureModules}. It registers
|
|
75
|
+
* the `event`, `http`, and `msal` (auth) modules by default and reads any HTTP
|
|
76
|
+
* endpoints declared in the application’s environment config.
|
|
77
|
+
*
|
|
78
|
+
* @template TModules - Additional application-specific modules beyond the defaults.
|
|
79
|
+
* @template TRef - The resolved Fusion modules instance used as an initialization reference.
|
|
80
|
+
* @template TEnv - The application environment descriptor (manifest, config, basename).
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* // Typically used indirectly via configureModules:
|
|
85
|
+
* import { configureModules } from '@equinor/fusion-framework-app';
|
|
86
|
+
*
|
|
87
|
+
* const initialize = configureModules((configurator) => {
|
|
88
|
+
* configurator.useFrameworkServiceClient('my-service');
|
|
89
|
+
* });
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
41
92
|
export declare class AppConfigurator<TModules extends Array<AnyModule> | unknown = unknown, TRef extends FusionModulesInstance = FusionModulesInstance, TEnv extends AppEnv = AppEnv> extends ModulesConfigurator<AppModules<TModules>, TRef> implements IAppConfigurator<TModules, TRef> {
|
|
42
93
|
readonly env: TEnv;
|
|
43
94
|
/**
|
|
@@ -45,26 +96,49 @@ export declare class AppConfigurator<TModules extends Array<AnyModule> | unknown
|
|
|
45
96
|
* the name is preserved through compilation and minification.
|
|
46
97
|
*/
|
|
47
98
|
static readonly className: string;
|
|
99
|
+
/**
|
|
100
|
+
* Create an application configurator with default modules and environment.
|
|
101
|
+
*
|
|
102
|
+
* Registers the `event`, `http`, and `msal` modules and pre-configures any
|
|
103
|
+
* HTTP clients declared in `env.config.endpoints`.
|
|
104
|
+
*
|
|
105
|
+
* @param env - The application environment containing manifest, config, and optional basename.
|
|
106
|
+
*/
|
|
48
107
|
constructor(env: TEnv);
|
|
49
108
|
/**
|
|
50
|
-
*
|
|
109
|
+
* Read HTTP endpoint definitions from the application config and register each
|
|
110
|
+
* one as a named HTTP client.
|
|
111
|
+
*
|
|
112
|
+
* Iterates over `env.config.endpoints` and calls
|
|
113
|
+
* {@link IAppConfigurator.configureHttpClient | configureHttpClient} for each entry.
|
|
51
114
|
*/
|
|
52
115
|
protected _configureHttpClientsFromAppConfig(): void;
|
|
116
|
+
/** {@inheritDoc IAppConfigurator.configureHttp} */
|
|
53
117
|
configureHttp(...args: Parameters<typeof configureHttp>): void;
|
|
118
|
+
/** {@inheritDoc IAppConfigurator.configureHttpClient} */
|
|
54
119
|
configureHttpClient(...args: Parameters<typeof configureHttpClient>): void;
|
|
55
120
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
121
|
+
* Register a named HTTP client whose base URI and scopes are resolved via
|
|
122
|
+
* Fusion service discovery.
|
|
123
|
+
*
|
|
124
|
+
* Resolution priority (highest wins):
|
|
125
|
+
* 1. Session overrides (user-specific URL / scopes)
|
|
126
|
+
* 2. Application config (`env.config.endpoints`)
|
|
127
|
+
* 3. Service-discovery registry
|
|
128
|
+
*
|
|
129
|
+
* If a client with the same `serviceName` is already registered (e.g. from
|
|
130
|
+
* app config) and the service has **not** been overridden at session level,
|
|
131
|
+
* a warning is logged and the existing configuration is kept.
|
|
60
132
|
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
133
|
+
* @param serviceName - Registered name of the service in Fusion service discovery.
|
|
134
|
+
* @param options - Optional HTTP client overrides. `baseUri` and `defaultScopes`
|
|
135
|
+
* are excluded because they come from service discovery.
|
|
136
|
+
* @throws {Error} When the service cannot be resolved from service discovery.
|
|
65
137
|
*
|
|
66
|
-
* @
|
|
67
|
-
*
|
|
138
|
+
* @example
|
|
139
|
+
* ```ts
|
|
140
|
+
* configurator.useFrameworkServiceClient('my-backend-service');
|
|
141
|
+
* ```
|
|
68
142
|
*/
|
|
69
143
|
useFrameworkServiceClient(serviceName: string, options?: Omit<HttpClientOptions<any>, 'baseUri' | 'defaultScopes'>): void;
|
|
70
144
|
}
|
|
@@ -2,23 +2,37 @@ import type { Fusion } from '@equinor/fusion-framework';
|
|
|
2
2
|
import type { AnyModule } from '@equinor/fusion-framework-module';
|
|
3
3
|
import type { AppModulesInstance, AppModuleInitiator, AppEnv } from './types';
|
|
4
4
|
/**
|
|
5
|
+
* Create an application module initializer for a Fusion application.
|
|
5
6
|
*
|
|
6
|
-
*
|
|
7
|
+
* `configureModules` is the primary entry point for setting up an application’s
|
|
8
|
+
* module pipeline. It returns an async function that, when called with the Fusion
|
|
9
|
+
* instance and the application environment, will:
|
|
10
|
+
*
|
|
11
|
+
* 1. Create an {@link AppConfigurator} with the provided environment.
|
|
12
|
+
* 2. Wire up telemetry scoped to the application.
|
|
13
|
+
* 3. Invoke the optional user-supplied configuration callback.
|
|
14
|
+
* 4. Initialize all registered modules and dispatch an `onAppModulesLoaded` event.
|
|
15
|
+
*
|
|
16
|
+
* @template TModules - Additional application-specific modules to register.
|
|
17
|
+
* @template TRef - The Fusion instance type, used as a configuration reference.
|
|
18
|
+
* @template TEnv - The application environment descriptor (manifest, config, basename).
|
|
19
|
+
*
|
|
20
|
+
* @param cb - Optional configuration callback invoked before modules are initialized.
|
|
21
|
+
* Use this to register HTTP clients, enable bookmarks, or add custom modules.
|
|
22
|
+
* @returns An async initializer function that accepts `{ fusion, env }` and resolves
|
|
23
|
+
* with the fully initialized application module instance.
|
|
7
24
|
*
|
|
8
25
|
* @example
|
|
9
|
-
```ts
|
|
10
|
-
|
|
11
|
-
configurator.configure(someModule);
|
|
12
|
-
});
|
|
13
|
-
await initialize({ fusion, { manifest, config }});
|
|
14
|
-
```
|
|
15
|
-
* @template TModules Addition modules
|
|
16
|
-
* @template TRef usually undefined, optional references
|
|
17
|
-
* @template TEnv environment object for configuring modules
|
|
26
|
+
* ```ts
|
|
27
|
+
* import { configureModules } from '@equinor/fusion-framework-app';
|
|
18
28
|
*
|
|
19
|
-
*
|
|
29
|
+
* const initialize = configureModules((configurator, { fusion, env }) => {
|
|
30
|
+
* configurator.useFrameworkServiceClient('my-service');
|
|
31
|
+
* });
|
|
20
32
|
*
|
|
21
|
-
*
|
|
33
|
+
* // Later, during app bootstrap:
|
|
34
|
+
* const modules = await initialize({ fusion, env });
|
|
35
|
+
* ```
|
|
22
36
|
*/
|
|
23
37
|
export declare const configureModules: <TModules extends Array<AnyModule> | never, TRef extends Fusion = Fusion, TEnv extends AppEnv = AppEnv>(cb?: AppModuleInitiator<TModules, TRef, TEnv>) => ((args: {
|
|
24
38
|
fusion: TRef;
|
|
@@ -1,12 +1,32 @@
|
|
|
1
1
|
import type { IAppConfigurator } from './AppConfigurator';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Enable the bookmark module for a Fusion application.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Adds bookmark support by wiring the portal’s bookmark provider into the
|
|
6
|
+
* application’s module set. Payload generators registered by the application
|
|
7
|
+
* are automatically cleaned up when the module is disposed, preventing memory
|
|
8
|
+
* leaks across application load/unload cycles.
|
|
9
|
+
*
|
|
10
|
+
* Import this function from `@equinor/fusion-framework-app/enable-bookmark` or, for
|
|
11
|
+
* React apps, from `@equinor/fusion-framework-react-app/bookmark`.
|
|
7
12
|
*
|
|
8
13
|
* @remarks
|
|
9
|
-
* The
|
|
10
|
-
*
|
|
14
|
+
* - The portal must expose a bookmark provider on `ref.bookmark`; if it is
|
|
15
|
+
* missing, an error is logged and the module initializes as a no-op.
|
|
16
|
+
* - The `@equinor/fusion-framework-module-bookmark` package must be installed,
|
|
17
|
+
* but do **not** call its `enableBookmark` directly in app code — use this
|
|
18
|
+
* app-level enabler instead.
|
|
19
|
+
*
|
|
20
|
+
* @param config - The application configurator to register the bookmark module on.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* import { configureModules } from '@equinor/fusion-framework-app';
|
|
25
|
+
* import { enableBookmark } from '@equinor/fusion-framework-app/enable-bookmark';
|
|
26
|
+
*
|
|
27
|
+
* const initialize = configureModules((configurator) => {
|
|
28
|
+
* enableBookmark(configurator);
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
11
31
|
*/
|
|
12
32
|
export declare const enableBookmark: (config: IAppConfigurator) => void;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
*
|
|
4
|
+
* `@equinor/fusion-framework-app` provides the configuration and initialization
|
|
5
|
+
* layer for Fusion applications. Use this package to set up application modules,
|
|
6
|
+
* configure HTTP clients, enable bookmarks, and integrate with telemetry and
|
|
7
|
+
* service discovery.
|
|
8
|
+
*
|
|
9
|
+
* The main entry points are:
|
|
10
|
+
*
|
|
11
|
+
* - {@link configureModules} — factory that creates an application initializer
|
|
12
|
+
* - {@link AppConfigurator} / {@link IAppConfigurator} — configurator for registering modules and HTTP clients
|
|
13
|
+
* - Type aliases such as {@link AppModuleInitiator}, {@link AppEnv}, and {@link AppRenderFn}
|
|
14
|
+
*
|
|
15
|
+
* Bookmark support is available via the `@equinor/fusion-framework-app/enable-bookmark`
|
|
16
|
+
* sub-path export.
|
|
17
|
+
*/
|
|
1
18
|
export { AppConfigurator, IAppConfigurator } from './AppConfigurator';
|
|
2
19
|
export * from './types';
|
|
3
20
|
export { configureModules, default } from './configure-modules';
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated Use {@link configureModules} instead. This alias will be removed in a future major version.
|
|
23
|
+
*/
|
|
4
24
|
export { configureModules as initAppModules } from './configure-modules';
|
package/dist/types/types.d.ts
CHANGED
|
@@ -3,58 +3,110 @@ import type { AnyModule } from '@equinor/fusion-framework-module';
|
|
|
3
3
|
import type { AppConfig, AppManifest, AppModulesInstance, ComponentRenderArgs } from '@equinor/fusion-framework-module-app';
|
|
4
4
|
import type { IAppConfigurator } from './AppConfigurator';
|
|
5
5
|
import type { ConfigEnvironment } from '@equinor/fusion-framework-module-app';
|
|
6
|
+
/**
|
|
7
|
+
* Re-exported application module types from `@equinor/fusion-framework-module-app`.
|
|
8
|
+
*
|
|
9
|
+
* - `AppModules` — union of default application modules
|
|
10
|
+
* - `AppManifest` — application manifest metadata (app key, version, etc.)
|
|
11
|
+
* - `AppConfig` — environment-specific application configuration
|
|
12
|
+
* - `AppModulesInstance` — resolved module instances after initialization
|
|
13
|
+
*/
|
|
6
14
|
export type { AppModules, AppManifest, AppConfig, AppModulesInstance, } from '@equinor/fusion-framework-module-app';
|
|
7
15
|
/**
|
|
8
|
-
*
|
|
9
|
-
* Arguments provided when initializing/configuring application modules
|
|
16
|
+
* Environment descriptor passed to the application during module initialization.
|
|
10
17
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
18
|
+
* Contains the application manifest, optional config (with endpoint definitions),
|
|
19
|
+
* an optional base path for routing, and optional component props.
|
|
20
|
+
*
|
|
21
|
+
* @template TConfig - Shape of the environment-specific configuration object.
|
|
22
|
+
* @template TProps - Additional properties forwarded to the application component (currently unused).
|
|
13
23
|
*/
|
|
14
24
|
export type AppEnv<TConfig extends ConfigEnvironment = ConfigEnvironment, TProps = unknown> = {
|
|
15
|
-
/**
|
|
25
|
+
/** Base routing path of the application (e.g. `/apps/my-app`). */
|
|
16
26
|
basename?: string;
|
|
27
|
+
/** Application manifest describing the app key, version, and build metadata. */
|
|
17
28
|
manifest: AppManifest;
|
|
29
|
+
/** Environment-specific configuration with optional endpoint definitions. */
|
|
18
30
|
config?: AppConfig<TConfig>;
|
|
31
|
+
/** Optional properties forwarded to the application component. */
|
|
19
32
|
props?: TProps;
|
|
20
33
|
};
|
|
21
34
|
/**
|
|
22
|
-
*
|
|
35
|
+
* Configuration callback for setting up application modules.
|
|
36
|
+
*
|
|
37
|
+
* This is the function signature accepted by {@link configureModules}. Implement
|
|
38
|
+
* this callback to register HTTP clients, enable bookmarks, and add custom modules
|
|
39
|
+
* to the application’s module pipeline.
|
|
40
|
+
*
|
|
41
|
+
* @template TModules - Additional modules registered by the application.
|
|
42
|
+
* @template TRef - The Fusion instance type used as a configuration reference.
|
|
43
|
+
* @template TEnv - The application environment descriptor.
|
|
44
|
+
*
|
|
45
|
+
* @param configurator - The application configurator with HTTP and module helpers.
|
|
46
|
+
* @param args - Object containing the Fusion instance and the application environment.
|
|
47
|
+
* @returns `void` or a `Promise<void>` for async configuration steps.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* import type { AppModuleInitiator } from '@equinor/fusion-framework-app';
|
|
23
52
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
53
|
+
* const configure: AppModuleInitiator = (configurator, { fusion, env }) => {
|
|
54
|
+
* configurator.useFrameworkServiceClient('portal-api');
|
|
55
|
+
* };
|
|
56
|
+
* ```
|
|
27
57
|
*/
|
|
28
58
|
export type AppModuleInitiator<TModules extends Array<AnyModule> | unknown = unknown, TRef extends Fusion = Fusion, TEnv = AppEnv> = (configurator: IAppConfigurator<TModules, TRef['modules']>, args: {
|
|
29
59
|
fusion: TRef;
|
|
30
60
|
env: TEnv;
|
|
31
61
|
}) => void | Promise<void>;
|
|
32
62
|
/**
|
|
33
|
-
*
|
|
63
|
+
* Factory type that wraps {@link AppModuleInitiator} into a complete initializer.
|
|
64
|
+
*
|
|
65
|
+
* Accepts a configuration callback and returns an async function that, given the
|
|
66
|
+
* Fusion instance and environment, produces the initialized module instance.
|
|
67
|
+
* This is the signature of the {@link configureModules} function itself.
|
|
34
68
|
*
|
|
35
|
-
* @template TModules
|
|
36
|
-
* @template TRef
|
|
37
|
-
* @template TEnv
|
|
69
|
+
* @template TModules - Additional modules registered by the application.
|
|
70
|
+
* @template TRef - The Fusion instance type used as a configuration reference.
|
|
71
|
+
* @template TEnv - The application environment descriptor.
|
|
38
72
|
*/
|
|
39
73
|
export type AppModuleInit<TModules extends Array<AnyModule> | unknown = [], TRef extends Fusion = Fusion, TEnv = AppEnv> = (cb: AppModuleInitiator<TModules, TRef, TEnv>) => (args: AppModuleInitArgs<TRef, TEnv>) => Promise<AppModulesInstance<TModules>>;
|
|
74
|
+
/**
|
|
75
|
+
* Arguments passed to the async initializer returned by {@link configureModules}.
|
|
76
|
+
*
|
|
77
|
+
* @template TRef - The Fusion instance type.
|
|
78
|
+
* @template TEnv - The application environment descriptor.
|
|
79
|
+
*/
|
|
40
80
|
export type AppModuleInitArgs<TRef extends Fusion = Fusion, TEnv = AppEnv> = {
|
|
41
81
|
fusion: TRef;
|
|
42
82
|
env: TEnv;
|
|
43
83
|
};
|
|
44
84
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
85
|
+
* Render function signature for mounting a Fusion application into the DOM.
|
|
86
|
+
*
|
|
87
|
+
* Called by the Fusion portal or dev-server to render the application. The
|
|
88
|
+
* function receives the root element and render arguments (Fusion instance,
|
|
89
|
+
* environment, and modules) and optionally returns a cleanup function that
|
|
90
|
+
* is invoked when the application is unmounted.
|
|
49
91
|
*
|
|
50
|
-
* @
|
|
51
|
-
* @
|
|
52
|
-
*
|
|
92
|
+
* @template TFusion - The Fusion instance type providing framework modules.
|
|
93
|
+
* @template TEnv - The application environment descriptor.
|
|
94
|
+
*
|
|
95
|
+
* @param el - The root HTML element where the application will be rendered.
|
|
96
|
+
* @param args - Render arguments including the Fusion instance, environment,
|
|
97
|
+
* and resolved modules.
|
|
98
|
+
* @returns A cleanup / teardown function, or `void` if no cleanup is needed.
|
|
53
99
|
*
|
|
54
100
|
* @example
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
101
|
+
* ```ts
|
|
102
|
+
* import type { AppRenderFn } from '@equinor/fusion-framework-app';
|
|
103
|
+
* import { createRoot } from 'react-dom/client';
|
|
104
|
+
*
|
|
105
|
+
* export const renderApp: AppRenderFn = (el, args) => {
|
|
106
|
+
* const root = createRoot(el);
|
|
107
|
+
* root.render(<App />);
|
|
108
|
+
* return () => root.unmount();
|
|
58
109
|
* };
|
|
110
|
+
* ```
|
|
59
111
|
*/
|
|
60
112
|
export type AppRenderFn<TFusion extends Fusion = Fusion, TEnv = AppEnv> = (el: HTMLHtmlElement, args: ComponentRenderArgs<TFusion, TEnv>) => VoidFunction | void;
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "
|
|
1
|
+
export declare const version = "11.0.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/fusion-framework-app",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.0",
|
|
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": "
|
|
50
|
-
"@equinor/fusion-framework-module-app": "
|
|
51
|
-
"@equinor/fusion-framework-module-event": "
|
|
52
|
-
"@equinor/fusion-framework-module": "
|
|
53
|
-
"@equinor/fusion-framework-module-http": "
|
|
54
|
-
"@equinor/fusion-framework-module-msal": "
|
|
55
|
-
"@equinor/fusion-framework-module-telemetry": "
|
|
49
|
+
"@equinor/fusion-framework": "8.0.0",
|
|
50
|
+
"@equinor/fusion-framework-module-app": "8.0.0",
|
|
51
|
+
"@equinor/fusion-framework-module-event": "6.0.0",
|
|
52
|
+
"@equinor/fusion-framework-module": "6.0.0",
|
|
53
|
+
"@equinor/fusion-framework-module-http": "8.0.0",
|
|
54
|
+
"@equinor/fusion-framework-module-msal": "8.0.0",
|
|
55
|
+
"@equinor/fusion-framework-module-telemetry": "5.0.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"typescript": "^5.
|
|
59
|
-
"@equinor/fusion-framework-module-bookmark": "^
|
|
58
|
+
"typescript": "^5.9.3",
|
|
59
|
+
"@equinor/fusion-framework-module-bookmark": "^4.0.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
|
-
"@equinor/fusion-framework-module-bookmark": "^
|
|
62
|
+
"@equinor/fusion-framework-module-bookmark": "^4.0.0"
|
|
63
63
|
},
|
|
64
64
|
"peerDependenciesMeta": {
|
|
65
65
|
"@equinor/fusion-framework-module-bookmark": {
|