@squide/firefly 9.0.1 → 9.1.1

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,115 @@
1
1
  # @squide/firefly
2
2
 
3
+ ## 9.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#197](https://github.com/gsoft-inc/wl-squide/pull/197) [`0c43a84`](https://github.com/gsoft-inc/wl-squide/commit/0c43a8441d3079e0206c9c0ebbc11c6401de82ae) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Fix useProtectedDataQueries isReady result value.
8
+
9
+ ## 9.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#195](https://github.com/gsoft-inc/wl-squide/pull/195) [`98e4839`](https://github.com/gsoft-inc/wl-squide/commit/98e48393fda27ebb2974ecc1e2f71b09f4e84953) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Replaced the `ManagedRoutes` placeholder by the `PublicRoutes` and `ProtectedRoutes` placeholder.
14
+
15
+ Before:
16
+
17
+ ```tsx
18
+ import {
19
+ ManagedRoutes,
20
+ type ModuleRegisterFunction,
21
+ type FireflyRuntime,
22
+ } from "@squide/firefly";
23
+ import { RootLayout } from "./RootLayout.tsx";
24
+
25
+ export const registerHost: ModuleRegisterFunction<FireflyRuntime> = (
26
+ runtime
27
+ ) => {
28
+ runtime.registerRoute(
29
+ {
30
+ element: <RootLayout />,
31
+ children: [ManagedRoutes],
32
+ },
33
+ {
34
+ hoist: true,
35
+ }
36
+ );
37
+ };
38
+ ```
39
+
40
+ Now:
41
+
42
+ ```tsx
43
+ import {
44
+ PublicRoutes,
45
+ ProtectedRoutes,
46
+ type ModuleRegisterFunction,
47
+ type FireflyRuntime,
48
+ } from "@squide/firefly";
49
+ import { RootLayout } from "./RootLayout.tsx";
50
+
51
+ export const registerHost: ModuleRegisterFunction<FireflyRuntime> = (
52
+ runtime
53
+ ) => {
54
+ runtime.registerRoute(
55
+ {
56
+ element: <RootLayout />,
57
+ children: [PublicRoutes, ProtectedRoutes],
58
+ },
59
+ {
60
+ hoist: true,
61
+ }
62
+ );
63
+ };
64
+ ```
65
+
66
+ Or:
67
+
68
+ ```tsx
69
+ import {
70
+ PublicRoutes,
71
+ ProtectedRoutes,
72
+ type ModuleRegisterFunction,
73
+ type FireflyRuntime,
74
+ } from "@squide/firefly";
75
+ import { RootLayout } from "./RootLayout.tsx";
76
+
77
+ export const registerHost: ModuleRegisterFunction<FireflyRuntime> = (
78
+ runtime
79
+ ) => {
80
+ runtime.registerRoute(
81
+ {
82
+ element: <RootLayout />,
83
+ children: [
84
+ PublicRoutes,
85
+ {
86
+ element: <AuthenticationBoundary />,
87
+ children: [
88
+ {
89
+ element: <AuthenticatedLayout />,
90
+ children: [ProtectedRoutes],
91
+ },
92
+ ],
93
+ },
94
+ ],
95
+ },
96
+ {
97
+ hoist: true,
98
+ }
99
+ );
100
+ };
101
+ ```
102
+
103
+ This release also includes a new `runtime.registerPublicRoute()` function.
104
+
105
+ ### Patch Changes
106
+
107
+ - Updated dependencies [[`98e4839`](https://github.com/gsoft-inc/wl-squide/commit/98e48393fda27ebb2974ecc1e2f71b09f4e84953)]:
108
+ - @squide/react-router@6.1.0
109
+ - @squide/core@5.1.0
110
+ - @squide/module-federation@6.0.2
111
+ - @squide/msw@3.0.2
112
+
3
113
  ## 9.0.1
4
114
 
5
115
  ### Patch Changes
@@ -13,9 +13,9 @@ function useProtectedDataQueries(queries, isUnauthorizedError) {
13
13
  data: results.map((x) => x.data),
14
14
  errors,
15
15
  hasErrors: errors.length > 0,
16
- isReady: results.length === queries.length && results.every((x) => x.data)
16
+ isReady: !results.some((x) => x.isPending)
17
17
  };
18
- }, [queries.length]);
18
+ }, []);
19
19
  const { data, errors: queriesErrors, hasErrors, isReady } = useQueries({
20
20
  queries: queries.map((x) => ({
21
21
  enabled: canFetchProtectedData,
package/dist/index.d.ts CHANGED
@@ -14,7 +14,7 @@ export { useCanUpdateDeferredRegistrations } from './useCanUpdateDeferredRegistr
14
14
  export { DeferredRegistrationsErrorCallback, DeferredRegistrationsErrorsObject, UseDeferredRegistrationsOptions, useDeferredRegistrations } from './useDeferredRegistrations.js';
15
15
  export { useIsActiveRouteProtected } from './useIsActiveRouteProtected.js';
16
16
  export { useIsBootstrapping } from './useIsBootstrapping.js';
17
- export { useNavigationItems } from './useNavigationItems.js';
17
+ export { UseNavigationItemsOptions, useNavigationItems } from './useNavigationItems.js';
18
18
  export { IsUnauthorizedErrorCallback, useProtectedDataQueries } from './useProtectedDataQueries.js';
19
19
  export { usePublicDataQueries } from './usePublicDataQueries.js';
20
20
  export { useRegisterDeferredRegistrations } from './useRegisterDeferredRegistrations.js';
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ export { useCanRegisterDeferredRegistrations } from './chunk-PU7MASPN.js';
7
7
  export { useCanUpdateDeferredRegistrations } from './chunk-WVRMJZV6.js';
8
8
  export { useIsBootstrapping } from './chunk-I6L3AYOB.js';
9
9
  export { useNavigationItems } from './chunk-GXSW4CZS.js';
10
- export { useProtectedDataQueries } from './chunk-RG5N56BQ.js';
10
+ export { useProtectedDataQueries } from './chunk-7R2Z7FXF.js';
11
11
  export { AppRouter } from './chunk-36U4TTNR.js';
12
12
  export { useStrictRegistrationMode } from './chunk-WOPD33CM.js';
13
13
  export { FireflyRuntime } from './chunk-FKQ7XQEU.js';
@@ -1,6 +1,7 @@
1
1
  import * as _squide_react_router from '@squide/react-router';
2
2
  import { UseRuntimeNavigationItemsOptions } from '@squide/react-router';
3
3
 
4
- declare function useNavigationItems(options?: UseRuntimeNavigationItemsOptions): _squide_react_router.RootNavigationItem[];
4
+ type UseNavigationItemsOptions = UseRuntimeNavigationItemsOptions;
5
+ declare function useNavigationItems(options?: UseNavigationItemsOptions): _squide_react_router.RootNavigationItem[];
5
6
 
6
- export { useNavigationItems };
7
+ export { type UseNavigationItemsOptions, useNavigationItems };
@@ -1,4 +1,4 @@
1
- export { useProtectedDataQueries } from './chunk-RG5N56BQ.js';
1
+ export { useProtectedDataQueries } from './chunk-7R2Z7FXF.js';
2
2
  import './chunk-HE5HKFL3.js';
3
3
  import './chunk-L5BP3WP3.js';
4
4
  import './chunk-G32YX2KR.js';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@squide/firefly",
3
3
  "author": "Workleap",
4
- "version": "9.0.1",
4
+ "version": "9.1.1",
5
5
  "description": "Helpers to facilitate the creation of an application with the Squide firefly technology stack.",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
@@ -57,10 +57,10 @@
57
57
  "typescript": "5.5.3"
58
58
  },
59
59
  "dependencies": {
60
- "@squide/core": "5.0.1",
61
- "@squide/module-federation": "6.0.1",
62
- "@squide/msw": "3.0.1",
63
- "@squide/react-router": "6.0.1"
60
+ "@squide/core": "5.1.0",
61
+ "@squide/module-federation": "6.0.2",
62
+ "@squide/msw": "3.0.2",
63
+ "@squide/react-router": "6.1.0"
64
64
  },
65
65
  "sideEffects": false,
66
66
  "engines": {