@squide/firefly 3.0.0 → 3.0.2
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 +15 -0
- package/dist/AppRouter.d.ts +2 -2
- package/dist/AppRouter.js +1 -1
- package/dist/{chunk-GSHD4LQA.js → chunk-MKFAFYJH.js} +17 -6
- package/dist/defineConfig.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @squide/firefly
|
|
2
2
|
|
|
3
|
+
## 3.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#122](https://github.com/gsoft-inc/wl-squide/pull/122) [`cda7873`](https://github.com/gsoft-inc/wl-squide/commit/cda7873dcffbf424a625cf40c56a12eacbb2632e) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Internal minor changes
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`cda7873`](https://github.com/gsoft-inc/wl-squide/commit/cda7873dcffbf424a625cf40c56a12eacbb2632e)]:
|
|
10
|
+
- @squide/msw@2.0.6
|
|
11
|
+
|
|
12
|
+
## 3.0.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#118](https://github.com/gsoft-inc/wl-squide/pull/118) [`4864d30`](https://github.com/gsoft-inc/wl-squide/commit/4864d30764021a91d5827abb5b3ae7a4b4302c31) Thanks [@tjosepo](https://github.com/tjosepo)! - Omit "router" from routerProviderProps
|
|
17
|
+
|
|
3
18
|
## 3.0.0
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
package/dist/AppRouter.d.ts
CHANGED
|
@@ -22,8 +22,8 @@ interface AppRouterProps {
|
|
|
22
22
|
onLoadProtectedData?: OnLoadProtectedDataFunction;
|
|
23
23
|
onCompleteRegistrations?: OnCompleteRegistrationsFunction;
|
|
24
24
|
waitForMsw: boolean;
|
|
25
|
-
routerProvidersProps?: RouterProviderProps
|
|
25
|
+
routerProvidersProps?: Omit<RouterProviderProps, "router">;
|
|
26
26
|
}
|
|
27
27
|
declare function AppRouter(props: AppRouterProps): react_jsx_runtime.JSX.Element;
|
|
28
28
|
|
|
29
|
-
export { AppRouter, AppRouterProps, BootstrappingRoute, OnCompleteRegistrationsFunction, OnLoadProtectedDataFunction, OnLoadPublicDataFunction };
|
|
29
|
+
export { AppRouter, type AppRouterProps, BootstrappingRoute, type OnCompleteRegistrationsFunction, type OnLoadProtectedDataFunction, type OnLoadPublicDataFunction };
|
package/dist/AppRouter.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { AppRouter, BootstrappingRoute } from './chunk-
|
|
1
|
+
export { AppRouter, BootstrappingRoute } from './chunk-MKFAFYJH.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useLogger } from '@squide/core';
|
|
1
|
+
import { useLogger, isNil } from '@squide/core';
|
|
2
2
|
import { useIsMswStarted } from '@squide/msw';
|
|
3
3
|
import { useIsRouteMatchProtected, useRoutes } from '@squide/react-router';
|
|
4
4
|
import { useAreModulesRegistered, useAreModulesReady } from '@squide/webpack-module-federation';
|
|
@@ -8,6 +8,9 @@ import { useLocation, Outlet, createBrowserRouter, RouterProvider } from 'react-
|
|
|
8
8
|
import { jsx } from 'react/jsx-runtime';
|
|
9
9
|
|
|
10
10
|
// src/AppRouter.tsx
|
|
11
|
+
function isPromise(value) {
|
|
12
|
+
return !isNil(value) && !isNil(value.then) && !isNil(value.catch);
|
|
13
|
+
}
|
|
11
14
|
function BootstrappingRoute(props) {
|
|
12
15
|
const {
|
|
13
16
|
fallbackElement,
|
|
@@ -38,7 +41,11 @@ function BootstrappingRoute(props) {
|
|
|
38
41
|
if ((areModulesRegistered || areModulesReady) && isMswStarted) {
|
|
39
42
|
if (!isPublicDataLoaded) {
|
|
40
43
|
logger.debug("[shell] Loading public data.");
|
|
41
|
-
onLoadPublicData()
|
|
44
|
+
const result = onLoadPublicData();
|
|
45
|
+
if (!isPromise(result)) {
|
|
46
|
+
throw Error("[squide] An AppRouter onLoadPublicData handler must return a promise object.");
|
|
47
|
+
}
|
|
48
|
+
result.then(() => {
|
|
42
49
|
setIsPublicDataLoaded(true);
|
|
43
50
|
logger.debug("[shell] Public data has been loaded.");
|
|
44
51
|
}).catch((error) => {
|
|
@@ -47,7 +54,7 @@ function BootstrappingRoute(props) {
|
|
|
47
54
|
}
|
|
48
55
|
}
|
|
49
56
|
}
|
|
50
|
-
}, [logger, areModulesRegistered, areModulesReady, isMswStarted, isPublicDataLoaded, onLoadPublicData]);
|
|
57
|
+
}, [logger, areModulesRegistered, areModulesReady, isMswStarted, isPublicDataLoaded, showBoundary, onLoadPublicData]);
|
|
51
58
|
const isActiveRouteProtected = useIsRouteMatchProtected(location, { throwWhenThereIsNoMatch: areModulesReady });
|
|
52
59
|
useEffect(() => {
|
|
53
60
|
if (onLoadProtectedData) {
|
|
@@ -55,7 +62,11 @@ function BootstrappingRoute(props) {
|
|
|
55
62
|
if (isActiveRouteProtected) {
|
|
56
63
|
if (!isProtectedDataLoaded) {
|
|
57
64
|
logger.debug(`[shell] Loading protected data as "${location.pathname}" is a protected route.`);
|
|
58
|
-
onLoadProtectedData()
|
|
65
|
+
const result = onLoadProtectedData();
|
|
66
|
+
if (!isPromise(result)) {
|
|
67
|
+
throw Error("[squide] An AppRouter onLoadProtectedData handler must return a promise object.");
|
|
68
|
+
}
|
|
69
|
+
result.then(() => {
|
|
59
70
|
setIsProtectedDataLoaded(true);
|
|
60
71
|
logger.debug("[shell] Protected data has been loaded.");
|
|
61
72
|
}).catch((error) => {
|
|
@@ -67,7 +78,7 @@ function BootstrappingRoute(props) {
|
|
|
67
78
|
}
|
|
68
79
|
}
|
|
69
80
|
}
|
|
70
|
-
}, [logger, location, areModulesRegistered, areModulesReady, isMswStarted, isActiveRouteProtected, isProtectedDataLoaded, onLoadProtectedData]);
|
|
81
|
+
}, [logger, location, areModulesRegistered, areModulesReady, isMswStarted, isActiveRouteProtected, isProtectedDataLoaded, showBoundary, onLoadProtectedData]);
|
|
71
82
|
useEffect(() => {
|
|
72
83
|
if (onCompleteRegistrations) {
|
|
73
84
|
if (areModulesRegistered && isMswStarted && isPublicDataLoaded) {
|
|
@@ -118,7 +129,7 @@ function AppRouter(props) {
|
|
|
118
129
|
children: routes
|
|
119
130
|
}
|
|
120
131
|
]);
|
|
121
|
-
}, [areModulesRegistered, areModulesReady, routes, onLoadPublicData, onLoadProtectedData, onCompleteRegistrations, waitForMsw]);
|
|
132
|
+
}, [areModulesRegistered, areModulesReady, routes, onLoadPublicData, onLoadProtectedData, onCompleteRegistrations, waitForMsw, errorRenderer, fallbackElement]);
|
|
122
133
|
return /* @__PURE__ */ jsx(RouterProvider, { ...routerProvidersProps, router });
|
|
123
134
|
}
|
|
124
135
|
|
package/dist/defineConfig.d.ts
CHANGED
|
@@ -21,4 +21,4 @@ interface FireflyDefineBuildRemoteModuleConfigOptions extends DefineBuildRemoteM
|
|
|
21
21
|
}
|
|
22
22
|
declare function defineBuildRemoteModuleConfig(swcConfig: SwcConfig, applicationName: string, { features, ...otherOptions }?: FireflyDefineBuildRemoteModuleConfigOptions): webpack.Configuration;
|
|
23
23
|
|
|
24
|
-
export { FireflyDefineBuildHostConfigOptions, FireflyDefineBuildRemoteModuleConfigOptions, FireflyDefineDevHostConfigOptions, FireflyDefineDevRemoteModuleConfigOptions, FireflyFeatures, defineBuildHostConfig, defineBuildRemoteModuleConfig, defineDevHostConfig, defineDevRemoteModuleConfig };
|
|
24
|
+
export { type FireflyDefineBuildHostConfigOptions, type FireflyDefineBuildRemoteModuleConfigOptions, type FireflyDefineDevHostConfigOptions, type FireflyDefineDevRemoteModuleConfigOptions, type FireflyFeatures, defineBuildHostConfig, defineBuildRemoteModuleConfig, defineDevHostConfig, defineDevRemoteModuleConfig };
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@squide/firefly",
|
|
3
3
|
"author": "Workleap",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.2",
|
|
5
5
|
"description": "Helpers to facilitate the creation of a shell package with Squide firefly technology stack.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
@@ -64,14 +64,14 @@
|
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@swc/core": "1.3.
|
|
67
|
+
"@swc/core": "1.3.99",
|
|
68
68
|
"@swc/helpers": "0.5.3",
|
|
69
69
|
"@swc/jest": "0.2.29",
|
|
70
70
|
"@testing-library/jest-dom": "6.1.4",
|
|
71
|
-
"@testing-library/react": "14.
|
|
72
|
-
"@types/jest": "29.5.
|
|
73
|
-
"@types/react": "18.2.
|
|
74
|
-
"@types/react-dom": "18.2.
|
|
71
|
+
"@testing-library/react": "14.1.2",
|
|
72
|
+
"@types/jest": "29.5.10",
|
|
73
|
+
"@types/react": "18.2.39",
|
|
74
|
+
"@types/react-dom": "18.2.17",
|
|
75
75
|
"@workleap/eslint-plugin": "3.0.0",
|
|
76
76
|
"@workleap/swc-configs": "2.1.2",
|
|
77
77
|
"@workleap/tsup-configs": "3.0.1",
|
|
@@ -79,20 +79,20 @@
|
|
|
79
79
|
"@workleap/webpack-configs": "1.2.1",
|
|
80
80
|
"jest": "29.7.0",
|
|
81
81
|
"jest-environment-jsdom": "29.7.0",
|
|
82
|
-
"msw": "2.0.
|
|
82
|
+
"msw": "2.0.9",
|
|
83
83
|
"react": "18.2.0",
|
|
84
84
|
"react-dom": "18.2.0",
|
|
85
85
|
"react-error-boundary": "4.0.11",
|
|
86
|
-
"react-router-dom": "6.
|
|
86
|
+
"react-router-dom": "6.20.0",
|
|
87
87
|
"ts-jest": "29.1.1",
|
|
88
|
-
"tsup": "
|
|
88
|
+
"tsup": "8.0.1",
|
|
89
89
|
"typescript": "5.2.2",
|
|
90
90
|
"webpack": "5.89.0",
|
|
91
91
|
"@squide/webpack-configs": "1.1.0"
|
|
92
92
|
},
|
|
93
93
|
"dependencies": {
|
|
94
94
|
"@squide/core": "3.1.0",
|
|
95
|
-
"@squide/msw": "2.0.
|
|
95
|
+
"@squide/msw": "2.0.6",
|
|
96
96
|
"@squide/react-router": "3.0.1",
|
|
97
97
|
"@squide/webpack-module-federation": "3.0.1"
|
|
98
98
|
},
|