@pushwoosh/single-spa 1.3.2 → 1.4.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.
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { type ComponentType } from 'react';
|
|
2
|
+
import type { AppProps } from 'single-spa';
|
|
2
3
|
import { type ReactAppOrParcel } from 'single-spa-react';
|
|
3
4
|
import { type SPAContextType } from '@pushwoosh/spa-context';
|
|
5
|
+
export type ApplicationFunctionResult<T> = ReactAppOrParcel<T> & {
|
|
6
|
+
Application: ComponentType<T & AppProps>;
|
|
7
|
+
};
|
|
4
8
|
export declare function createApplicationFunction<T extends {
|
|
5
9
|
spaContext: SPAContextType;
|
|
6
|
-
}>(Comp: ComponentType<T>):
|
|
10
|
+
}>(Comp: ComponentType<T>): ApplicationFunctionResult<T>;
|
|
@@ -56,9 +56,13 @@ export function createApplicationFunction(Comp) {
|
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
const lifecycles = singleSpaReact({
|
|
60
60
|
React,
|
|
61
61
|
ReactDOMClient,
|
|
62
62
|
rootComponent: AppWrapper
|
|
63
63
|
});
|
|
64
|
+
return {
|
|
65
|
+
...lifecycles,
|
|
66
|
+
Application: AppWrapper
|
|
67
|
+
};
|
|
64
68
|
}
|
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export * from './Parcel';
|
|
2
2
|
export { createParcelFunction } from './createParcelFunction';
|
|
3
|
-
export { createApplicationFunction } from './createApplicationFunction';
|
|
3
|
+
export { type ApplicationFunctionResult, createApplicationFunction } from './createApplicationFunction';
|
|
4
4
|
export { loadModule } from './loadModule';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pushwoosh/single-spa",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "single-spa lifecycle helpers for Pushwoosh micro-frontends: application and parcel factories wrapped in SPAContextProvider",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"@pushwoosh/spa-context": "^3.4.1",
|
|
33
33
|
"@types/react": "^19.3.0",
|
|
34
34
|
"@types/react-dom": "^19.3.0",
|
|
35
|
+
"jsdom": "^26.1.0",
|
|
35
36
|
"react": "^19.3.0",
|
|
36
37
|
"react-dom": "^19.3.0",
|
|
37
38
|
"vitest": "^4.1.10"
|