@module-federation/utilities 1.2.1 → 1.3.0
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/CHANGELOG.md +9 -0
- package/package.json +14 -9
- package/src/types/index.d.ts +2 -1
- package/src/utils/common.d.ts +4 -0
- package/src/utils/common.js +128 -37
- package/src/utils/common.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
# [1.3.0](https://github.com/module-federation/nextjs-mf/compare/utils-1.2.1...utils-1.3.0) (2023-02-09)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* Delegate Modules ([#509](https://github.com/module-federation/nextjs-mf/issues/509)) ([1a085e7](https://github.com/module-federation/nextjs-mf/commit/1a085e7e03ca0afd5c64389b4b169f3db3382f6b))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
5
14
|
## [1.2.1](https://github.com/module-federation/nextjs-mf/compare/utils-1.2.0...utils-1.2.1) (2023-02-09)
|
|
6
15
|
|
|
7
16
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/utilities",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -9,20 +9,25 @@
|
|
|
9
9
|
"registry": "https://registry.npmjs.org/"
|
|
10
10
|
},
|
|
11
11
|
"repository": "https://github.com/module-federation/nextjs-mf/tree/main/packages/utilities",
|
|
12
|
-
"optionalDependencies": {
|
|
13
|
-
"react": "^17 || ^18",
|
|
14
|
-
"next": "^12 || ^13"
|
|
15
|
-
},
|
|
16
12
|
"devDependencies": {
|
|
17
13
|
"next": "13.1.6",
|
|
18
14
|
"react": "18.2.0"
|
|
19
15
|
},
|
|
20
16
|
"peerDependencies": {
|
|
21
|
-
"next": "13
|
|
17
|
+
"next": "^12 || ^13",
|
|
18
|
+
"react": "^16 || ^17 || ^18",
|
|
19
|
+
"react-dom": "^16 || ^17 || ^18",
|
|
22
20
|
"webpack": "^5.40.0"
|
|
23
21
|
},
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
|
|
22
|
+
"peerDependenciesMeta": {
|
|
23
|
+
"next": {
|
|
24
|
+
"optional": true
|
|
25
|
+
},
|
|
26
|
+
"react": {
|
|
27
|
+
"optional": true
|
|
28
|
+
},
|
|
29
|
+
"react-dom": {
|
|
30
|
+
"optional": true
|
|
31
|
+
}
|
|
27
32
|
}
|
|
28
33
|
}
|
package/src/types/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { container, WebpackOptionsNormalized } from 'webpack';
|
|
3
3
|
export type ModuleFederationPluginOptions = ConstructorParameters<typeof container.ModuleFederationPlugin>['0'];
|
|
4
4
|
export type WebpackRequire = {
|
|
5
|
-
l: (url: string, cb: (event: any) => void, id: string) => Record<string, unknown>;
|
|
5
|
+
l: (url: string | undefined, cb: (event: any) => void, id: string | number) => Record<string, unknown>;
|
|
6
6
|
};
|
|
7
7
|
export type WebpackShareScopes = Record<string, Record<string, {
|
|
8
8
|
loaded?: 1;
|
|
@@ -33,6 +33,7 @@ export type SharedConfig = Extract<SharedObject[keyof SharedObject], {
|
|
|
33
33
|
export type ExternalsType = Required<ModuleFederationPluginOptions['remoteType']>;
|
|
34
34
|
type ModulePath = string;
|
|
35
35
|
export type WebpackRemoteContainer = {
|
|
36
|
+
__initialized?: boolean;
|
|
36
37
|
get(modulePath: ModulePath): () => any;
|
|
37
38
|
init: (obj?: typeof __webpack_share_scopes__) => void;
|
|
38
39
|
};
|
package/src/utils/common.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { Remotes, RuntimeRemote, WebpackRemoteContainer, RemoteData, GetModuleOptions } from '../types';
|
|
2
2
|
export declare const extractUrlAndGlobal: (urlAndGlobal: string) => [string, string];
|
|
3
|
+
export declare const importDelegatedModule: (keyOrRuntimeRemoteItem: string | RuntimeRemote) => Promise<any>;
|
|
4
|
+
export declare const createDelegatedModule: (delegate: string, params: {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}) => string;
|
|
3
7
|
/**
|
|
4
8
|
* Return initialized remote container by remote's key or its runtime remote item data.
|
|
5
9
|
*
|
package/src/utils/common.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.getModule = exports.getContainer = exports.createRuntimeVariables = exports.injectScript = exports.extractUrlAndGlobal = void 0;
|
|
4
|
+
exports.getModule = exports.getContainer = exports.createRuntimeVariables = exports.injectScript = exports.createDelegatedModule = exports.importDelegatedModule = exports.extractUrlAndGlobal = void 0;
|
|
5
5
|
var tslib_1 = require("tslib");
|
|
6
6
|
// split the @ syntax into url and global
|
|
7
7
|
var extractUrlAndGlobal = function (urlAndGlobal) {
|
|
@@ -13,43 +13,96 @@ var extractUrlAndGlobal = function (urlAndGlobal) {
|
|
|
13
13
|
};
|
|
14
14
|
exports.extractUrlAndGlobal = extractUrlAndGlobal;
|
|
15
15
|
var getRuntimeRemotes = function () {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
16
|
+
try {
|
|
17
|
+
//@ts-ignore
|
|
18
|
+
var remoteVars = (process.env.REMOTES || {});
|
|
19
|
+
var runtimeRemotes = Object.entries(remoteVars).reduce(function (acc, item) {
|
|
20
|
+
var key = item[0], value = item[1];
|
|
21
|
+
// if its an object with a thenable (eagerly executing function)
|
|
22
|
+
if (typeof value === 'object' && typeof value.then === 'function') {
|
|
23
|
+
acc[key] = { asyncContainer: value };
|
|
24
|
+
}
|
|
25
|
+
// if its a function that must be called (lazily executing function)
|
|
26
|
+
else if (typeof value === 'function') {
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
acc[key] = { asyncContainer: value };
|
|
29
|
+
}
|
|
30
|
+
// if its just a string (global@url)
|
|
31
|
+
else if (typeof value === 'string') {
|
|
32
|
+
var _a = (0, exports.extractUrlAndGlobal)(value), url = _a[0], global_1 = _a[1];
|
|
33
|
+
acc[key] = { global: global_1, url: url };
|
|
34
|
+
}
|
|
35
|
+
// we dont know or currently support this type
|
|
36
|
+
else {
|
|
37
|
+
//@ts-ignore
|
|
38
|
+
console.log('remotes process', process.env.REMOTES);
|
|
39
|
+
throw new Error("[mf] Invalid value received for runtime_remote \"".concat(key, "\""));
|
|
40
|
+
}
|
|
41
|
+
return acc;
|
|
42
|
+
}, {});
|
|
43
|
+
return runtimeRemotes;
|
|
44
|
+
}
|
|
45
|
+
catch (err) {
|
|
46
|
+
console.warn('Unable to retrieve runtime remotes: ', err);
|
|
47
|
+
}
|
|
48
|
+
return {};
|
|
49
|
+
};
|
|
50
|
+
var importDelegatedModule = function (keyOrRuntimeRemoteItem) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
51
|
+
return tslib_1.__generator(this, function (_a) {
|
|
52
|
+
// @ts-ignore
|
|
53
|
+
return [2 /*return*/, loadScript(keyOrRuntimeRemoteItem)
|
|
54
|
+
.then(function (asyncContainer) {
|
|
55
|
+
return asyncContainer;
|
|
56
|
+
})
|
|
57
|
+
.then(function (asyncContainer) {
|
|
58
|
+
// most of this is only needed because of legacy promise based implementation
|
|
59
|
+
// can remove proxies once we remove promise based implementations
|
|
60
|
+
if (typeof window === 'undefined') {
|
|
61
|
+
//TODO: need to solve chunk flushing with delegated modules
|
|
62
|
+
return asyncContainer;
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
var proxy_1 = {
|
|
66
|
+
get: asyncContainer.get,
|
|
67
|
+
//@ts-ignore
|
|
68
|
+
init: function (shareScope, initScope) {
|
|
69
|
+
try {
|
|
70
|
+
//@ts-ignore
|
|
71
|
+
asyncContainer.init(shareScope, initScope);
|
|
72
|
+
// for legacy reasons, we must mark container a initialized
|
|
73
|
+
// here otherwise older promise based implementation will try to init again with diff object
|
|
74
|
+
//@ts-ignore
|
|
75
|
+
proxy_1.__initialized = true;
|
|
76
|
+
}
|
|
77
|
+
catch (e) {
|
|
78
|
+
return 1;
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
// @ts-ignore
|
|
83
|
+
if (!proxy_1.__initialized) {
|
|
84
|
+
//@ts-ignore
|
|
85
|
+
proxy_1.init(__webpack_share_scopes__.default);
|
|
86
|
+
}
|
|
87
|
+
return proxy_1;
|
|
88
|
+
}
|
|
89
|
+
})];
|
|
90
|
+
});
|
|
91
|
+
}); };
|
|
92
|
+
exports.importDelegatedModule = importDelegatedModule;
|
|
93
|
+
var createDelegatedModule = function (delegate, params) {
|
|
94
|
+
var queries = [];
|
|
95
|
+
for (var _i = 0, _a = Object.entries(params); _i < _a.length; _i++) {
|
|
96
|
+
var _b = _a[_i], key = _b[0], value = _b[1];
|
|
97
|
+
if (Array.isArray(value) || typeof value === 'object') {
|
|
98
|
+
throw new Error("[Module Federation] Delegated module params cannot be an array or object. Key \"".concat(key, "\" should be a string or number"));
|
|
39
99
|
}
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
return
|
|
100
|
+
queries.push("".concat(key, "=").concat(value));
|
|
101
|
+
}
|
|
102
|
+
return "internal ".concat(delegate, "?").concat(queries.join('&'));
|
|
43
103
|
};
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
*
|
|
47
|
-
* `runtimeRemoteItem` might be
|
|
48
|
-
* { global, url } - values obtained from webpack remotes option `global@url`
|
|
49
|
-
* or
|
|
50
|
-
* { asyncContainer } - async container is a promise that resolves to the remote container
|
|
51
|
-
*/
|
|
52
|
-
var injectScript = function (keyOrRuntimeRemoteItem) {
|
|
104
|
+
exports.createDelegatedModule = createDelegatedModule;
|
|
105
|
+
var loadScript = function (keyOrRuntimeRemoteItem) {
|
|
53
106
|
var runtimeRemotes = getRuntimeRemotes();
|
|
54
107
|
// 1) Load remote container if needed
|
|
55
108
|
var asyncContainer;
|
|
@@ -72,9 +125,30 @@ var injectScript = function (keyOrRuntimeRemoteItem) {
|
|
|
72
125
|
? reference.uniqueKey
|
|
73
126
|
: remoteGlobal_1;
|
|
74
127
|
var __webpack_error__1 = new Error();
|
|
128
|
+
//@ts-ignore
|
|
129
|
+
if (!global.__remote_scope__) {
|
|
130
|
+
// create a global scope for container, similar to how remotes are set on window in the browser
|
|
131
|
+
//@ts-ignore
|
|
132
|
+
global.__remote_scope__ = {
|
|
133
|
+
_config: {},
|
|
134
|
+
};
|
|
135
|
+
}
|
|
75
136
|
var globalScope_1 =
|
|
76
137
|
//@ts-ignore
|
|
77
138
|
typeof window !== 'undefined' ? window : global.__remote_scope__; // TODO: fix types
|
|
139
|
+
if (typeof window === 'undefined') {
|
|
140
|
+
//@ts-ignore
|
|
141
|
+
globalScope_1._config[containerKey_1] = reference.url;
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
// to match promise template system, can be removed once promise template is gone
|
|
145
|
+
if (!globalScope_1.remoteLoading) {
|
|
146
|
+
globalScope_1.remoteLoading = {};
|
|
147
|
+
}
|
|
148
|
+
if (globalScope_1.remoteLoading[containerKey_1]) {
|
|
149
|
+
return globalScope_1.remoteLoading[containerKey_1];
|
|
150
|
+
}
|
|
151
|
+
}
|
|
78
152
|
asyncContainer = new Promise(function (resolve, reject) {
|
|
79
153
|
function resolveRemoteGlobal() {
|
|
80
154
|
var asyncContainer = globalScope_1[remoteGlobal_1];
|
|
@@ -103,8 +177,13 @@ var injectScript = function (keyOrRuntimeRemoteItem) {
|
|
|
103
177
|
reject(__webpack_error__1);
|
|
104
178
|
}, containerKey_1);
|
|
105
179
|
});
|
|
180
|
+
if (typeof window !== 'undefined') {
|
|
181
|
+
globalScope_1.remoteLoading[containerKey_1] = asyncContainer;
|
|
182
|
+
}
|
|
106
183
|
}
|
|
107
|
-
|
|
184
|
+
return asyncContainer;
|
|
185
|
+
};
|
|
186
|
+
var createContainerSharingScope = function (asyncContainer) {
|
|
108
187
|
// @ts-ignore
|
|
109
188
|
return asyncContainer
|
|
110
189
|
.then(function (container) {
|
|
@@ -135,6 +214,18 @@ var injectScript = function (keyOrRuntimeRemoteItem) {
|
|
|
135
214
|
return container;
|
|
136
215
|
});
|
|
137
216
|
};
|
|
217
|
+
/**
|
|
218
|
+
* Return initialized remote container by remote's key or its runtime remote item data.
|
|
219
|
+
*
|
|
220
|
+
* `runtimeRemoteItem` might be
|
|
221
|
+
* { global, url } - values obtained from webpack remotes option `global@url`
|
|
222
|
+
* or
|
|
223
|
+
* { asyncContainer } - async container is a promise that resolves to the remote container
|
|
224
|
+
*/
|
|
225
|
+
var injectScript = function (keyOrRuntimeRemoteItem) {
|
|
226
|
+
var asyncContainer = loadScript(keyOrRuntimeRemoteItem);
|
|
227
|
+
return createContainerSharingScope(asyncContainer);
|
|
228
|
+
};
|
|
138
229
|
exports.injectScript = injectScript;
|
|
139
230
|
var createRuntimeVariables = function (remotes) {
|
|
140
231
|
if (!remotes) {
|
package/src/utils/common.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../../packages/utilities/src/utils/common.ts"],"names":[],"mappings":";AAAA,sDAAsD;;;;AAmBtD,yCAAyC;AAClC,IAAM,mBAAmB,GAAG,UAAC,YAAoB;IACtD,IAAM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