@equinor/fusion-framework-react-app 9.0.8 → 9.0.9-next.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 CHANGED
@@ -1,5 +1,22 @@
1
1
  # Change Log
2
2
 
3
+ ## 9.0.9-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - [#3820](https://github.com/equinor/fusion-framework/pull/3820) [`f647825`](https://github.com/equinor/fusion-framework/commit/f647825cb5712763b09dafda21fd996211c78b78) Thanks [@odinr](https://github.com/odinr)! - relase next
8
+
9
+ - Updated dependencies [[`f647825`](https://github.com/equinor/fusion-framework/commit/f647825cb5712763b09dafda21fd996211c78b78)]:
10
+ - @equinor/fusion-framework-react-module@3.1.15-next.0
11
+ - @equinor/fusion-framework-module-navigation@7.0.0-next.2
12
+ - @equinor/fusion-framework-react-module-http@10.0.2-next.0
13
+ - @equinor/fusion-framework-react@7.4.21-next.0
14
+ - @equinor/fusion-framework-module-app@7.4.2-next.0
15
+ - @equinor/fusion-framework-app@10.4.10-next.0
16
+ - @equinor/fusion-framework-module-http@7.0.9-next.0
17
+ - @equinor/fusion-framework-module@5.0.7-next.0
18
+ - @equinor/fusion-framework-module-msal@7.3.2-next.0
19
+
3
20
  ## 9.0.8
4
21
 
5
22
  ### Patch Changes
@@ -130,7 +147,6 @@
130
147
  ### Patch Changes
131
148
 
132
149
  - [#3714](https://github.com/equinor/fusion-framework/pull/3714) [`11fe961`](https://github.com/equinor/fusion-framework/commit/11fe961794e4960ccb987bc320268cc9b263f1f8) Thanks [@odinr](https://github.com/odinr)! - Fix MSAL v4 compatibility issues in React app hooks.
133
-
134
150
  - Update useCurrentAccount to use account property instead of deprecated defaultAccount
135
151
  - Fix useToken hook to properly handle AcquireTokenResult type
136
152
  - Ensure proper null/undefined handling for account information
@@ -186,14 +202,12 @@
186
202
  - [#3075](https://github.com/equinor/fusion-framework/pull/3075) [`8fffbfb`](https://github.com/equinor/fusion-framework/commit/8fffbfb12daa9748bf5290e5084cd4d409aed253) Thanks [@odinr](https://github.com/odinr)! - Refactored the `Bookmark` type to be an intersection of `BookmarkWithoutData` and an optional `payload` property, improving type safety and flexibility. Updated `useBookmarkNavigate` to use proper TypeScript typing for bookmark events.
187
203
 
188
204
  **Module Bookmark Changes:**
189
-
190
205
  - Refactored `Bookmark` type in `packages/modules/bookmark/src/types.ts`
191
206
  - Added export for `BookmarkProviderEvents` type in `packages/modules/bookmark/src/index.ts`
192
207
  - Updated JSDoc comment from `@note` to `@remarks` in `packages/modules/bookmark/src/BookmarkClient.ts`
193
208
  - Reordered tsconfig references (event before services)
194
209
 
195
210
  **React Changes:**
196
-
197
211
  - Updated `packages/react/modules/bookmark/src/portal/useBookmarkNavigate.ts` to use proper TypeScript typing for bookmark provider events
198
212
  - Removed React paths configuration from `packages/react/app/tsconfig.json`
199
213
 
@@ -240,7 +254,6 @@
240
254
  ### Patch Changes
241
255
 
242
256
  - [#3088](https://github.com/equinor/fusion-framework/pull/3088) [`7441b13`](https://github.com/equinor/fusion-framework/commit/7441b13aa50dd7362d1629086a27b6b4e571575d) Thanks [@eikeland](https://github.com/eikeland)! - chore: update package typesVersions
243
-
244
257
  - Updated package.json typesVersions.
245
258
  - Ensures backward compatibility with older node versions.
246
259
  - Ensured consistency with workspace and repository configuration.
@@ -300,7 +313,6 @@
300
313
  `appKey (string)`: The key of the Fusion app to load and mount.
301
314
 
302
315
  ### Returns
303
-
304
316
  - **loading** `(boolean)`: true while the app is loading.
305
317
  - **error** `(Error | undefined)`: Error object if loading fails, otherwise undefined.
306
318
  - **appRef** `(React.RefObject<HTMLDivElement | null>)`: Ref to the DOM element where the child app is mounted.
@@ -334,7 +346,6 @@
334
346
  ```
335
347
 
336
348
  ### Notes
337
-
338
349
  - The hook is designed to be used in a parent Fusion app context.
339
350
  - The returned appRef should be appended to a container element in your component.
340
351
  - Handles subscription and cleanup automatically.
@@ -618,7 +629,6 @@
618
629
  ### Minor Changes
619
630
 
620
631
  - [#2577](https://github.com/equinor/fusion-framework/pull/2577) [`c3ba9f1`](https://github.com/equinor/fusion-framework/commit/c3ba9f109d9f96d6dc6ee2f0ddac00c8b3090982) Thanks [@eikeland](https://github.com/eikeland)! - #### Changes:
621
-
622
632
  1. **AppClient.ts**
623
633
  - Added `updateAppSettings` method to set app settings by appKey.
624
634
  2. **AppModuleProvider.ts**
@@ -666,7 +676,6 @@
666
676
  ### Minor Changes
667
677
 
668
678
  - [#2410](https://github.com/equinor/fusion-framework/pull/2410) [`9d1cb90`](https://github.com/equinor/fusion-framework/commit/9d1cb9003fa10e7ccaa95c20ef86f0a618034641) Thanks [@odinr](https://github.com/odinr)! - Updated bookmark namespace in `@equinor/fusion-react-app` to include new hooks and updated `useCurrentBookmark` hook.
669
-
670
679
  - Updated `index.ts` to re-export everything from `@equinor/fusion-framework-react-module-bookmark` instead of individual exports.
671
680
  - Marked `useBookmark` as deprecated in `useBookmark.ts`.
672
681
  - Enhanced `useCurrentBookmark` in `useCurrentBookmark.ts` to accept a `BookmarkPayloadGenerator` and use the `BookmarkModule` from `useAppModule`.
@@ -708,12 +717,10 @@
708
717
  > This will introduce breaking changes to the configuration of `AppConfigurator.client`.
709
718
 
710
719
  **Added**
711
-
712
720
  - Introduced `AppClient` class to handle application manifest and configuration queries.
713
721
  - Added `zod` to validate the application manifest.
714
722
 
715
723
  **Changed**
716
-
717
724
  - Updated `AppModuleProvider` to use `AppClient` for fetching application manifests and configurations.
718
725
  - Modified `AppConfigurator` to utilize `AppClient` for client configuration.
719
726
  - Updated `useApps` hook with new input parameter for `filterByCurrentUser` in `fusion-framework-react`.
@@ -845,7 +852,6 @@
845
852
  - [#2320](https://github.com/equinor/fusion-framework/pull/2320) [`1dd85f3`](https://github.com/equinor/fusion-framework/commit/1dd85f3a408a73df556d1812a5f280945cc100ee) Thanks [@odinr](https://github.com/odinr)! - Removed the `removeComments` option from the `tsconfig.base.json` file.
846
853
 
847
854
  Removing the `removeComments` option allows TypeScript to preserve comments in the compiled JavaScript output. This can be beneficial for several reasons:
848
-
849
855
  1. Improved debugging: Preserved comments can help developers understand the code better during debugging sessions.
850
856
  2. Documentation: JSDoc comments and other important code documentation will be retained in the compiled output.
851
857
  3. Source map accuracy: Keeping comments can lead to more accurate source maps, which is crucial for debugging and error tracking.
@@ -1214,7 +1220,6 @@
1214
1220
  ### Minor Changes
1215
1221
 
1216
1222
  - [#1646](https://github.com/equinor/fusion-framework/pull/1646) [`5eab8af`](https://github.com/equinor/fusion-framework/commit/5eab8afe3c3106cc67ad14ce4cbee6c7e4e8dfb1) Thanks [@odinr](https://github.com/odinr)! - Created namespace for MSAL:
1217
-
1218
1223
  - Created hooks for accessing current authenticated account
1219
1224
  - Created hooks for acquiring token
1220
1225
  - Created hooks for acquiring access token
@@ -1441,7 +1446,6 @@
1441
1446
  ### Minor Changes
1442
1447
 
1443
1448
  - [#934](https://github.com/equinor/fusion-framework/pull/934) [`ea081696`](https://github.com/equinor/fusion-framework/commit/ea0816967244917b01a3aa43b75cd3cf59573958) Thanks [@odinr](https://github.com/odinr)! - **Add tooling for navigation in React App package**
1444
-
1445
1449
  - add hook for using the navigation module
1446
1450
  - add hook for creating a react router
1447
1451
 
@@ -1472,7 +1476,6 @@
1472
1476
  ### Patch Changes
1473
1477
 
1474
1478
  - [#905](https://github.com/equinor/fusion-framework/pull/905) [`a7858a1c`](https://github.com/equinor/fusion-framework/commit/a7858a1c01542e2dc94370709f122b4b99c3219c) Thanks [@odinr](https://github.com/odinr)! - **🚧 Chore: dedupe packages**
1475
-
1476
1479
  - align all versions of typescript
1477
1480
  - update types to build
1478
1481
  - a couple of typecasts did not [satisfies](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#satisfies-support-in-jsdoc) and was recasted as `unknwon`, marked with `TODO`, should be fixed in future
@@ -9,7 +9,7 @@ import { useApploader } from './useApploader';
9
9
  *
10
10
  * @param { ApploaderProps } props - The props for the component.
11
11
  * @param { string } props.appKey - The key of the Fusion app to load and mount.
12
- * @returns { JSX.Element } The rendered component, which displays loading, error, or the embedded app.
12
+ * @returns { ReactElement } The rendered component, which displays loading, error, or the embedded app.
13
13
  *
14
14
  * @example
15
15
  * <Apploader appKey="my-app" />
@@ -1 +1 @@
1
- {"version":3,"file":"Apploader.js","sourceRoot":"","sources":["../../../src/apploader/Apploader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAM9C;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EAAE,MAAM,EAAkB,EAAe,EAAE;IACnE,MAAM,QAAQ,GAAG,MAAM,CAAwB,IAAI,CAAC,CAAC;IACrD,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IAE5D,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,QAAQ,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACzC,OAAO;QACT,CAAC;QAED,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC/C,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IAErB,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,sCAAc,MAAM,IAAO,CAAC;IACrC,CAAC;IACD,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,CACL,4CACiB,MAAM,eAAW,KAAK,CAAC,OAAO,IACzC,CACP,CAAC;IACJ,CAAC;IAED,OAAO,cAAK,GAAG,EAAE,QAAQ,GAAI,CAAC;AAChC,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"Apploader.js","sourceRoot":"","sources":["../../../src/apploader/Apploader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAqB,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAM9C;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EAAE,MAAM,EAAkB,EAAgB,EAAE;IACpE,MAAM,QAAQ,GAAG,MAAM,CAAwB,IAAI,CAAC,CAAC;IACrD,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IAE5D,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,QAAQ,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACzC,OAAO;QACT,CAAC;QAED,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC/C,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IAErB,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,sCAAc,MAAM,IAAO,CAAC;IACrC,CAAC;IACD,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,CACL,4CACiB,MAAM,eAAW,KAAK,CAAC,OAAO,IACzC,CACP,CAAC;IACJ,CAAC;IAED,OAAO,cAAK,GAAG,EAAE,QAAQ,GAAI,CAAC;AAChC,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from '@equinor/fusion-framework-module-http/selectors';
2
+ //# sourceMappingURL=selectors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selectors.js","sourceRoot":"","sources":["../../../src/http/selectors.ts"],"names":[],"mappings":"AAAA,cAAc,iDAAiD,CAAC"}
package/dist/esm/index.js CHANGED
@@ -3,9 +3,8 @@ export { useAppModules } from './useAppModules';
3
3
  export { useAppEnvironmentVariables } from './useAppEnvironmentVariables';
4
4
  export { makeComponent } from './make-component';
5
5
  export { createLegacyApp } from './create-legacy-app';
6
- // TODO deprecate
7
- export { renderApp } from './render-app';
8
6
  export { createComponent } from './create-component';
7
+ export { renderApp } from './render-app';
9
8
  export { renderComponent } from './render-component';
10
9
  export { default } from './render-app';
11
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAE1E,OAAO,EAAE,aAAa,EAAuB,MAAM,kBAAkB,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,iBAAiB;AACjB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAIrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAE1E,OAAO,EAAE,aAAa,EAAuB,MAAM,kBAAkB,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAKrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
@@ -26,7 +26,7 @@ import { ModuleProvider as AppModuleProvider } from '@equinor/fusion-framework-r
26
26
  */
27
27
  export const makeComponent = (Component, args, configure) => lazy(async () => {
28
28
  const init = configureModules(configure);
29
- const modules = (await init(args));
29
+ const modules = await init(args);
30
30
  const { fusion } = args;
31
31
  modules.event.dispatchEvent('onReactAppLoaded', {
32
32
  detail: { modules, fusion, env: args.env },
@@ -1 +1 @@
1
- {"version":3,"file":"make-component.js","sourceRoot":"","sources":["../../src/make-component.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAE7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAGpE,OAAO,EAAe,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAO9E,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAY7F;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAK3B,SAA0B,EAC1B,IAAiC,EACjC,SAAoD,EACJ,EAAE,CAClD,IAAI,CAAC,KAAK,IAAI,EAAE;IACd,MAAM,IAAI,GAAG,gBAAgB,CAAuB,SAAS,CAAC,CAAC;IAC/D,MAAM,OAAO,GAAG,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,CAAkC,CAAC;IAEpE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAExB,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,kBAAkB,EAAE;QAC9C,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE;QAC1C,MAAM,EAAE,SAAS;KAClB,CAAC,CAAC;IAEH,OAAO;QACL,OAAO,EAAE,GAAG,EAAE,CAAC,CACb,KAAC,iBAAiB,IAAC,KAAK,EAAE,MAAM,YAC9B,KAAC,iBAAiB,IAAC,KAAK,EAAE,OAAO,YAAG,SAAS,GAAqB,GAChD,CACrB;KACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAaL,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"make-component.js","sourceRoot":"","sources":["../../src/make-component.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAE7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAGpE,OAAO,EAAe,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAO9E,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAY7F;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAK3B,SAA0B,EAC1B,IAAiC,EACjC,SAAoD,EACJ,EAAE,CAClD,IAAI,CAAC,KAAK,IAAI,EAAE;IACd,MAAM,IAAI,GAAG,gBAAgB,CAAuB,SAAS,CAAC,CAAC;IAC/D,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC;IAEjC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAExB,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,kBAAkB,EAAE;QAC9C,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE;QAC1C,MAAM,EAAE,SAAS;KAClB,CAAC,CAAC;IAEH,OAAO;QACL,OAAO,EAAE,GAAG,EAAE,CAAC,CACb,KAAC,iBAAiB,IAAC,KAAK,EAAE,MAAM,YAC9B,KAAC,iBAAiB,IAAC,KAAK,EAAE,OAAO,YAAG,SAAS,GAAqB,GAChD,CACrB;KACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAaL,eAAe,aAAa,CAAC"}
@@ -1,6 +1,12 @@
1
1
  import { createComponent } from './create-component';
2
2
  import { renderComponent } from './render-component';
3
- /** @deprecated */
3
+ /**
4
+ * Creates a render function for an app component.
5
+ * Uses React 18's createRoot API via renderComponent.
6
+ *
7
+ * @param componentArgs - Arguments to pass to createComponent
8
+ * @returns A function that renders the app into a DOM element
9
+ */
4
10
  export const renderApp = (...componentArgs) => {
5
11
  const renderer = renderComponent(createComponent(...componentArgs));
6
12
  return (el, args) => {
@@ -1 +1 @@
1
- {"version":3,"file":"render-app.js","sourceRoot":"","sources":["../../src/render-app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAuB,MAAM,oBAAoB,CAAC;AAI1E,kBAAkB;AAClB,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,GAAG,aAAiD,EAAE,EAAE;IAChF,MAAM,QAAQ,GAAG,eAAe,CAAC,eAAe,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC;IACpE,OAAO,CAAC,EAAe,EAAE,IAAyB,EAAkB,EAAE;QACpE,OAAO,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"render-app.js","sourceRoot":"","sources":["../../src/render-app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAuB,MAAM,oBAAoB,CAAC;AAI1E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,GAAG,aAAiD,EAAE,EAAE;IAChF,MAAM,QAAQ,GAAG,eAAe,CAAC,eAAe,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC;IACpE,OAAO,CAAC,EAAe,EAAE,IAAyB,EAAkB,EAAE;QACpE,OAAO,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -1,33 +1,32 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Suspense, StrictMode } from 'react';
3
- import ReactDOM from 'react-dom';
4
- /** @deprecated */
3
+ import { createRoot } from 'react-dom/client';
4
+ /**
5
+ * Renders a React component into a DOM element using React 18's createRoot API.
6
+ *
7
+ * @param el - The DOM element to render into
8
+ * @param Component - The React component to render
9
+ * @returns A teardown function that unmounts the component
10
+ */
11
+ const render = (el, Component) => {
12
+ const root = createRoot(el);
13
+ root.render(_jsx(StrictMode, { children: _jsx(Suspense, { fallback: _jsx("p", { children: "loading app" }), children: _jsx(Component, {}) }) }));
14
+ return () => {
15
+ root.unmount();
16
+ };
17
+ };
18
+ /**
19
+ * Creates a render function for a component renderer.
20
+ * Uses React 18's createRoot API instead of the deprecated ReactDOM.render.
21
+ *
22
+ * @param renderer - A function that creates a component from fusion and env
23
+ * @returns A function that renders the component into a DOM element
24
+ */
5
25
  export const renderComponent = (renderer) => {
6
26
  return (el, args) => {
7
27
  const Component = renderer(args.fusion, args.env);
8
28
  return render(el, Component);
9
29
  };
10
30
  };
11
- const render = (el, Component) => {
12
- // eslint-disable-next-line react/no-deprecated
13
- ReactDOM.render(_jsx(StrictMode, { children: _jsx(Suspense, { fallback: _jsx("p", { children: "loading app" }), children: _jsx(Component, {}) }) }), el);
14
- return () => {
15
- // eslint-disable-next-line react/no-deprecated
16
- ReactDOM.unmountComponentAtNode(el);
17
- };
18
- };
19
- // const render = (el: Element, Component: FunctionComponent): RenderTeardown => {
20
- // const root = createRoot(el);
21
- // root.render(
22
- // <StrictMode>
23
- // <Suspense fallback={<p>loading app</p>}>
24
- // <Component />
25
- // </Suspense>
26
- // </StrictMode>
27
- // );
28
- // return () => {
29
- // root.unmount();
30
- // };
31
- // };
32
31
  export default renderComponent;
33
32
  //# 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,kBAAkB;AAClB,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,QAA2B,EAAE,EAAE;IAC7D,OAAO,CAAC,EAAe,EAAE,IAAyB,EAAkB,EAAE;QACpE,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;QAClD,OAAO,MAAM,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;IAC/B,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,CAAC,EAAW,EAAE,SAA4B,EAAkB,EAAE;IAC3E,+CAA+C;IAC/C,QAAQ,CAAC,MAAM,CACb,KAAC,UAAU,cACT,KAAC,QAAQ,IAAC,QAAQ,EAAE,sCAAkB,YACpC,KAAC,SAAS,KAAG,GACJ,GACA,EACb,EAAE,CACH,CAAC;IACF,OAAO,GAAG,EAAE;QACV,+CAA+C;QAC/C,QAAQ,CAAC,sBAAsB,CAAC,EAAE,CAAC,CAAC;IACtC,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,kFAAkF;AAClF,mCAAmC;AACnC,mBAAmB;AACnB,uBAAuB;AACvB,uDAAuD;AACvD,gCAAgC;AAChC,0BAA0B;AAC1B,wBAAwB;AACxB,SAAS;AACT,qBAAqB;AACrB,0BAA0B;AAC1B,SAAS;AACT,KAAK;AAEL,eAAe,eAAe,CAAC"}
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;AAE7C,OAAO,EAAE,UAAU,EAAa,MAAM,kBAAkB,CAAC;AAKzD;;;;;;GAMG;AACH,MAAM,MAAM,GAAG,CAAC,EAAW,EAAE,SAA4B,EAAkB,EAAE;IAC3E,MAAM,IAAI,GAAS,UAAU,CAAC,EAAE,CAAC,CAAC;IAClC,IAAI,CAAC,MAAM,CACT,KAAC,UAAU,cACT,KAAC,QAAQ,IAAC,QAAQ,EAAE,sCAAkB,YACpC,KAAC,SAAS,KAAG,GACJ,GACA,CACd,CAAC;IACF,OAAO,GAAG,EAAE;QACV,IAAI,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,QAA2B,EAAE,EAAE;IAC7D,OAAO,CAAC,EAAe,EAAE,IAAyB,EAAkB,EAAE;QACpE,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;QAClD,OAAO,MAAM,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;IAC/B,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useAppModules.js","sourceRoot":"","sources":["../../src/useAppModules.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,GAEF,EAAE,CAAC,UAAU,EAAyB,CAAC;AAElE,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"useAppModules.js","sourceRoot":"","sources":["../../src/useAppModules.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,GAEF,EAAE,CAAC,UAAU,EAA0C,CAAC;AAEnF,eAAe,aAAa,CAAC"}
@@ -1,3 +1,3 @@
1
1
  // Generated by genversion.
2
- export const version = '9.0.8';
2
+ export const version = '9.0.9-next.0';
3
3
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,OAAO,GAAG,cAAc,CAAC"}