chayns-api 2.6.4 → 2.6.5
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.
|
@@ -13,9 +13,11 @@ try {
|
|
|
13
13
|
ReactDOMClient = require('react-dom/client');
|
|
14
14
|
} catch (e) {}
|
|
15
15
|
const initModuleFederationSharing = ({
|
|
16
|
+
scope,
|
|
16
17
|
name,
|
|
17
18
|
plugins = []
|
|
18
19
|
}) => {
|
|
20
|
+
var _ref;
|
|
19
21
|
if (globalThis.moduleFederationScopes) {
|
|
20
22
|
return;
|
|
21
23
|
}
|
|
@@ -42,7 +44,7 @@ const initModuleFederationSharing = ({
|
|
|
42
44
|
};
|
|
43
45
|
}
|
|
44
46
|
const instance = createInstance({
|
|
45
|
-
name:
|
|
47
|
+
name: (_ref = scope !== null && scope !== void 0 ? scope : name) !== null && _ref !== void 0 ? _ref : '',
|
|
46
48
|
remotes: [],
|
|
47
49
|
shared,
|
|
48
50
|
plugins: [(0, _SequentialLoadPlugin.SequentialLoadPlugin)(), ...plugins]
|
|
@@ -6,9 +6,11 @@ try {
|
|
|
6
6
|
ReactDOMClient = require('react-dom/client');
|
|
7
7
|
} catch (e) {}
|
|
8
8
|
export const initModuleFederationSharing = ({
|
|
9
|
+
scope,
|
|
9
10
|
name,
|
|
10
11
|
plugins = []
|
|
11
12
|
}) => {
|
|
13
|
+
var _ref;
|
|
12
14
|
if (globalThis.moduleFederationScopes) {
|
|
13
15
|
return;
|
|
14
16
|
}
|
|
@@ -35,7 +37,7 @@ export const initModuleFederationSharing = ({
|
|
|
35
37
|
};
|
|
36
38
|
}
|
|
37
39
|
const instance = createInstance({
|
|
38
|
-
name:
|
|
40
|
+
name: (_ref = scope !== null && scope !== void 0 ? scope : name) !== null && _ref !== void 0 ? _ref : '',
|
|
39
41
|
remotes: [],
|
|
40
42
|
shared,
|
|
41
43
|
plugins: [SequentialLoadPlugin(), ...plugins]
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { ModuleFederationRuntimePlugin } from '@module-federation/enhanced/runtime';
|
|
2
|
+
export declare const initModuleFederationSharing: ({ scope, name, plugins }: {
|
|
3
|
+
/**
|
|
4
|
+
* Module Federation scope; should be identical to the package name in package.json, formatted in snake_case.
|
|
5
|
+
*/
|
|
6
|
+
scope: string;
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated use `scope` instead
|
|
9
|
+
*/
|
|
10
|
+
name?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Additional runtime plugins
|
|
13
|
+
*/
|
|
14
|
+
plugins: ModuleFederationRuntimePlugin[];
|
|
4
15
|
}) => void;
|