@squide/firefly 8.0.0 → 9.0.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 +78 -2
- package/README.md +1 -1
- package/dist/AppRouter.d.ts +13 -26
- package/dist/AppRouter.js +6 -1
- package/dist/AppRouterContext.d.ts +9 -0
- package/dist/AppRouterContext.js +1 -0
- package/dist/AppRouterReducer.d.ts +31 -0
- package/dist/AppRouterReducer.js +1 -0
- package/dist/{fireflyRuntime.d.ts → FireflyRuntime.d.ts} +3 -2
- package/dist/FireflyRuntime.js +2 -0
- package/dist/GlobalDataQueriesError.d.ts +8 -0
- package/dist/GlobalDataQueriesError.js +1 -0
- package/dist/RootRoute.d.ts +5 -0
- package/dist/RootRoute.js +3 -0
- package/dist/chunk-2E76JVV7.js +41 -0
- package/dist/chunk-36U4TTNR.js +34 -0
- package/dist/chunk-ENUCXEMN.js +180 -0
- package/dist/chunk-FKQ7XQEU.js +54 -0
- package/dist/chunk-G32YX2KR.js +22 -0
- package/dist/chunk-GXSW4CZS.js +9 -0
- package/dist/chunk-HE5HKFL3.js +16 -0
- package/dist/chunk-I6L3AYOB.js +24 -0
- package/dist/chunk-IOMSOUAL.js +20 -0
- package/dist/chunk-L5BP3WP3.js +21 -0
- package/dist/chunk-MZG2PJJG.js +19 -0
- package/dist/chunk-N2GOIQ5E.js +14 -0
- package/dist/chunk-PP3MRMJJ.js +11 -0
- package/dist/chunk-PU7MASPN.js +18 -0
- package/dist/chunk-RG5N56BQ.js +55 -0
- package/dist/chunk-VUMBZ5BP.js +46 -0
- package/dist/chunk-WOPD33CM.js +25 -0
- package/dist/chunk-WVRMJZV6.js +18 -0
- package/dist/chunk-YRWFYWK4.js +11 -0
- package/dist/index.d.ts +21 -4
- package/dist/index.js +19 -2
- package/dist/useCanFetchProtectedData.d.ts +3 -0
- package/dist/useCanFetchProtectedData.js +2 -0
- package/dist/useCanFetchPublicData.d.ts +3 -0
- package/dist/useCanFetchPublicData.js +2 -0
- package/dist/useCanRegisterDeferredRegistrations.d.ts +3 -0
- package/dist/useCanRegisterDeferredRegistrations.js +2 -0
- package/dist/useCanUpdateDeferredRegistrations.d.ts +3 -0
- package/dist/useCanUpdateDeferredRegistrations.js +2 -0
- package/dist/useDeferredRegistrations.d.ts +13 -0
- package/dist/useDeferredRegistrations.js +6 -0
- package/dist/useIsActiveRouteProtected.d.ts +3 -0
- package/dist/useIsActiveRouteProtected.js +1 -0
- package/dist/useIsBootstrapping.d.ts +3 -0
- package/dist/useIsBootstrapping.js +2 -0
- package/dist/useNavigationItems.d.ts +6 -0
- package/dist/useNavigationItems.js +2 -0
- package/dist/useProtectedDataQueries.d.ts +9 -0
- package/dist/useProtectedDataQueries.js +4 -0
- package/dist/usePublicDataQueries.d.ts +8 -0
- package/dist/usePublicDataQueries.js +4 -0
- package/dist/useRegisterDeferredRegistrations.d.ts +9 -0
- package/dist/useRegisterDeferredRegistrations.js +1 -0
- package/dist/useStrictRegistrationMode.d.ts +3 -0
- package/dist/useStrictRegistrationMode.js +1 -0
- package/dist/useUpdateDeferredRegistrations.d.ts +9 -0
- package/dist/useUpdateDeferredRegistrations.js +2 -0
- package/package.json +16 -17
- package/dist/chunk-URNAUMUG.js +0 -160
- package/dist/chunk-YXMNS6U3.js +0 -45
- package/dist/fireflyRuntime.js +0 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useAppRouterState } from './chunk-G32YX2KR.js';
|
|
2
|
+
|
|
3
|
+
// src/useCanFetchPublicData.ts
|
|
4
|
+
function useCanFetchPublicData() {
|
|
5
|
+
const {
|
|
6
|
+
waitForMsw,
|
|
7
|
+
areModulesRegistered,
|
|
8
|
+
areModulesReady,
|
|
9
|
+
isMswReady,
|
|
10
|
+
isPublicDataReady
|
|
11
|
+
} = useAppRouterState();
|
|
12
|
+
return (
|
|
13
|
+
// Always return true when the public data has already been fetched sucessfully so TanStack Query can update the data in the background.
|
|
14
|
+
isPublicDataReady || // Wait until the modules has been registered, but do not wait for the deferred registrations to be registered has they will probably
|
|
15
|
+
// depends on the protected data.
|
|
16
|
+
(areModulesRegistered || areModulesReady) && (!waitForMsw || isMswReady)
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { useCanFetchPublicData };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useAppRouterState } from './chunk-G32YX2KR.js';
|
|
2
|
+
|
|
3
|
+
// src/useCanFetchProtectedData.ts
|
|
4
|
+
function useCanFetchProtectedData() {
|
|
5
|
+
const {
|
|
6
|
+
waitForMsw,
|
|
7
|
+
areModulesRegistered,
|
|
8
|
+
areModulesReady,
|
|
9
|
+
isMswReady,
|
|
10
|
+
isProtectedDataReady,
|
|
11
|
+
isActiveRouteProtected
|
|
12
|
+
} = useAppRouterState();
|
|
13
|
+
return (
|
|
14
|
+
// Always return true when the protected data has already been fetched sucessfully so TanStack Query can update the data in the background.
|
|
15
|
+
isProtectedDataReady || // Wait until the modules has been registered, but do not wait for the deferred registrations to be registered as they will probably
|
|
16
|
+
// depends on the protected data.
|
|
17
|
+
(areModulesRegistered || areModulesReady) && isActiveRouteProtected && (!waitForMsw || isMswReady)
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { useCanFetchProtectedData };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useIsActiveRouteProtected } from './chunk-PP3MRMJJ.js';
|
|
2
|
+
import { useAppRouterState, useAppRouterDispatcher } from './chunk-G32YX2KR.js';
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import { Outlet } from 'react-router-dom';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
function RootRoute() {
|
|
8
|
+
const state = useAppRouterState();
|
|
9
|
+
const isActiveRouteProtected = useIsActiveRouteProtected(state.areModulesReady);
|
|
10
|
+
const dispatch = useAppRouterDispatcher();
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (isActiveRouteProtected) {
|
|
13
|
+
dispatch({ type: "active-route-is-protected" });
|
|
14
|
+
}
|
|
15
|
+
}, [isActiveRouteProtected, dispatch]);
|
|
16
|
+
return /* @__PURE__ */ jsx(Outlet, {});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { RootRoute };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useAppRouterDispatcher } from './chunk-G32YX2KR.js';
|
|
2
|
+
import { updateDeferredRegistrations } from '@squide/module-federation';
|
|
3
|
+
import { useCallback } from 'react';
|
|
4
|
+
|
|
5
|
+
function useUpdateDeferredRegistrations() {
|
|
6
|
+
const dispatch = useAppRouterDispatcher();
|
|
7
|
+
return useCallback(async (data, runtime) => {
|
|
8
|
+
const errors = await updateDeferredRegistrations(data, runtime);
|
|
9
|
+
dispatch({ type: "deferred-registrations-updated" });
|
|
10
|
+
return errors;
|
|
11
|
+
}, [dispatch]);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { useUpdateDeferredRegistrations };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useRouteMatch, useIsRouteProtected } from '@squide/react-router';
|
|
2
|
+
import { useLocation } from 'react-router-dom';
|
|
3
|
+
|
|
4
|
+
// src/useIsActiveRouteProtected.ts
|
|
5
|
+
function useIsActiveRouteProtected(areModulesReady) {
|
|
6
|
+
const location = useLocation();
|
|
7
|
+
const activeRoute = useRouteMatch(location, { throwWhenThereIsNoMatch: areModulesReady });
|
|
8
|
+
return useIsRouteProtected(activeRoute);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { useIsActiveRouteProtected };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useAppRouterState } from './chunk-G32YX2KR.js';
|
|
2
|
+
|
|
3
|
+
// src/useCanRegisterDeferredRegistrations.ts
|
|
4
|
+
function useCanRegisterDeferredRegistrations() {
|
|
5
|
+
const {
|
|
6
|
+
waitForPublicData,
|
|
7
|
+
waitForProtectedData,
|
|
8
|
+
areModulesReady,
|
|
9
|
+
areModulesRegistered,
|
|
10
|
+
isPublicDataReady,
|
|
11
|
+
isProtectedDataReady,
|
|
12
|
+
isActiveRouteProtected,
|
|
13
|
+
isUnauthorized
|
|
14
|
+
} = useAppRouterState();
|
|
15
|
+
return !isUnauthorized && areModulesRegistered && !areModulesReady && (!waitForPublicData || isPublicDataReady) && (!waitForProtectedData || !isActiveRouteProtected || isProtectedDataReady);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { useCanRegisterDeferredRegistrations };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { GlobalDataQueriesError } from './chunk-HE5HKFL3.js';
|
|
2
|
+
import { useCanFetchProtectedData } from './chunk-L5BP3WP3.js';
|
|
3
|
+
import { useAppRouterDispatcher, useAppRouterState } from './chunk-G32YX2KR.js';
|
|
4
|
+
import { useQueries } from '@tanstack/react-query';
|
|
5
|
+
import { useCallback, useEffect, useRef } from 'react';
|
|
6
|
+
|
|
7
|
+
function useProtectedDataQueries(queries, isUnauthorizedError) {
|
|
8
|
+
const canFetchProtectedData = useCanFetchProtectedData();
|
|
9
|
+
const dispatch = useAppRouterDispatcher();
|
|
10
|
+
const combineResults = useCallback((results) => {
|
|
11
|
+
const errors = results.filter((x) => x.error).map((x) => x.error);
|
|
12
|
+
return {
|
|
13
|
+
data: results.map((x) => x.data),
|
|
14
|
+
errors,
|
|
15
|
+
hasErrors: errors.length > 0,
|
|
16
|
+
isReady: results.length === queries.length && results.every((x) => x.data)
|
|
17
|
+
};
|
|
18
|
+
}, [queries.length]);
|
|
19
|
+
const { data, errors: queriesErrors, hasErrors, isReady } = useQueries({
|
|
20
|
+
queries: queries.map((x) => ({
|
|
21
|
+
enabled: canFetchProtectedData,
|
|
22
|
+
...x
|
|
23
|
+
})),
|
|
24
|
+
combine: combineResults
|
|
25
|
+
});
|
|
26
|
+
const {
|
|
27
|
+
isProtectedDataReady,
|
|
28
|
+
isUnauthorized
|
|
29
|
+
} = useAppRouterState();
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (hasErrors) {
|
|
32
|
+
if (!isProtectedDataReady && !isUnauthorized && queriesErrors.some((x) => isUnauthorizedError(x))) {
|
|
33
|
+
dispatch({ type: "is-unauthorized" });
|
|
34
|
+
}
|
|
35
|
+
if (!queriesErrors.every((x) => isUnauthorizedError(x))) {
|
|
36
|
+
throw new GlobalDataQueriesError("[squide] Global protected data queries failed.", queriesErrors);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}, [hasErrors, queriesErrors, isProtectedDataReady, isUnauthorized, isUnauthorizedError, dispatch]);
|
|
40
|
+
const isReadyRef = useRef(false);
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
if (isReadyRef.current && data) {
|
|
43
|
+
dispatch({ type: "protected-data-updated" });
|
|
44
|
+
}
|
|
45
|
+
}, [data, dispatch]);
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (isReady) {
|
|
48
|
+
isReadyRef.current = true;
|
|
49
|
+
dispatch({ type: "protected-data-ready" });
|
|
50
|
+
}
|
|
51
|
+
}, [isReady, dispatch]);
|
|
52
|
+
return data;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export { useProtectedDataQueries };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { useCanFetchPublicData } from './chunk-IOMSOUAL.js';
|
|
2
|
+
import { GlobalDataQueriesError } from './chunk-HE5HKFL3.js';
|
|
3
|
+
import { useAppRouterDispatcher } from './chunk-G32YX2KR.js';
|
|
4
|
+
import { useQueries } from '@tanstack/react-query';
|
|
5
|
+
import { useCallback, useEffect, useRef } from 'react';
|
|
6
|
+
|
|
7
|
+
function usePublicDataQueries(queries) {
|
|
8
|
+
const canFetchPublicData = useCanFetchPublicData();
|
|
9
|
+
const dispatch = useAppRouterDispatcher();
|
|
10
|
+
const combineResults = useCallback((results) => {
|
|
11
|
+
const errors = results.filter((x) => x.error).map((x) => x.error);
|
|
12
|
+
return {
|
|
13
|
+
data: results.map((x) => x.data),
|
|
14
|
+
errors,
|
|
15
|
+
hasErrors: errors.length > 0,
|
|
16
|
+
isReady: results.length === queries.length && results.every((x) => x.data)
|
|
17
|
+
};
|
|
18
|
+
}, [queries.length]);
|
|
19
|
+
const { data, errors: queriesErrors, hasErrors, isReady } = useQueries({
|
|
20
|
+
queries: queries.map((x) => ({
|
|
21
|
+
enabled: canFetchPublicData,
|
|
22
|
+
...x
|
|
23
|
+
})),
|
|
24
|
+
combine: combineResults
|
|
25
|
+
});
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
if (hasErrors) {
|
|
28
|
+
throw new GlobalDataQueriesError("[squide] Global public data queries failed.", queriesErrors);
|
|
29
|
+
}
|
|
30
|
+
}, [hasErrors, queriesErrors]);
|
|
31
|
+
const isReadyRef = useRef(false);
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (isReadyRef.current && data) {
|
|
34
|
+
dispatch({ type: "public-data-updated" });
|
|
35
|
+
}
|
|
36
|
+
}, [data, dispatch]);
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (isReady) {
|
|
39
|
+
isReadyRef.current = true;
|
|
40
|
+
dispatch({ type: "public-data-ready" });
|
|
41
|
+
}
|
|
42
|
+
}, [isReady, dispatch]);
|
|
43
|
+
return data;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export { usePublicDataQueries };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useRuntime, getLocalModuleRegistrationStatus, addLocalModuleRegistrationStatusChangedListener, removeLocalModuleRegistrationStatusChangedListener } from '@squide/core';
|
|
2
|
+
import { getRemoteModuleRegistrationStatus, areModulesReady, addRemoteModuleRegistrationStatusChangedListener, removeRemoteModuleRegistrationStatusChangedListener } from '@squide/module-federation';
|
|
3
|
+
import { useSyncExternalStore, useEffect } from 'react';
|
|
4
|
+
|
|
5
|
+
// src/useStrictRegistrationMode.ts
|
|
6
|
+
function subscribeToLocalModuleRegistrationStatusChanged(callback) {
|
|
7
|
+
addLocalModuleRegistrationStatusChangedListener(callback);
|
|
8
|
+
return () => removeLocalModuleRegistrationStatusChangedListener(callback);
|
|
9
|
+
}
|
|
10
|
+
function subscribeToRemoteModuleRegistrationStatusChanged(callback) {
|
|
11
|
+
addRemoteModuleRegistrationStatusChangedListener(callback);
|
|
12
|
+
return () => removeRemoteModuleRegistrationStatusChangedListener(callback);
|
|
13
|
+
}
|
|
14
|
+
function useStrictRegistrationMode() {
|
|
15
|
+
const runtime = useRuntime();
|
|
16
|
+
const localModuleStatus = useSyncExternalStore(subscribeToLocalModuleRegistrationStatusChanged, getLocalModuleRegistrationStatus);
|
|
17
|
+
const remoteModuleStatus = useSyncExternalStore(subscribeToRemoteModuleRegistrationStatusChanged, getRemoteModuleRegistrationStatus);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (areModulesReady(localModuleStatus, remoteModuleStatus)) {
|
|
20
|
+
runtime._validateRegistrations();
|
|
21
|
+
}
|
|
22
|
+
}, [runtime, localModuleStatus, remoteModuleStatus]);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { useStrictRegistrationMode };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useAppRouterState } from './chunk-G32YX2KR.js';
|
|
2
|
+
|
|
3
|
+
// src/useCanUpdateDeferredRegistrations.ts
|
|
4
|
+
function useCanUpdateDeferredRegistrations() {
|
|
5
|
+
const {
|
|
6
|
+
areModulesReady,
|
|
7
|
+
publicDataUpdatedAt,
|
|
8
|
+
protectedDataUpdatedAt,
|
|
9
|
+
deferredRegistrationsUpdatedAt
|
|
10
|
+
} = useAppRouterState();
|
|
11
|
+
return (
|
|
12
|
+
// Do not trigger an update if the deferred registrations has not been registered yet (if there are deferred registrations, once they are
|
|
13
|
+
// registered, the modules will be marked as ready).
|
|
14
|
+
areModulesReady && deferredRegistrationsUpdatedAt && (publicDataUpdatedAt && publicDataUpdatedAt > deferredRegistrationsUpdatedAt || protectedDataUpdatedAt && protectedDataUpdatedAt > deferredRegistrationsUpdatedAt)
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { useCanUpdateDeferredRegistrations };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { registerDeferredRegistrations } from '@squide/module-federation';
|
|
2
|
+
import { useCallback } from 'react';
|
|
3
|
+
|
|
4
|
+
// src/useRegisterDeferredRegistrations.ts
|
|
5
|
+
function useRegisterDeferredRegistrations() {
|
|
6
|
+
return useCallback((data, runtime) => {
|
|
7
|
+
return registerDeferredRegistrations(data, runtime);
|
|
8
|
+
}, []);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { useRegisterDeferredRegistrations };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,9 +2,26 @@ export * from '@squide/core';
|
|
|
2
2
|
export * from '@squide/module-federation';
|
|
3
3
|
export * from '@squide/msw';
|
|
4
4
|
export * from '@squide/react-router';
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
|
|
5
|
+
export { FireflyRuntime, FireflyRuntimeOptions } from './FireflyRuntime.js';
|
|
6
|
+
export { AppRouter, AppRouterProps, AppRouterRenderFunctionArgs, RenderRouterProviderFunction, RenderRouterProviderFunctionArgs } from './AppRouter.js';
|
|
7
|
+
export { AppRouterDispatcherContext, AppRouterStateContext, useAppRouterDispatcher, useAppRouterState } from './AppRouterContext.js';
|
|
8
|
+
export { AppRouterAction, AppRouterActionType, AppRouterDispatch, AppRouterState, __clearAppReducerDispatchProxy, __setAppReducerDispatchProxyFactory, getAreModulesReady, getAreModulesRegistered, useAppRouterReducer, useModuleRegistrationStatusDispatcher, useMswStatusDispatcher } from './AppRouterReducer.js';
|
|
9
|
+
export { GlobalDataQueriesError, isGlobalDataQueriesError } from './GlobalDataQueriesError.js';
|
|
10
|
+
export { useCanFetchProtectedData } from './useCanFetchProtectedData.js';
|
|
11
|
+
export { useCanFetchPublicData } from './useCanFetchPublicData.js';
|
|
12
|
+
export { useCanRegisterDeferredRegistrations } from './useCanRegisterDeferredRegistrations.js';
|
|
13
|
+
export { useCanUpdateDeferredRegistrations } from './useCanUpdateDeferredRegistrations.js';
|
|
14
|
+
export { DeferredRegistrationsErrorCallback, DeferredRegistrationsErrorsObject, UseDeferredRegistrationsOptions, useDeferredRegistrations } from './useDeferredRegistrations.js';
|
|
15
|
+
export { useIsActiveRouteProtected } from './useIsActiveRouteProtected.js';
|
|
16
|
+
export { useIsBootstrapping } from './useIsBootstrapping.js';
|
|
17
|
+
export { useNavigationItems } from './useNavigationItems.js';
|
|
18
|
+
export { IsUnauthorizedErrorCallback, useProtectedDataQueries } from './useProtectedDataQueries.js';
|
|
19
|
+
export { usePublicDataQueries } from './usePublicDataQueries.js';
|
|
20
|
+
export { useRegisterDeferredRegistrations } from './useRegisterDeferredRegistrations.js';
|
|
21
|
+
export { useStrictRegistrationMode } from './useStrictRegistrationMode.js';
|
|
22
|
+
export { useUpdateDeferredRegistrations } from './useUpdateDeferredRegistrations.js';
|
|
23
|
+
import 'msw';
|
|
8
24
|
import 'react/jsx-runtime';
|
|
25
|
+
import 'react';
|
|
9
26
|
import 'react-router-dom';
|
|
10
|
-
import '
|
|
27
|
+
import '@tanstack/react-query';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { usePublicDataQueries } from './chunk-VUMBZ5BP.js';
|
|
2
|
+
export { useCanFetchPublicData } from './chunk-IOMSOUAL.js';
|
|
3
|
+
export { useDeferredRegistrations } from './chunk-2E76JVV7.js';
|
|
4
|
+
export { useRegisterDeferredRegistrations } from './chunk-YRWFYWK4.js';
|
|
5
|
+
export { useUpdateDeferredRegistrations } from './chunk-N2GOIQ5E.js';
|
|
6
|
+
export { useCanRegisterDeferredRegistrations } from './chunk-PU7MASPN.js';
|
|
7
|
+
export { useCanUpdateDeferredRegistrations } from './chunk-WVRMJZV6.js';
|
|
8
|
+
export { useIsBootstrapping } from './chunk-I6L3AYOB.js';
|
|
9
|
+
export { useNavigationItems } from './chunk-GXSW4CZS.js';
|
|
10
|
+
export { useProtectedDataQueries } from './chunk-RG5N56BQ.js';
|
|
11
|
+
export { AppRouter } from './chunk-36U4TTNR.js';
|
|
12
|
+
export { useStrictRegistrationMode } from './chunk-WOPD33CM.js';
|
|
13
|
+
export { FireflyRuntime } from './chunk-FKQ7XQEU.js';
|
|
14
|
+
export { __clearAppReducerDispatchProxy, __setAppReducerDispatchProxyFactory, getAreModulesReady, getAreModulesRegistered, useAppRouterReducer, useModuleRegistrationStatusDispatcher, useMswStatusDispatcher } from './chunk-ENUCXEMN.js';
|
|
15
|
+
export { GlobalDataQueriesError, isGlobalDataQueriesError } from './chunk-HE5HKFL3.js';
|
|
16
|
+
import './chunk-MZG2PJJG.js';
|
|
17
|
+
export { useIsActiveRouteProtected } from './chunk-PP3MRMJJ.js';
|
|
18
|
+
export { useCanFetchProtectedData } from './chunk-L5BP3WP3.js';
|
|
19
|
+
export { AppRouterDispatcherContext, AppRouterStateContext, useAppRouterDispatcher, useAppRouterState } from './chunk-G32YX2KR.js';
|
|
3
20
|
export * from '@squide/core';
|
|
4
21
|
export * from '@squide/module-federation';
|
|
5
22
|
export * from '@squide/msw';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ModuleRegistrationError } from '@squide/core';
|
|
2
|
+
|
|
3
|
+
interface DeferredRegistrationsErrorsObject {
|
|
4
|
+
localModuleErrors: ModuleRegistrationError[];
|
|
5
|
+
remoteModuleErrors: ModuleRegistrationError[];
|
|
6
|
+
}
|
|
7
|
+
type DeferredRegistrationsErrorCallback = (errorsObject: DeferredRegistrationsErrorsObject) => void;
|
|
8
|
+
interface UseDeferredRegistrationsOptions {
|
|
9
|
+
onError?: DeferredRegistrationsErrorCallback;
|
|
10
|
+
}
|
|
11
|
+
declare function useDeferredRegistrations(data: unknown, { onError }?: UseDeferredRegistrationsOptions): void;
|
|
12
|
+
|
|
13
|
+
export { type DeferredRegistrationsErrorCallback, type DeferredRegistrationsErrorsObject, type UseDeferredRegistrationsOptions, useDeferredRegistrations };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useIsActiveRouteProtected } from './chunk-PP3MRMJJ.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as _squide_react_router from '@squide/react-router';
|
|
2
|
+
import { UseRuntimeNavigationItemsOptions } from '@squide/react-router';
|
|
3
|
+
|
|
4
|
+
declare function useNavigationItems(options?: UseRuntimeNavigationItemsOptions): _squide_react_router.RootNavigationItem[];
|
|
5
|
+
|
|
6
|
+
export { useNavigationItems };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { QueriesOptions, QueriesResults, UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
|
|
3
|
+
type IsUnauthorizedErrorCallback = (error: unknown) => boolean;
|
|
4
|
+
type MapUseQueryResultToData<T> = {
|
|
5
|
+
[K in keyof T]: T[K] extends UseQueryResult<infer U> ? U : never;
|
|
6
|
+
};
|
|
7
|
+
declare function useProtectedDataQueries<T extends Array<any>>(queries: QueriesOptions<T>, isUnauthorizedError: IsUnauthorizedErrorCallback): MapUseQueryResultToData<QueriesResults<T>>;
|
|
8
|
+
|
|
9
|
+
export { type IsUnauthorizedErrorCallback, useProtectedDataQueries };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { QueriesOptions, QueriesResults, UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
|
|
3
|
+
type MapUseQueryResultToData<T> = {
|
|
4
|
+
[K in keyof T]: T[K] extends UseQueryResult<infer U> ? U : never;
|
|
5
|
+
};
|
|
6
|
+
declare function usePublicDataQueries<T extends Array<any>>(queries: QueriesOptions<T>): MapUseQueryResultToData<QueriesResults<T>>;
|
|
7
|
+
|
|
8
|
+
export { usePublicDataQueries };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as _squide_core from '@squide/core';
|
|
2
|
+
import { Runtime } from '@squide/core';
|
|
3
|
+
|
|
4
|
+
declare function useRegisterDeferredRegistrations(): <TData = unknown, TRuntime extends Runtime = Runtime<unknown, unknown>>(data: TData, runtime: TRuntime) => Promise<{
|
|
5
|
+
localModuleErrors: _squide_core.ModuleRegistrationError[];
|
|
6
|
+
remoteModuleErrors: _squide_core.ModuleRegistrationError[];
|
|
7
|
+
}>;
|
|
8
|
+
|
|
9
|
+
export { useRegisterDeferredRegistrations };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useRegisterDeferredRegistrations } from './chunk-YRWFYWK4.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useStrictRegistrationMode } from './chunk-WOPD33CM.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as _squide_core from '@squide/core';
|
|
2
|
+
import { Runtime } from '@squide/core';
|
|
3
|
+
|
|
4
|
+
declare function useUpdateDeferredRegistrations(): <TData = unknown, TRuntime extends Runtime = Runtime<unknown, unknown>>(data: TData, runtime: TRuntime) => Promise<{
|
|
5
|
+
localModuleErrors: _squide_core.ModuleRegistrationError[];
|
|
6
|
+
remoteModuleErrors: _squide_core.ModuleRegistrationError[];
|
|
7
|
+
}>;
|
|
8
|
+
|
|
9
|
+
export { useUpdateDeferredRegistrations };
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@squide/firefly",
|
|
3
3
|
"author": "Workleap",
|
|
4
|
-
"version": "
|
|
5
|
-
"description": "Helpers to facilitate the creation of
|
|
4
|
+
"version": "9.0.1",
|
|
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": {
|
|
8
8
|
"type": "git",
|
|
@@ -27,19 +27,19 @@
|
|
|
27
27
|
"README.md"
|
|
28
28
|
],
|
|
29
29
|
"peerDependencies": {
|
|
30
|
+
"@tanstack/react-query": "*",
|
|
30
31
|
"msw": "*",
|
|
31
32
|
"react": "*",
|
|
32
33
|
"react-dom": "*",
|
|
33
|
-
"react-error-boundary": "*",
|
|
34
34
|
"react-router-dom": "*"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@swc/core": "1.
|
|
37
|
+
"@swc/core": "1.7.0",
|
|
38
38
|
"@swc/jest": "0.2.36",
|
|
39
|
-
"@testing-library/jest-dom": "6.4.
|
|
40
|
-
"@testing-library/react": "
|
|
39
|
+
"@testing-library/jest-dom": "6.4.6",
|
|
40
|
+
"@testing-library/react": "16.0.0",
|
|
41
41
|
"@types/jest": "29.5.12",
|
|
42
|
-
"@types/react": "18.3.
|
|
42
|
+
"@types/react": "18.3.3",
|
|
43
43
|
"@types/react-dom": "18.3.0",
|
|
44
44
|
"@workleap/eslint-plugin": "3.2.2",
|
|
45
45
|
"@workleap/swc-configs": "2.2.3",
|
|
@@ -48,20 +48,19 @@
|
|
|
48
48
|
"eslint": "8.57.0",
|
|
49
49
|
"jest": "29.7.0",
|
|
50
50
|
"jest-environment-jsdom": "29.7.0",
|
|
51
|
-
"msw": "2.
|
|
51
|
+
"msw": "2.3.1",
|
|
52
52
|
"react": "18.3.1",
|
|
53
53
|
"react-dom": "18.3.1",
|
|
54
|
-
"react-
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"typescript": "5.4.5"
|
|
54
|
+
"react-router-dom": "6.25.1",
|
|
55
|
+
"ts-jest": "29.2.3",
|
|
56
|
+
"tsup": "8.1.2",
|
|
57
|
+
"typescript": "5.5.3"
|
|
59
58
|
},
|
|
60
59
|
"dependencies": {
|
|
61
|
-
"@squide/core": "
|
|
62
|
-
"@squide/module-federation": "
|
|
63
|
-
"@squide/msw": "
|
|
64
|
-
"@squide/react-router": "
|
|
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"
|
|
65
64
|
},
|
|
66
65
|
"sideEffects": false,
|
|
67
66
|
"engines": {
|