@module-federation/utilities 3.1.97 → 3.1.99
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/cjs/Logger.js +17 -14
- package/dist/cjs/components/ErrorBoundary.js +14 -12
- package/dist/cjs/components/FederationBoundary.js +14 -12
- package/dist/cjs/index.js +62 -60
- package/dist/cjs/plugins/DelegateModulesPlugin.js +22 -18
- package/dist/cjs/plugins/DelegateModulesPlugin.test.js +87 -0
- package/dist/cjs/types/index.js +2 -4
- package/dist/cjs/utils/common.js +17 -15
- package/dist/cjs/utils/getRuntimeRemotes.js +13 -11
- package/dist/cjs/utils/getRuntimeRemotes.test.js +2 -2
- package/dist/cjs/utils/importDelegateModule.test.js +2 -4
- package/dist/cjs/utils/importDelegatedModule.js +13 -11
- package/dist/cjs/utils/importRemote.js +21 -19
- package/dist/cjs/utils/isEmpty.js +18 -14
- package/dist/cjs/utils/pure.js +21 -18
- package/dist/cjs/utils/react.js +13 -11
- package/dist/esm/Logger.mjs +0 -2
- package/dist/esm/components/ErrorBoundary.mjs +2 -4
- package/dist/esm/components/FederationBoundary.mjs +2 -5
- package/dist/esm/index.mjs +7 -17
- package/dist/esm/plugins/DelegateModulesPlugin.mjs +5 -7
- package/dist/esm/plugins/DelegateModulesPlugin.test.mjs +39 -0
- package/dist/esm/rslib-runtime.mjs +37 -0
- package/dist/esm/types/index.mjs +0 -2
- package/dist/esm/utils/common.mjs +2 -12
- package/dist/esm/utils/getRuntimeRemotes.mjs +0 -2
- package/dist/esm/utils/getRuntimeRemotes.test.mjs +0 -3
- package/dist/esm/utils/importDelegateModule.test.mjs +1 -19
- package/dist/esm/utils/importDelegatedModule.mjs +0 -2
- package/dist/esm/utils/importRemote.mjs +4 -36
- package/dist/esm/utils/isEmpty.mjs +0 -2
- package/dist/esm/utils/pure.mjs +1 -27
- package/dist/esm/utils/react.mjs +1 -5
- package/package.json +2 -2
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { getRuntimeRemotes } from "./getRuntimeRemotes.mjs";
|
|
2
2
|
import { remoteVars } from "./pure.mjs";
|
|
3
3
|
|
|
4
|
-
;// CONCATENATED MODULE: external "./getRuntimeRemotes.mjs"
|
|
5
4
|
|
|
6
|
-
;// CONCATENATED MODULE: external "./pure.mjs"
|
|
7
5
|
|
|
8
|
-
;// CONCATENATED MODULE: ./src/utils/getRuntimeRemotes.test.ts
|
|
9
6
|
|
|
10
7
|
|
|
11
8
|
xdescribe('getRuntimeRemotes', ()=>{
|
|
@@ -1,27 +1,9 @@
|
|
|
1
1
|
import { importDelegatedModule } from "./importDelegatedModule.mjs";
|
|
2
2
|
import { loadScript } from "./pure.mjs";
|
|
3
|
-
|
|
4
|
-
var __webpack_require__ = {};
|
|
3
|
+
import { __webpack_require__ } from "../rslib-runtime.mjs";
|
|
5
4
|
|
|
6
|
-
/************************************************************************/
|
|
7
|
-
// webpack/runtime/global
|
|
8
|
-
(() => {
|
|
9
|
-
__webpack_require__.g = (() => {
|
|
10
|
-
if (typeof globalThis === 'object') return globalThis;
|
|
11
|
-
try {
|
|
12
|
-
return this || new Function('return this')();
|
|
13
|
-
} catch (e) {
|
|
14
|
-
if (typeof window === 'object') return window;
|
|
15
|
-
}
|
|
16
|
-
})();
|
|
17
|
-
})();
|
|
18
|
-
/************************************************************************/
|
|
19
5
|
|
|
20
|
-
;// CONCATENATED MODULE: external "./importDelegatedModule.mjs"
|
|
21
6
|
|
|
22
|
-
;// CONCATENATED MODULE: external "./pure.mjs"
|
|
23
|
-
|
|
24
|
-
;// CONCATENATED MODULE: ./src/utils/importDelegateModule.test.ts
|
|
25
7
|
|
|
26
8
|
|
|
27
9
|
jest.mock('./pure');
|
|
@@ -1,36 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
/************************************************************************/
|
|
3
|
-
// The module cache
|
|
4
|
-
var __webpack_module_cache__ = {};
|
|
1
|
+
import { __webpack_require__ } from "../rslib-runtime.mjs";
|
|
5
2
|
|
|
6
|
-
// The require function
|
|
7
|
-
function __webpack_require__(moduleId) {
|
|
8
|
-
|
|
9
|
-
// Check if module is in cache
|
|
10
|
-
var cachedModule = __webpack_module_cache__[moduleId];
|
|
11
|
-
if (cachedModule !== undefined) {
|
|
12
|
-
return cachedModule.exports;
|
|
13
|
-
}
|
|
14
|
-
// Create a new module (and put it into the cache)
|
|
15
|
-
var module = (__webpack_module_cache__[moduleId] = {
|
|
16
|
-
exports: {}
|
|
17
|
-
});
|
|
18
|
-
// Execute the module function
|
|
19
|
-
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
20
|
-
|
|
21
|
-
// Return the exports of the module
|
|
22
|
-
return module.exports;
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/************************************************************************/
|
|
27
|
-
// webpack/runtime/has_own_property
|
|
28
|
-
(() => {
|
|
29
|
-
__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
30
|
-
})();
|
|
31
|
-
/************************************************************************/
|
|
32
|
-
|
|
33
|
-
;// CONCATENATED MODULE: ./src/utils/importRemote.ts
|
|
34
3
|
/**
|
|
35
4
|
* Constant for remote entry file
|
|
36
5
|
* @constant {string}
|
|
@@ -46,12 +15,11 @@ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj
|
|
|
46
15
|
const timestamp = bustRemoteEntryCache ? `?t=${new Date().getTime()}` : '';
|
|
47
16
|
const webpackRequire = __webpack_require__;
|
|
48
17
|
webpackRequire.l(`${url}${timestamp}`, (event)=>{
|
|
49
|
-
|
|
50
|
-
if ((event === null || event === void 0 ? void 0 : event.type) === 'load') {
|
|
18
|
+
if (event?.type === 'load') {
|
|
51
19
|
// Script loaded successfully:
|
|
52
20
|
return resolve();
|
|
53
21
|
}
|
|
54
|
-
const realSrc = event
|
|
22
|
+
const realSrc = event?.target?.src;
|
|
55
23
|
const error = new Error();
|
|
56
24
|
error.message = 'Loading script failed.\n(missing: ' + realSrc + ')';
|
|
57
25
|
error.name = 'ScriptExternalLoadError';
|
|
@@ -75,7 +43,7 @@ const loadEsmRemote = async (url, scope)=>{
|
|
|
75
43
|
* @function
|
|
76
44
|
*/ const initSharing = async ()=>{
|
|
77
45
|
const webpackShareScopes = __webpack_require__.S;
|
|
78
|
-
if (!
|
|
46
|
+
if (!webpackShareScopes?.default) {
|
|
79
47
|
await __webpack_require__.I('default');
|
|
80
48
|
}
|
|
81
49
|
};
|
package/dist/esm/utils/pure.mjs
CHANGED
|
@@ -1,31 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
/************************************************************************/
|
|
3
|
-
// The module cache
|
|
4
|
-
var __webpack_module_cache__ = {};
|
|
1
|
+
import { __webpack_require__ } from "../rslib-runtime.mjs";
|
|
5
2
|
|
|
6
|
-
// The require function
|
|
7
|
-
function __webpack_require__(moduleId) {
|
|
8
|
-
|
|
9
|
-
// Check if module is in cache
|
|
10
|
-
var cachedModule = __webpack_module_cache__[moduleId];
|
|
11
|
-
if (cachedModule !== undefined) {
|
|
12
|
-
return cachedModule.exports;
|
|
13
|
-
}
|
|
14
|
-
// Create a new module (and put it into the cache)
|
|
15
|
-
var module = (__webpack_module_cache__[moduleId] = {
|
|
16
|
-
exports: {}
|
|
17
|
-
});
|
|
18
|
-
// Execute the module function
|
|
19
|
-
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
20
|
-
|
|
21
|
-
// Return the exports of the module
|
|
22
|
-
return module.exports;
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/************************************************************************/
|
|
27
|
-
|
|
28
|
-
;// CONCATENATED MODULE: ./src/utils/pure.ts
|
|
29
3
|
const pure = typeof process !== 'undefined' ? process.env['REMOTES'] || {} : {};
|
|
30
4
|
const remoteVars = pure;
|
|
31
5
|
const extractUrlAndGlobal = (urlAndGlobal)=>{
|
package/dist/esm/utils/react.mjs
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import FederationBoundary from "../components/FederationBoundary.mjs";
|
|
2
1
|
|
|
3
|
-
;// CONCATENATED MODULE: external "../components/FederationBoundary.mjs"
|
|
4
2
|
|
|
5
|
-
;// CONCATENATED MODULE: ./src/utils/react.tsx
|
|
6
3
|
|
|
7
|
-
|
|
8
|
-
export { FederationBoundary };
|
|
4
|
+
export { default as FederationBoundary } from "../components/FederationBoundary.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/utilities",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.99",
|
|
4
4
|
"main": "./dist/cjs/index.js",
|
|
5
5
|
"module": "./dist/esm/index.mjs",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"rsbuild-plugin-publint": "^0.2.1"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@module-federation/sdk": "2.
|
|
26
|
+
"@module-federation/sdk": "2.8.0"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"react": "^16 || ^17 || ^18",
|