chayns-api 2.4.23 → 2.4.24
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.
|
@@ -7,6 +7,9 @@ exports.loadModule = exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
9
|
const loadModule = (scope, module, url, preventSingleton = false) => {
|
|
10
|
+
if (!globalThis.moduleFederationRuntime || !globalThis.moduleFederationScopes) {
|
|
11
|
+
throw new Error('[chayns-api] moduleFederationSharing has not been initialized. Make sure to call initModuleFederationSharing.');
|
|
12
|
+
}
|
|
10
13
|
const {
|
|
11
14
|
loadRemote,
|
|
12
15
|
registerRemotes
|
|
@@ -51,6 +54,9 @@ const loadComponent = (scope, module, url, skipCompatMode = false, preventSingle
|
|
|
51
54
|
if (skipCompatMode) {
|
|
52
55
|
console.warn('[chayns-api] skipCompatMode-option is deprecated and is set automatically now');
|
|
53
56
|
}
|
|
57
|
+
if (!globalThis.moduleFederationRuntime || !globalThis.moduleFederationScopes) {
|
|
58
|
+
throw new Error('[chayns-api] moduleFederationSharing has not been initialized. Make sure to call initModuleFederationSharing.');
|
|
59
|
+
}
|
|
54
60
|
const {
|
|
55
61
|
loadShareSync,
|
|
56
62
|
getInstance
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export const loadModule = function (scope, module, url) {
|
|
3
3
|
let preventSingleton = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
4
|
+
if (!globalThis.moduleFederationRuntime || !globalThis.moduleFederationScopes) {
|
|
5
|
+
throw new Error('[chayns-api] moduleFederationSharing has not been initialized. Make sure to call initModuleFederationSharing.');
|
|
6
|
+
}
|
|
4
7
|
const {
|
|
5
8
|
loadRemote,
|
|
6
9
|
registerRemotes
|
|
@@ -46,6 +49,9 @@ const loadComponent = function (scope, module, url) {
|
|
|
46
49
|
if (skipCompatMode) {
|
|
47
50
|
console.warn('[chayns-api] skipCompatMode-option is deprecated and is set automatically now');
|
|
48
51
|
}
|
|
52
|
+
if (!globalThis.moduleFederationRuntime || !globalThis.moduleFederationScopes) {
|
|
53
|
+
throw new Error('[chayns-api] moduleFederationSharing has not been initialized. Make sure to call initModuleFederationSharing.');
|
|
54
|
+
}
|
|
49
55
|
const {
|
|
50
56
|
loadShareSync,
|
|
51
57
|
getInstance
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const loadModule: (scope:
|
|
2
|
-
declare const loadComponent: (scope:
|
|
1
|
+
export declare const loadModule: (scope: string, module: string, url: string, preventSingleton?: boolean) => any;
|
|
2
|
+
declare const loadComponent: (scope: string, module: string, url: string, skipCompatMode?: boolean, preventSingleton?: boolean) => any;
|
|
3
3
|
export default loadComponent;
|