@module-federation/utilities 1.2.1 → 1.4.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 +18 -0
- package/package.json +15 -10
- package/src/types/index.d.ts +2 -1
- package/src/utils/common.d.ts +4 -0
- package/src/utils/common.js +135 -40
- package/src/utils/common.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
# [1.4.0](https://github.com/module-federation/nextjs-mf/compare/utils-1.3.0...utils-1.4.0) (2023-03-14)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* Medusa Support in NextFederationPlugin ([#609](https://github.com/module-federation/nextjs-mf/issues/609)) ([0bbba38](https://github.com/module-federation/nextjs-mf/commit/0bbba384c45b7d149b7a6be2dfbe9851b541b528)), closes [#606](https://github.com/module-federation/nextjs-mf/issues/606)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [1.3.0](https://github.com/module-federation/nextjs-mf/compare/utils-1.2.1...utils-1.3.0) (2023-02-09)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* Delegate Modules ([#509](https://github.com/module-federation/nextjs-mf/issues/509)) ([1a085e7](https://github.com/module-federation/nextjs-mf/commit/1a085e7e03ca0afd5c64389b4b169f3db3382f6b))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
5
23
|
## [1.2.1](https://github.com/module-federation/nextjs-mf/compare/utils-1.2.0...utils-1.2.1) (2023-02-09)
|
|
6
24
|
|
|
7
25
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/utilities",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.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
|
-
"next": "13.
|
|
13
|
+
"next": "13.2.4",
|
|
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,99 @@ 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 a delegate module, skip it
|
|
31
|
+
else if (typeof value === 'string' && value.startsWith('internal ')) {
|
|
32
|
+
}
|
|
33
|
+
// if its just a string (global@url)
|
|
34
|
+
else if (typeof value === 'string') {
|
|
35
|
+
var _a = (0, exports.extractUrlAndGlobal)(value), url = _a[0], global_1 = _a[1];
|
|
36
|
+
acc[key] = { global: global_1, url: url };
|
|
37
|
+
}
|
|
38
|
+
// we dont know or currently support this type
|
|
39
|
+
else {
|
|
40
|
+
//@ts-ignore
|
|
41
|
+
console.log('remotes process', process.env.REMOTES);
|
|
42
|
+
throw new Error("[mf] Invalid value received for runtime_remote \"".concat(key, "\""));
|
|
43
|
+
}
|
|
44
|
+
return acc;
|
|
45
|
+
}, {});
|
|
46
|
+
return runtimeRemotes;
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
console.warn('Unable to retrieve runtime remotes: ', err);
|
|
50
|
+
}
|
|
51
|
+
return {};
|
|
52
|
+
};
|
|
53
|
+
var importDelegatedModule = function (keyOrRuntimeRemoteItem) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
54
|
+
return tslib_1.__generator(this, function (_a) {
|
|
55
|
+
// @ts-ignore
|
|
56
|
+
return [2 /*return*/, loadScript(keyOrRuntimeRemoteItem)
|
|
57
|
+
.then(function (asyncContainer) {
|
|
58
|
+
return asyncContainer;
|
|
59
|
+
})
|
|
60
|
+
.then(function (asyncContainer) {
|
|
61
|
+
// most of this is only needed because of legacy promise based implementation
|
|
62
|
+
// can remove proxies once we remove promise based implementations
|
|
63
|
+
if (typeof window === 'undefined') {
|
|
64
|
+
//TODO: need to solve chunk flushing with delegated modules
|
|
65
|
+
return asyncContainer;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
var proxy_1 = {
|
|
69
|
+
get: asyncContainer.get,
|
|
70
|
+
//@ts-ignore
|
|
71
|
+
init: function (shareScope, initScope) {
|
|
72
|
+
try {
|
|
73
|
+
//@ts-ignore
|
|
74
|
+
asyncContainer.init(shareScope, initScope);
|
|
75
|
+
// for legacy reasons, we must mark container a initialized
|
|
76
|
+
// here otherwise older promise based implementation will try to init again with diff object
|
|
77
|
+
//@ts-ignore
|
|
78
|
+
proxy_1.__initialized = true;
|
|
79
|
+
}
|
|
80
|
+
catch (e) {
|
|
81
|
+
return 1;
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
// @ts-ignore
|
|
86
|
+
if (!proxy_1.__initialized) {
|
|
87
|
+
//@ts-ignore
|
|
88
|
+
proxy_1.init(__webpack_share_scopes__.default);
|
|
89
|
+
}
|
|
90
|
+
return proxy_1;
|
|
91
|
+
}
|
|
92
|
+
})];
|
|
93
|
+
});
|
|
94
|
+
}); };
|
|
95
|
+
exports.importDelegatedModule = importDelegatedModule;
|
|
96
|
+
var createDelegatedModule = function (delegate, params) {
|
|
97
|
+
var queries = [];
|
|
98
|
+
for (var _i = 0, _a = Object.entries(params); _i < _a.length; _i++) {
|
|
99
|
+
var _b = _a[_i], key = _b[0], value = _b[1];
|
|
100
|
+
if (Array.isArray(value) || typeof value === 'object') {
|
|
101
|
+
throw new Error("[Module Federation] Delegated module params cannot be an array or object. Key \"".concat(key, "\" should be a string or number"));
|
|
39
102
|
}
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
return
|
|
103
|
+
queries.push("".concat(key, "=").concat(value));
|
|
104
|
+
}
|
|
105
|
+
return "internal ".concat(delegate, "?").concat(queries.join('&'));
|
|
43
106
|
};
|
|
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) {
|
|
107
|
+
exports.createDelegatedModule = createDelegatedModule;
|
|
108
|
+
var loadScript = function (keyOrRuntimeRemoteItem) {
|
|
53
109
|
var runtimeRemotes = getRuntimeRemotes();
|
|
54
110
|
// 1) Load remote container if needed
|
|
55
111
|
var asyncContainer;
|
|
@@ -72,9 +128,30 @@ var injectScript = function (keyOrRuntimeRemoteItem) {
|
|
|
72
128
|
? reference.uniqueKey
|
|
73
129
|
: remoteGlobal_1;
|
|
74
130
|
var __webpack_error__1 = new Error();
|
|
131
|
+
//@ts-ignore
|
|
132
|
+
if (!global.__remote_scope__) {
|
|
133
|
+
// create a global scope for container, similar to how remotes are set on window in the browser
|
|
134
|
+
//@ts-ignore
|
|
135
|
+
global.__remote_scope__ = {
|
|
136
|
+
_config: {},
|
|
137
|
+
};
|
|
138
|
+
}
|
|
75
139
|
var globalScope_1 =
|
|
76
140
|
//@ts-ignore
|
|
77
141
|
typeof window !== 'undefined' ? window : global.__remote_scope__; // TODO: fix types
|
|
142
|
+
if (typeof window === 'undefined') {
|
|
143
|
+
//@ts-ignore
|
|
144
|
+
globalScope_1._config[containerKey_1] = reference.url;
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
// to match promise template system, can be removed once promise template is gone
|
|
148
|
+
if (!globalScope_1.remoteLoading) {
|
|
149
|
+
globalScope_1.remoteLoading = {};
|
|
150
|
+
}
|
|
151
|
+
if (globalScope_1.remoteLoading[containerKey_1]) {
|
|
152
|
+
return globalScope_1.remoteLoading[containerKey_1];
|
|
153
|
+
}
|
|
154
|
+
}
|
|
78
155
|
asyncContainer = new Promise(function (resolve, reject) {
|
|
79
156
|
function resolveRemoteGlobal() {
|
|
80
157
|
var asyncContainer = globalScope_1[remoteGlobal_1];
|
|
@@ -103,8 +180,13 @@ var injectScript = function (keyOrRuntimeRemoteItem) {
|
|
|
103
180
|
reject(__webpack_error__1);
|
|
104
181
|
}, containerKey_1);
|
|
105
182
|
});
|
|
183
|
+
if (typeof window !== 'undefined') {
|
|
184
|
+
globalScope_1.remoteLoading[containerKey_1] = asyncContainer;
|
|
185
|
+
}
|
|
106
186
|
}
|
|
107
|
-
|
|
187
|
+
return asyncContainer;
|
|
188
|
+
};
|
|
189
|
+
var createContainerSharingScope = function (asyncContainer) {
|
|
108
190
|
// @ts-ignore
|
|
109
191
|
return asyncContainer
|
|
110
192
|
.then(function (container) {
|
|
@@ -135,6 +217,18 @@ var injectScript = function (keyOrRuntimeRemoteItem) {
|
|
|
135
217
|
return container;
|
|
136
218
|
});
|
|
137
219
|
};
|
|
220
|
+
/**
|
|
221
|
+
* Return initialized remote container by remote's key or its runtime remote item data.
|
|
222
|
+
*
|
|
223
|
+
* `runtimeRemoteItem` might be
|
|
224
|
+
* { global, url } - values obtained from webpack remotes option `global@url`
|
|
225
|
+
* or
|
|
226
|
+
* { asyncContainer } - async container is a promise that resolves to the remote container
|
|
227
|
+
*/
|
|
228
|
+
var injectScript = function (keyOrRuntimeRemoteItem) {
|
|
229
|
+
var asyncContainer = loadScript(keyOrRuntimeRemoteItem);
|
|
230
|
+
return createContainerSharingScope(asyncContainer);
|
|
231
|
+
};
|
|
138
232
|
exports.injectScript = injectScript;
|
|
139
233
|
var createRuntimeVariables = function (remotes) {
|
|
140
234
|
if (!remotes) {
|
|
@@ -160,7 +254,7 @@ exports.createRuntimeVariables = createRuntimeVariables;
|
|
|
160
254
|
* If its' script does not loaded - then load & init it firstly.
|
|
161
255
|
*/
|
|
162
256
|
var getContainer = function (remoteContainer) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
163
|
-
var container;
|
|
257
|
+
var uniqueKey, container;
|
|
164
258
|
return tslib_1.__generator(this, function (_a) {
|
|
165
259
|
switch (_a.label) {
|
|
166
260
|
case 0:
|
|
@@ -173,8 +267,9 @@ var getContainer = function (remoteContainer) { return tslib_1.__awaiter(void 0,
|
|
|
173
267
|
}
|
|
174
268
|
return [2 /*return*/];
|
|
175
269
|
case 1:
|
|
176
|
-
|
|
177
|
-
|
|
270
|
+
uniqueKey = remoteContainer.uniqueKey;
|
|
271
|
+
if (window[uniqueKey]) {
|
|
272
|
+
return [2 /*return*/, window[uniqueKey]];
|
|
178
273
|
}
|
|
179
274
|
return [4 /*yield*/, (0, exports.injectScript)({
|
|
180
275
|
global: remoteContainer.global,
|
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,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACxC,IAAI,KAAK,IAAI,CAAC,IAAI,KAAK,KAAK,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE;QACnD,MA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