chayns-api 2.1.3-0 → 2.1.3-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.
|
@@ -54,13 +54,15 @@ const loadComponent = (scope, module, url, skipCompatMode = false, preventSingle
|
|
|
54
54
|
getInstance
|
|
55
55
|
} = globalThis.moduleFederationRuntime;
|
|
56
56
|
const {
|
|
57
|
-
componentMap
|
|
57
|
+
componentMap,
|
|
58
|
+
registeredScopes
|
|
58
59
|
} = globalThis.moduleFederationScopes;
|
|
59
60
|
if (!componentMap[scope]) {
|
|
60
61
|
componentMap[scope] = {};
|
|
61
62
|
}
|
|
62
|
-
if (!(module in componentMap[scope])) {
|
|
63
|
+
if (!(module in componentMap[scope]) || registeredScopes[scope] !== url) {
|
|
63
64
|
const promise = loadModule(scope, module, url, preventSingleton).then(async Module => {
|
|
65
|
+
var _sharedReact$lib;
|
|
64
66
|
if (typeof Module.default === 'function') {
|
|
65
67
|
return Module;
|
|
66
68
|
}
|
|
@@ -79,15 +81,8 @@ const loadComponent = (scope, module, url, skipCompatMode = false, preventSingle
|
|
|
79
81
|
}
|
|
80
82
|
});
|
|
81
83
|
});
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
useIn,
|
|
85
|
-
version
|
|
86
|
-
}) => {
|
|
87
|
-
if (!useIn.includes(scope)) return false;
|
|
88
|
-
if (version !== _react.default.version) return false;
|
|
89
|
-
return (lib === null || lib === void 0 ? void 0 : lib()) === _react.default;
|
|
90
|
-
});
|
|
84
|
+
const sharedReact = shareScopes['chayns-api'].react[_react.default.version];
|
|
85
|
+
const matchReactVersion = sharedReact && sharedReact.useIn.includes(scope) && ((_sharedReact$lib = sharedReact.lib) === null || _sharedReact$lib === void 0 ? void 0 : _sharedReact$lib.call(sharedReact)) === _react.default;
|
|
91
86
|
if (!matchReactVersion || (Module.default.version || 1) < 2) {
|
|
92
87
|
const OriginalCompatComponent = (Module.default.version || 1) < 2.1 ? Module.default.CompatComponent.render({}).type.prototype : Module.default.CompatComponent.prototype;
|
|
93
88
|
class CompatComponent extends _react.default.Component {
|
|
@@ -49,13 +49,15 @@ const loadComponent = function (scope, module, url) {
|
|
|
49
49
|
getInstance
|
|
50
50
|
} = globalThis.moduleFederationRuntime;
|
|
51
51
|
const {
|
|
52
|
-
componentMap
|
|
52
|
+
componentMap,
|
|
53
|
+
registeredScopes
|
|
53
54
|
} = globalThis.moduleFederationScopes;
|
|
54
55
|
if (!componentMap[scope]) {
|
|
55
56
|
componentMap[scope] = {};
|
|
56
57
|
}
|
|
57
|
-
if (!(module in componentMap[scope])) {
|
|
58
|
+
if (!(module in componentMap[scope]) || registeredScopes[scope] !== url) {
|
|
58
59
|
const promise = loadModule(scope, module, url, preventSingleton).then(async Module => {
|
|
60
|
+
var _sharedReact$lib;
|
|
59
61
|
if (typeof Module.default === 'function') {
|
|
60
62
|
return Module;
|
|
61
63
|
}
|
|
@@ -74,16 +76,8 @@ const loadComponent = function (scope, module, url) {
|
|
|
74
76
|
}
|
|
75
77
|
});
|
|
76
78
|
});
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
lib,
|
|
80
|
-
useIn,
|
|
81
|
-
version
|
|
82
|
-
} = _ref;
|
|
83
|
-
if (!useIn.includes(scope)) return false;
|
|
84
|
-
if (version !== React.version) return false;
|
|
85
|
-
return (lib === null || lib === void 0 ? void 0 : lib()) === React;
|
|
86
|
-
});
|
|
79
|
+
const sharedReact = shareScopes['chayns-api'].react[React.version];
|
|
80
|
+
const matchReactVersion = sharedReact && sharedReact.useIn.includes(scope) && ((_sharedReact$lib = sharedReact.lib) === null || _sharedReact$lib === void 0 ? void 0 : _sharedReact$lib.call(sharedReact)) === React;
|
|
87
81
|
if (!matchReactVersion || (Module.default.version || 1) < 2) {
|
|
88
82
|
const OriginalCompatComponent = (Module.default.version || 1) < 2.1 ? Module.default.CompatComponent.render({}).type.prototype : Module.default.CompatComponent.prototype;
|
|
89
83
|
class CompatComponent extends React.Component {
|