@module-federation/utilities 3.1.15 → 3.1.16
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.
- package/dist/index.cjs.js +23 -11
- package/dist/index.esm.js +23 -11
- package/dist/package.json +1 -1
- package/package.json +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -38,6 +38,10 @@ function _non_iterable_rest$3() {
|
|
|
38
38
|
function _sliced_to_array$3(arr, i) {
|
|
39
39
|
return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$3(arr, i) || _non_iterable_rest$3();
|
|
40
40
|
}
|
|
41
|
+
function _type_of$2(obj) {
|
|
42
|
+
"@swc/helpers - typeof";
|
|
43
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
44
|
+
}
|
|
41
45
|
function _unsupported_iterable_to_array$3(o, minLen) {
|
|
42
46
|
if (!o) return;
|
|
43
47
|
if (typeof o === "string") return _array_like_to_array$3(o, minLen);
|
|
@@ -146,7 +150,7 @@ var loadScript = function(keyOrRuntimeRemoteItem) {
|
|
|
146
150
|
var getRuntimeRemotes$1 = function() {
|
|
147
151
|
return Object.entries(remoteVars).reduce(function(acc, param) {
|
|
148
152
|
var _param = _sliced_to_array$3(param, 2), key = _param[0], value = _param[1];
|
|
149
|
-
if (typeof value === 'object' && typeof value.then === 'function') {
|
|
153
|
+
if ((typeof value === "undefined" ? "undefined" : _type_of$2(value)) === 'object' && typeof value.then === 'function') {
|
|
150
154
|
acc[key] = {
|
|
151
155
|
asyncContainer: value
|
|
152
156
|
};
|
|
@@ -249,6 +253,10 @@ function _non_iterable_rest$2() {
|
|
|
249
253
|
function _sliced_to_array$2(arr, i) {
|
|
250
254
|
return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$2(arr, i) || _non_iterable_rest$2();
|
|
251
255
|
}
|
|
256
|
+
function _type_of$1(obj) {
|
|
257
|
+
"@swc/helpers - typeof";
|
|
258
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
259
|
+
}
|
|
252
260
|
function _unsupported_iterable_to_array$2(o, minLen) {
|
|
253
261
|
if (!o) return;
|
|
254
262
|
if (typeof o === "string") return _array_like_to_array$2(o, minLen);
|
|
@@ -386,7 +394,7 @@ var createContainerSharingScope = function(asyncContainer) {
|
|
|
386
394
|
* { global, url } - values obtained from webpack remotes option `global@url`
|
|
387
395
|
* or
|
|
388
396
|
* { asyncContainer } - async container is a promise that resolves to the remote container
|
|
389
|
-
*/ var injectScript = function() {
|
|
397
|
+
*/ var injectScript = /*#__PURE__*/ function() {
|
|
390
398
|
var _ref = _async_to_generator$2(function(keyOrRuntimeRemoteItem) {
|
|
391
399
|
var asyncContainer;
|
|
392
400
|
return _ts_generator$2(this, function(_state) {
|
|
@@ -425,7 +433,7 @@ var createContainerSharingScope = function(asyncContainer) {
|
|
|
425
433
|
/**
|
|
426
434
|
* Returns initialized webpack RemoteContainer.
|
|
427
435
|
* If its' script does not loaded - then load & init it firstly.
|
|
428
|
-
*/ var getContainer = function() {
|
|
436
|
+
*/ var getContainer = /*#__PURE__*/ function() {
|
|
429
437
|
var _ref = _async_to_generator$2(function(remoteContainer) {
|
|
430
438
|
var containerScope, containerKey, container;
|
|
431
439
|
return _ts_generator$2(this, function(_state) {
|
|
@@ -481,7 +489,7 @@ var createContainerSharingScope = function(asyncContainer) {
|
|
|
481
489
|
*
|
|
482
490
|
* @example
|
|
483
491
|
* remote.getModule('./pages/index', 'default')
|
|
484
|
-
*/ var getModule = function() {
|
|
492
|
+
*/ var getModule = /*#__PURE__*/ function() {
|
|
485
493
|
var _ref = _async_to_generator$2(function(param) {
|
|
486
494
|
var remoteContainer, modulePath, exportName, container, modFactory, mod, error;
|
|
487
495
|
return _ts_generator$2(this, function(_state) {
|
|
@@ -518,7 +526,7 @@ var createContainerSharingScope = function(asyncContainer) {
|
|
|
518
526
|
if (exportName) {
|
|
519
527
|
return [
|
|
520
528
|
2,
|
|
521
|
-
mod && typeof mod === 'object' ? mod[exportName] : undefined
|
|
529
|
+
mod && (typeof mod === "undefined" ? "undefined" : _type_of$1(mod)) === 'object' ? mod[exportName] : undefined
|
|
522
530
|
];
|
|
523
531
|
} else {
|
|
524
532
|
return [
|
|
@@ -798,7 +806,7 @@ function _ts_generator$1(thisArg, body) {
|
|
|
798
806
|
}, scope);
|
|
799
807
|
});
|
|
800
808
|
};
|
|
801
|
-
var loadEsmRemote = function() {
|
|
809
|
+
var loadEsmRemote = /*#__PURE__*/ function() {
|
|
802
810
|
var _ref = _async_to_generator$1(function(url, scope) {
|
|
803
811
|
var module;
|
|
804
812
|
return _ts_generator$1(this, function(_state) {
|
|
@@ -831,7 +839,7 @@ var loadEsmRemote = function() {
|
|
|
831
839
|
* Function to initialize sharing
|
|
832
840
|
* @async
|
|
833
841
|
* @function
|
|
834
|
-
*/ var initSharing = function() {
|
|
842
|
+
*/ var initSharing = /*#__PURE__*/ function() {
|
|
835
843
|
var _ref = _async_to_generator$1(function() {
|
|
836
844
|
var webpackShareScopes;
|
|
837
845
|
return _ts_generator$1(this, function(_state) {
|
|
@@ -865,7 +873,7 @@ var loadEsmRemote = function() {
|
|
|
865
873
|
* @async
|
|
866
874
|
* @function
|
|
867
875
|
* @param {WebpackRemoteContainer} containerScope - The container scope
|
|
868
|
-
*/ var initContainer = function() {
|
|
876
|
+
*/ var initContainer = /*#__PURE__*/ function() {
|
|
869
877
|
var _ref = _async_to_generator$1(function(containerScope) {
|
|
870
878
|
var webpackShareScopes, error;
|
|
871
879
|
return _ts_generator$1(this, function(_state) {
|
|
@@ -921,7 +929,7 @@ var loadEsmRemote = function() {
|
|
|
921
929
|
* @function
|
|
922
930
|
* @param {ImportRemoteOptions} options - The options for importing the remote
|
|
923
931
|
* @returns {Promise<T>} A promise that resolves with the imported module
|
|
924
|
-
*/ var importRemote = function() {
|
|
932
|
+
*/ var importRemote = /*#__PURE__*/ function() {
|
|
925
933
|
var _ref = _async_to_generator$1(function(param) {
|
|
926
934
|
var url, scope, module, _param_remoteEntryFileName, remoteEntryFileName, _param_bustRemoteEntryCache, bustRemoteEntryCache, _param_esm, esm, remoteScope, remoteUrl, remoteUrlWithEntryFile, asyncContainer, _ref, moduleFactory, moduleFactory1;
|
|
927
935
|
return _ts_generator$1(this, function(_state) {
|
|
@@ -1098,6 +1106,10 @@ function _non_iterable_rest() {
|
|
|
1098
1106
|
function _sliced_to_array(arr, i) {
|
|
1099
1107
|
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
1100
1108
|
}
|
|
1109
|
+
function _type_of(obj) {
|
|
1110
|
+
"@swc/helpers - typeof";
|
|
1111
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
1112
|
+
}
|
|
1101
1113
|
function _unsupported_iterable_to_array(o, minLen) {
|
|
1102
1114
|
if (!o) return;
|
|
1103
1115
|
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
@@ -1111,7 +1123,7 @@ var getRuntimeRemotes = function() {
|
|
|
1111
1123
|
return Object.entries(remoteVars).reduce(function(acc, item) {
|
|
1112
1124
|
var _item = _sliced_to_array(item, 2), key = _item[0], value = _item[1];
|
|
1113
1125
|
// if its an object with a thenable (eagerly executing function)
|
|
1114
|
-
if (typeof value === 'object' && typeof value.then === 'function') {
|
|
1126
|
+
if ((typeof value === "undefined" ? "undefined" : _type_of(value)) === 'object' && typeof value.then === 'function') {
|
|
1115
1127
|
acc[key] = {
|
|
1116
1128
|
asyncContainer: value
|
|
1117
1129
|
};
|
|
@@ -1275,7 +1287,7 @@ function _ts_generator(thisArg, body) {
|
|
|
1275
1287
|
};
|
|
1276
1288
|
}
|
|
1277
1289
|
}
|
|
1278
|
-
var importDelegatedModule = function() {
|
|
1290
|
+
var importDelegatedModule = /*#__PURE__*/ function() {
|
|
1279
1291
|
var _ref = _async_to_generator(function(keyOrRuntimeRemoteItem) {
|
|
1280
1292
|
return _ts_generator(this, function(_state) {
|
|
1281
1293
|
// @ts-ignore
|
package/dist/index.esm.js
CHANGED
|
@@ -36,6 +36,10 @@ function _non_iterable_rest$3() {
|
|
|
36
36
|
function _sliced_to_array$3(arr, i) {
|
|
37
37
|
return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$3(arr, i) || _non_iterable_rest$3();
|
|
38
38
|
}
|
|
39
|
+
function _type_of$2(obj) {
|
|
40
|
+
"@swc/helpers - typeof";
|
|
41
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
42
|
+
}
|
|
39
43
|
function _unsupported_iterable_to_array$3(o, minLen) {
|
|
40
44
|
if (!o) return;
|
|
41
45
|
if (typeof o === "string") return _array_like_to_array$3(o, minLen);
|
|
@@ -144,7 +148,7 @@ var loadScript = function(keyOrRuntimeRemoteItem) {
|
|
|
144
148
|
var getRuntimeRemotes$1 = function() {
|
|
145
149
|
return Object.entries(remoteVars).reduce(function(acc, param) {
|
|
146
150
|
var _param = _sliced_to_array$3(param, 2), key = _param[0], value = _param[1];
|
|
147
|
-
if (typeof value === 'object' && typeof value.then === 'function') {
|
|
151
|
+
if ((typeof value === "undefined" ? "undefined" : _type_of$2(value)) === 'object' && typeof value.then === 'function') {
|
|
148
152
|
acc[key] = {
|
|
149
153
|
asyncContainer: value
|
|
150
154
|
};
|
|
@@ -247,6 +251,10 @@ function _non_iterable_rest$2() {
|
|
|
247
251
|
function _sliced_to_array$2(arr, i) {
|
|
248
252
|
return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$2(arr, i) || _non_iterable_rest$2();
|
|
249
253
|
}
|
|
254
|
+
function _type_of$1(obj) {
|
|
255
|
+
"@swc/helpers - typeof";
|
|
256
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
257
|
+
}
|
|
250
258
|
function _unsupported_iterable_to_array$2(o, minLen) {
|
|
251
259
|
if (!o) return;
|
|
252
260
|
if (typeof o === "string") return _array_like_to_array$2(o, minLen);
|
|
@@ -384,7 +392,7 @@ var createContainerSharingScope = function(asyncContainer) {
|
|
|
384
392
|
* { global, url } - values obtained from webpack remotes option `global@url`
|
|
385
393
|
* or
|
|
386
394
|
* { asyncContainer } - async container is a promise that resolves to the remote container
|
|
387
|
-
*/ var injectScript = function() {
|
|
395
|
+
*/ var injectScript = /*#__PURE__*/ function() {
|
|
388
396
|
var _ref = _async_to_generator$2(function(keyOrRuntimeRemoteItem) {
|
|
389
397
|
var asyncContainer;
|
|
390
398
|
return _ts_generator$2(this, function(_state) {
|
|
@@ -423,7 +431,7 @@ var createContainerSharingScope = function(asyncContainer) {
|
|
|
423
431
|
/**
|
|
424
432
|
* Returns initialized webpack RemoteContainer.
|
|
425
433
|
* If its' script does not loaded - then load & init it firstly.
|
|
426
|
-
*/ var getContainer = function() {
|
|
434
|
+
*/ var getContainer = /*#__PURE__*/ function() {
|
|
427
435
|
var _ref = _async_to_generator$2(function(remoteContainer) {
|
|
428
436
|
var containerScope, containerKey, container;
|
|
429
437
|
return _ts_generator$2(this, function(_state) {
|
|
@@ -479,7 +487,7 @@ var createContainerSharingScope = function(asyncContainer) {
|
|
|
479
487
|
*
|
|
480
488
|
* @example
|
|
481
489
|
* remote.getModule('./pages/index', 'default')
|
|
482
|
-
*/ var getModule = function() {
|
|
490
|
+
*/ var getModule = /*#__PURE__*/ function() {
|
|
483
491
|
var _ref = _async_to_generator$2(function(param) {
|
|
484
492
|
var remoteContainer, modulePath, exportName, container, modFactory, mod, error;
|
|
485
493
|
return _ts_generator$2(this, function(_state) {
|
|
@@ -516,7 +524,7 @@ var createContainerSharingScope = function(asyncContainer) {
|
|
|
516
524
|
if (exportName) {
|
|
517
525
|
return [
|
|
518
526
|
2,
|
|
519
|
-
mod && typeof mod === 'object' ? mod[exportName] : undefined
|
|
527
|
+
mod && (typeof mod === "undefined" ? "undefined" : _type_of$1(mod)) === 'object' ? mod[exportName] : undefined
|
|
520
528
|
];
|
|
521
529
|
} else {
|
|
522
530
|
return [
|
|
@@ -796,7 +804,7 @@ function _ts_generator$1(thisArg, body) {
|
|
|
796
804
|
}, scope);
|
|
797
805
|
});
|
|
798
806
|
};
|
|
799
|
-
var loadEsmRemote = function() {
|
|
807
|
+
var loadEsmRemote = /*#__PURE__*/ function() {
|
|
800
808
|
var _ref = _async_to_generator$1(function(url, scope) {
|
|
801
809
|
var module;
|
|
802
810
|
return _ts_generator$1(this, function(_state) {
|
|
@@ -829,7 +837,7 @@ var loadEsmRemote = function() {
|
|
|
829
837
|
* Function to initialize sharing
|
|
830
838
|
* @async
|
|
831
839
|
* @function
|
|
832
|
-
*/ var initSharing = function() {
|
|
840
|
+
*/ var initSharing = /*#__PURE__*/ function() {
|
|
833
841
|
var _ref = _async_to_generator$1(function() {
|
|
834
842
|
var webpackShareScopes;
|
|
835
843
|
return _ts_generator$1(this, function(_state) {
|
|
@@ -863,7 +871,7 @@ var loadEsmRemote = function() {
|
|
|
863
871
|
* @async
|
|
864
872
|
* @function
|
|
865
873
|
* @param {WebpackRemoteContainer} containerScope - The container scope
|
|
866
|
-
*/ var initContainer = function() {
|
|
874
|
+
*/ var initContainer = /*#__PURE__*/ function() {
|
|
867
875
|
var _ref = _async_to_generator$1(function(containerScope) {
|
|
868
876
|
var webpackShareScopes, error;
|
|
869
877
|
return _ts_generator$1(this, function(_state) {
|
|
@@ -919,7 +927,7 @@ var loadEsmRemote = function() {
|
|
|
919
927
|
* @function
|
|
920
928
|
* @param {ImportRemoteOptions} options - The options for importing the remote
|
|
921
929
|
* @returns {Promise<T>} A promise that resolves with the imported module
|
|
922
|
-
*/ var importRemote = function() {
|
|
930
|
+
*/ var importRemote = /*#__PURE__*/ function() {
|
|
923
931
|
var _ref = _async_to_generator$1(function(param) {
|
|
924
932
|
var url, scope, module, _param_remoteEntryFileName, remoteEntryFileName, _param_bustRemoteEntryCache, bustRemoteEntryCache, _param_esm, esm, remoteScope, remoteUrl, remoteUrlWithEntryFile, asyncContainer, _ref, moduleFactory, moduleFactory1;
|
|
925
933
|
return _ts_generator$1(this, function(_state) {
|
|
@@ -1096,6 +1104,10 @@ function _non_iterable_rest() {
|
|
|
1096
1104
|
function _sliced_to_array(arr, i) {
|
|
1097
1105
|
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
1098
1106
|
}
|
|
1107
|
+
function _type_of(obj) {
|
|
1108
|
+
"@swc/helpers - typeof";
|
|
1109
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
1110
|
+
}
|
|
1099
1111
|
function _unsupported_iterable_to_array(o, minLen) {
|
|
1100
1112
|
if (!o) return;
|
|
1101
1113
|
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
@@ -1109,7 +1121,7 @@ var getRuntimeRemotes = function() {
|
|
|
1109
1121
|
return Object.entries(remoteVars).reduce(function(acc, item) {
|
|
1110
1122
|
var _item = _sliced_to_array(item, 2), key = _item[0], value = _item[1];
|
|
1111
1123
|
// if its an object with a thenable (eagerly executing function)
|
|
1112
|
-
if (typeof value === 'object' && typeof value.then === 'function') {
|
|
1124
|
+
if ((typeof value === "undefined" ? "undefined" : _type_of(value)) === 'object' && typeof value.then === 'function') {
|
|
1113
1125
|
acc[key] = {
|
|
1114
1126
|
asyncContainer: value
|
|
1115
1127
|
};
|
|
@@ -1273,7 +1285,7 @@ function _ts_generator(thisArg, body) {
|
|
|
1273
1285
|
};
|
|
1274
1286
|
}
|
|
1275
1287
|
}
|
|
1276
|
-
var importDelegatedModule = function() {
|
|
1288
|
+
var importDelegatedModule = /*#__PURE__*/ function() {
|
|
1277
1289
|
var _ref = _async_to_generator(function(keyOrRuntimeRemoteItem) {
|
|
1278
1290
|
return _ts_generator(this, function(_state) {
|
|
1279
1291
|
// @ts-ignore
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/utilities",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.16",
|
|
4
4
|
"main": "./dist/index.cjs.js",
|
|
5
5
|
"module": "./dist/index.esm.js",
|
|
6
6
|
"types": "./dist/index.cjs.d.ts",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"react": "18.3.1"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@module-federation/sdk": "0.6.
|
|
20
|
+
"@module-federation/sdk": "0.6.10"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"react": "^16 || ^17 || ^18",
|