@equinor/fusion-framework-react-app 5.0.7 → 5.0.9
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 +22 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/make-component.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/make-component.d.ts +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +9 -9
- package/src/index.ts +1 -5
- package/src/make-component.tsx +19 -10
- package/src/version.ts +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { AppConfig, AppEnv, AppModuleInitiator, AppModules, AppModulesInstance, AppManifest, IAppConfigurator, } from '@equinor/fusion-framework-app';
|
|
1
|
+
export type { AppConfig, AppEnv, AppModuleInitiator, AppModules, AppModulesInstance, AppManifest, AppRenderFn, IAppConfigurator, } from '@equinor/fusion-framework-app';
|
|
2
2
|
export { useAppModule } from './useAppModule';
|
|
3
3
|
export { useAppModules } from './useAppModules';
|
|
4
4
|
export { makeComponent, ComponentRenderArgs } from './make-component';
|
|
@@ -12,7 +12,7 @@ export type ComponentRenderer<TFusion extends Fusion = Fusion, TEnv = AppEnv> =
|
|
|
12
12
|
export declare const makeComponent: <TModules extends AnyModule[], TRef extends Fusion<unknown> = Fusion<unknown>, TEnv extends AppEnv = AppEnv>(Component: React.ReactNode, args: {
|
|
13
13
|
fusion: TRef;
|
|
14
14
|
env: TEnv;
|
|
15
|
-
}, configure?: AppModuleInitiator<TModules, TRef, TEnv>) => React.LazyExoticComponent<
|
|
15
|
+
}, configure?: AppModuleInitiator<TModules, TRef, TEnv>) => React.LazyExoticComponent<React.ComponentType>;
|
|
16
16
|
declare module '@equinor/fusion-framework-module-event' {
|
|
17
17
|
interface FrameworkEventMap {
|
|
18
18
|
onReactAppLoaded: FrameworkEvent<FrameworkEventInit<{
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "5.0.
|
|
1
|
+
export declare const version = "5.0.9";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/fusion-framework-react-app",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.9",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/esm/index.js",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -82,13 +82,13 @@
|
|
|
82
82
|
"directory": "packages/react"
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
|
-
"@equinor/fusion-framework-app": "^9.0.
|
|
86
|
-
"@equinor/fusion-framework-module-navigation": "^4.0.0",
|
|
87
|
-
"@equinor/fusion-framework-module-app": "^5.3.1",
|
|
85
|
+
"@equinor/fusion-framework-app": "^9.0.6",
|
|
88
86
|
"@equinor/fusion-framework-module": "^4.3.0",
|
|
89
|
-
"@equinor/fusion-framework-
|
|
87
|
+
"@equinor/fusion-framework-module-app": "^5.3.2",
|
|
88
|
+
"@equinor/fusion-framework-module-navigation": "^4.0.1",
|
|
89
|
+
"@equinor/fusion-framework-react": "^7.0.5",
|
|
90
90
|
"@equinor/fusion-framework-react-module": "^3.1.1",
|
|
91
|
-
"@equinor/fusion-framework-react-module-http": "^5.0.
|
|
91
|
+
"@equinor/fusion-framework-react-module-http": "^5.0.3"
|
|
92
92
|
},
|
|
93
93
|
"devDependencies": {
|
|
94
94
|
"@types/react": "^18.2.50",
|
|
@@ -100,10 +100,10 @@
|
|
|
100
100
|
"@equinor/fusion-framework-module-event": "^4.1.1",
|
|
101
101
|
"@equinor/fusion-framework-module-feature-flag": "^1.1.1",
|
|
102
102
|
"@equinor/fusion-framework-module-msal": "^3.1.0",
|
|
103
|
-
"@equinor/fusion-framework-react-module-bookmark": "^2.1.
|
|
104
|
-
"@equinor/fusion-framework-react-
|
|
103
|
+
"@equinor/fusion-framework-react-module-bookmark": "^2.1.5",
|
|
104
|
+
"@equinor/fusion-framework-react-widget": "^1.1.5",
|
|
105
105
|
"@equinor/fusion-observable": "^8.3.0",
|
|
106
|
-
"@equinor/fusion-framework-react-
|
|
106
|
+
"@equinor/fusion-framework-react-module-context": "^6.2.3"
|
|
107
107
|
},
|
|
108
108
|
"peerDependencies": {
|
|
109
109
|
"@types/react": "^17.0.0 || ^18.0.0",
|
package/src/index.ts
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* [[include:react-app/README.MD]]
|
|
3
|
-
* @module
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
1
|
export type {
|
|
7
2
|
AppConfig,
|
|
8
3
|
AppEnv,
|
|
@@ -10,6 +5,7 @@ export type {
|
|
|
10
5
|
AppModules,
|
|
11
6
|
AppModulesInstance,
|
|
12
7
|
AppManifest,
|
|
8
|
+
AppRenderFn,
|
|
13
9
|
IAppConfigurator,
|
|
14
10
|
} from '@equinor/fusion-framework-app';
|
|
15
11
|
|
package/src/make-component.tsx
CHANGED
|
@@ -23,17 +23,25 @@ export type ComponentRenderer<TFusion extends Fusion = Fusion, TEnv = AppEnv> =
|
|
|
23
23
|
) => React.LazyExoticComponent<React.ComponentType>;
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
* Creates
|
|
27
|
-
*
|
|
26
|
+
* Creates a lazy loading React Component that initializes and configures modules,
|
|
27
|
+
* then provides the necessary context to both the Fusion framework and the configured modules.
|
|
28
|
+
* This function is particularly useful for setting up a React application with modular architecture,
|
|
29
|
+
* allowing for lazy loading of components along with their dependencies.
|
|
28
30
|
*
|
|
29
|
-
* __Exposed providers__
|
|
30
|
-
*
|
|
31
|
-
*
|
|
31
|
+
* __Exposed providers__:
|
|
32
|
+
* - {@link @equinor/fusion-framework-react.FrameworkProvider | FrameworkProvider} to provide Fusion context.
|
|
33
|
+
* - {@link @equinor/fusion-framework-react-module.ModuleProvider | ModuleProvider} to provide module instances.
|
|
32
34
|
*
|
|
33
|
-
* @template TModules
|
|
34
|
-
* @
|
|
35
|
-
* @
|
|
36
|
-
* @param
|
|
35
|
+
* @template TModules The types of modules included in the configuration.
|
|
36
|
+
* @template TRef The type of the Fusion instance.
|
|
37
|
+
* @template TEnv The environment type for the application.
|
|
38
|
+
* @param {React.ReactNode} Component - The React component to render lazily.
|
|
39
|
+
* @param {Object} args - The arguments required for module configuration and component rendering.
|
|
40
|
+
* @param {TRef} args.fusion - The Fusion instance to be used by the component and modules.
|
|
41
|
+
* @param {TEnv} args.env - The environment context for the application.
|
|
42
|
+
* @param {AppModuleInitiator<TModules, TRef, TEnv>} [configure] - Optional callback function for configuring application modules.
|
|
43
|
+
* @returns {React.LazyExoticComponent<React.ComponentType>} A lazy component that, when rendered,
|
|
44
|
+
* initializes the specified modules and provides the necessary Fusion and module context.
|
|
37
45
|
*/
|
|
38
46
|
export const makeComponent = <
|
|
39
47
|
TModules extends Array<AnyModule>,
|
|
@@ -43,7 +51,7 @@ export const makeComponent = <
|
|
|
43
51
|
Component: React.ReactNode,
|
|
44
52
|
args: { fusion: TRef; env: TEnv },
|
|
45
53
|
configure?: AppModuleInitiator<TModules, TRef, TEnv>,
|
|
46
|
-
) =>
|
|
54
|
+
): React.LazyExoticComponent<React.ComponentType> =>
|
|
47
55
|
lazy(async () => {
|
|
48
56
|
const init = configureModules<TModules, TRef, TEnv>(configure);
|
|
49
57
|
const modules = (await init(args)) as unknown as AppModulesInstance;
|
|
@@ -54,6 +62,7 @@ export const makeComponent = <
|
|
|
54
62
|
detail: { modules, fusion },
|
|
55
63
|
source: Component,
|
|
56
64
|
});
|
|
65
|
+
|
|
57
66
|
return {
|
|
58
67
|
default: () => (
|
|
59
68
|
<FrameworkProvider value={fusion}>
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
export const version = '5.0.
|
|
2
|
+
export const version = '5.0.9';
|