@equinor/fusion-framework-react-app 1.0.2 → 1.0.3
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 +9 -0
- package/dist/esm/create-component.js +1 -1
- package/dist/esm/create-component.js.map +1 -1
- package/dist/esm/create-legacy-app.js +1 -1
- package/dist/esm/create-legacy-app.js.map +1 -1
- package/dist/esm/render-component.js +3 -12
- package/dist/esm/render-component.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/create-component.d.ts +1 -1
- package/dist/types/render-component.d.ts +1 -1
- package/dist/types/useAppModule.d.ts +1 -1
- package/dist/types/useAppModules.d.ts +1 -1
- package/package.json +8 -8
- package/src/create-component.tsx +4 -5
- package/src/create-legacy-app.tsx +1 -1
- package/src/render-component.tsx +17 -22
- package/dist/esm/create-app.js +0 -24
- package/dist/esm/create-app.js.map +0 -1
- package/dist/types/create-app.d.ts +0 -15
- package/yarn-error.log +0 -13173
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.0.3](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-react-app@1.0.2...@equinor/fusion-framework-react-app@1.0.3) (2022-09-13)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* update typings and linting ([7d2056b](https://github.com/equinor/fusion-framework/commit/7d2056b7866850b7efdfd4567385b5dbbcdf8761))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
6
15
|
## [1.0.2](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-react-app@1.0.1...@equinor/fusion-framework-react-app@1.0.2) (2022-09-13)
|
|
7
16
|
|
|
8
17
|
**Note:** Version bump only for package @equinor/fusion-framework-react-app
|
|
@@ -3,7 +3,7 @@ import { lazy } from 'react';
|
|
|
3
3
|
import { FrameworkProvider } from '@equinor/fusion-framework-react';
|
|
4
4
|
import { initAppModules } from '@equinor/fusion-framework-app';
|
|
5
5
|
import { ModuleProvider as AppModuleProvider } from '@equinor/fusion-framework-react-module';
|
|
6
|
-
export const createComponent = (Component, configure) => (
|
|
6
|
+
export const createComponent = (Component, configure) => (fusion, env) => lazy(async () => {
|
|
7
7
|
const init = initAppModules(configure);
|
|
8
8
|
const modules = (await init({
|
|
9
9
|
fusion,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-component.js","sourceRoot":"","sources":["../../src/create-component.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAGpE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAW/D,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"create-component.js","sourceRoot":"","sources":["../../src/create-component.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAGpE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAW/D,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AA6D7F,MAAM,CAAC,MAAM,eAAe,GACxB,CAKI,SAA8B,EAC9B,SAAyD,EACvB,EAAE,CACxC,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,CACZ,IAAI,CAAC,KAAK,IAAI,EAAE;IACZ,MAAM,IAAI,GAAG,cAAc,CAA4B,SAAS,CAAC,CAAC;IAClE,MAAM,OAAO,GAAG,CAAC,MAAM,IAAI,CAAC;QACxB,MAAM;QACN,QAAQ,EAAE,GAAG;KAChB,CAAC,CAAkC,CAAC;IAErC,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,kBAAkB,EAAE;QAC5C,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QAC3B,MAAM,EAAE,SAAS;KACpB,CAAC,CAAC;IACH,OAAO;QACH,OAAO,EAAE,GAAG,EAAE,CAAC,CACX,KAAC,iBAAiB,IAAC,KAAK,EAAE,MAAM,YAC5B,KAAC,iBAAiB,IAAC,KAAK,EAAE,OAAO,YAC7B,KAAC,SAAS,KAAG,GACG,GACJ,CACvB;KACJ,CAAC;AACN,CAAC,CAAC,CAAC;AAUX,eAAe,eAAe,CAAC"}
|
|
@@ -7,7 +7,7 @@ export const createLegacyApp = (Component, configure) => {
|
|
|
7
7
|
const fusion = useFramework();
|
|
8
8
|
const RenderComponent = useMemo(() => {
|
|
9
9
|
const creator = createComponent(Component, configure);
|
|
10
|
-
return creator(
|
|
10
|
+
return creator(fusion, { name: 'legacy' });
|
|
11
11
|
}, []);
|
|
12
12
|
return (_jsx(Suspense, { fallback: _jsx("p", { children: "loading app" }), children: _jsx(RenderComponent, {}) }));
|
|
13
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-legacy-app.js","sourceRoot":"","sources":["../../src/create-legacy-app.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAKrE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,CAAC,MAAM,eAAe,GAAG,CAC3B,SAA8B,EAC9B,SAAwC,EAC1C,EAAE;IACA,OAAO,GAAgB,EAAE;QACrB,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;QAC9B,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,EAAE;YACjC,MAAM,OAAO,GAAG,eAAe,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;YACtD,OAAO,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"create-legacy-app.js","sourceRoot":"","sources":["../../src/create-legacy-app.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAKrE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,CAAC,MAAM,eAAe,GAAG,CAC3B,SAA8B,EAC9B,SAAwC,EAC1C,EAAE;IACA,OAAO,GAAgB,EAAE;QACrB,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;QAC9B,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,EAAE;YACjC,MAAM,OAAO,GAAG,eAAe,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;YACtD,OAAO,OAAO,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC/C,CAAC,EAAE,EAAE,CAAC,CAAC;QACP,OAAO,CACH,KAAC,QAAQ,IAAC,QAAQ,EAAE,sCAAkB,YAClC,KAAC,eAAe,KAAG,GACZ,CACd,CAAC;IACN,CAAC,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,26 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Suspense, StrictMode } from 'react';
|
|
3
3
|
import ReactDOM from 'react-dom';
|
|
4
|
-
import { createRoot } from 'react-dom/client';
|
|
5
4
|
export const renderComponent = (renderer) => {
|
|
6
5
|
return (el, args) => {
|
|
7
|
-
const Component = renderer(args);
|
|
8
|
-
|
|
9
|
-
return renderFn(el, Component);
|
|
6
|
+
const Component = renderer(args.fusion, args.env);
|
|
7
|
+
return render(el, Component);
|
|
10
8
|
};
|
|
11
9
|
};
|
|
12
|
-
const
|
|
10
|
+
const render = (el, Component) => {
|
|
13
11
|
ReactDOM.render(_jsx(StrictMode, { children: _jsx(Suspense, { fallback: _jsx("p", { children: "loading app" }), children: _jsx(Component, {}) }) }), el);
|
|
14
12
|
return () => {
|
|
15
13
|
ReactDOM.unmountComponentAtNode(el);
|
|
16
14
|
};
|
|
17
15
|
};
|
|
18
|
-
const render = (el, Component) => {
|
|
19
|
-
const root = createRoot(el);
|
|
20
|
-
root.render(_jsx(StrictMode, { children: _jsx(Suspense, { fallback: _jsx("p", { children: "loading app" }), children: _jsx(Component, {}) }) }));
|
|
21
|
-
return () => {
|
|
22
|
-
root.unmount();
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
16
|
export default renderComponent;
|
|
26
17
|
//# sourceMappingURL=render-component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-component.js","sourceRoot":"","sources":["../../src/render-component.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAG7C,OAAO,QAAQ,MAAM,WAAW,CAAC;AAIjC,
|
|
1
|
+
{"version":3,"file":"render-component.js","sourceRoot":"","sources":["../../src/render-component.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAG7C,OAAO,QAAQ,MAAM,WAAW,CAAC;AAIjC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,QAA2B,EAAE,EAAE;IAC3D,OAAO,CAAC,EAAe,EAAE,IAAyB,EAAkB,EAAE;QAClE,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;QAClD,OAAO,MAAM,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;IACjC,CAAC,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,CAAC,EAAW,EAAE,SAA4B,EAAkB,EAAE;IACzE,QAAQ,CAAC,MAAM,CACX,KAAC,UAAU,cACP,KAAC,QAAQ,IAAC,QAAQ,EAAE,sCAAkB,YAClC,KAAC,SAAS,KAAG,GACN,GACF,EACb,EAAE,CACL,CAAC;IACF,OAAO,GAAG,EAAE;QACR,QAAQ,CAAC,sBAAsB,CAAC,EAAE,CAAC,CAAC;IACxC,CAAC,CAAC;AACN,CAAC,CAAC;AAgBF,eAAe,eAAe,CAAC"}
|