chayns-api 1.0.25-1 → 1.0.25-3
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.
|
@@ -20,18 +20,7 @@ function loadComponent(scope, module, url, skipCompatMode = false, preventSingle
|
|
|
20
20
|
container
|
|
21
21
|
} = window[scope + "_list"].find(x => x.url === url); // or get the container somewhere else
|
|
22
22
|
// Initialize the container, it may provide shared modules
|
|
23
|
-
|
|
24
|
-
...__webpack_share_scopes__.default
|
|
25
|
-
};
|
|
26
|
-
shareScopes.react = Object.entries(shareScopes.react).filter(([k]) => k === _react.default.version).reduce((p, [k, v]) => {
|
|
27
|
-
p[k] = v;
|
|
28
|
-
return p;
|
|
29
|
-
}, {});
|
|
30
|
-
try {
|
|
31
|
-
await container.init(shareScopes);
|
|
32
|
-
} catch {
|
|
33
|
-
// ignore
|
|
34
|
-
}
|
|
23
|
+
await container.init(__webpack_share_scopes__.default);
|
|
35
24
|
const factory = await container.get(module);
|
|
36
25
|
_useDynamicScript.semaphore[scope].release();
|
|
37
26
|
let ModuleMap = instances[`${scope}__${module}`];
|
|
@@ -61,7 +50,9 @@ function loadComponent(scope, module, url, skipCompatMode = false, preventSingle
|
|
|
61
50
|
requiredVersion,
|
|
62
51
|
environment
|
|
63
52
|
} = Module.default;
|
|
64
|
-
const matchReactVersion = requiredVersion &&
|
|
53
|
+
const matchReactVersion = requiredVersion && Object.keys(__webpack_share_scopes__.default.react).every(version => {
|
|
54
|
+
return _react.default.version === version && _semver.default.satisfies(version, requiredVersion) || !(_semver.default.gt(version, hostVersion) && _semver.default.satisfies(version, requiredVersion));
|
|
55
|
+
});
|
|
65
56
|
if (!matchReactVersion || environment !== 'production') {
|
|
66
57
|
return {
|
|
67
58
|
default: Module.default.CompatComponent
|
|
@@ -15,22 +15,7 @@ export default function loadComponent(scope, module, url) {
|
|
|
15
15
|
container
|
|
16
16
|
} = window[scope + "_list"].find(x => x.url === url); // or get the container somewhere else
|
|
17
17
|
// Initialize the container, it may provide shared modules
|
|
18
|
-
|
|
19
|
-
...__webpack_share_scopes__.default
|
|
20
|
-
};
|
|
21
|
-
shareScopes.react = Object.entries(shareScopes.react).filter(_ref => {
|
|
22
|
-
let [k] = _ref;
|
|
23
|
-
return k === React.version;
|
|
24
|
-
}).reduce((p, _ref2) => {
|
|
25
|
-
let [k, v] = _ref2;
|
|
26
|
-
p[k] = v;
|
|
27
|
-
return p;
|
|
28
|
-
}, {});
|
|
29
|
-
try {
|
|
30
|
-
await container.init(shareScopes);
|
|
31
|
-
} catch {
|
|
32
|
-
// ignore
|
|
33
|
-
}
|
|
18
|
+
await container.init(__webpack_share_scopes__.default);
|
|
34
19
|
const factory = await container.get(module);
|
|
35
20
|
semaphore[scope].release();
|
|
36
21
|
let ModuleMap = instances[`${scope}__${module}`];
|
|
@@ -60,7 +45,9 @@ export default function loadComponent(scope, module, url) {
|
|
|
60
45
|
requiredVersion,
|
|
61
46
|
environment
|
|
62
47
|
} = Module.default;
|
|
63
|
-
const matchReactVersion = requiredVersion &&
|
|
48
|
+
const matchReactVersion = requiredVersion && Object.keys(__webpack_share_scopes__.default.react).every(version => {
|
|
49
|
+
return React.version === version && semver.satisfies(version, requiredVersion) || !(semver.gt(version, hostVersion) && semver.satisfies(version, requiredVersion));
|
|
50
|
+
});
|
|
64
51
|
if (!matchReactVersion || environment !== 'production') {
|
|
65
52
|
return {
|
|
66
53
|
default: Module.default.CompatComponent
|