@module-federation/utilities 3.0.1 → 3.0.2-beta.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 +1 -1
- package/src/plugins/DelegateModulesPlugin.d.ts +2 -11
- package/src/plugins/DelegateModulesPlugin.js +22 -45
- package/src/plugins/DelegateModulesPlugin.js.map +1 -1
- package/src/types/index.d.ts +6 -0
- package/src/utils/pure.js +9 -9
- package/src/utils/pure.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
|
+
## [3.0.2-beta.0](https://github.com/module-federation/nextjs-mf/compare/utils-3.0.1...utils-3.0.2-beta.0) (2023-09-14)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **utilities:** update DelegateModulesPlugin and tests (#node_auto_public_path) ([df8bb79](https://github.com/module-federation/nextjs-mf/commit/df8bb791c3fedef299cb15960546ff5ad9c665ef))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
5
14
|
## [3.0.1](https://github.com/module-federation/nextjs-mf/compare/utils-3.0.0...utils-3.0.1) (2023-09-13)
|
|
6
15
|
|
|
7
16
|
|
package/package.json
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import type { Compiler, Compilation, Chunk,
|
|
2
|
-
/**
|
|
3
|
-
* A webpack plugin that moves specified modules from chunks to runtime chunk.
|
|
4
|
-
* @class DelegateModulesPlugin
|
|
5
|
-
*/
|
|
1
|
+
import type { Compiler, Compilation, Chunk, NormalModule } from 'webpack';
|
|
6
2
|
declare class DelegateModulesPlugin {
|
|
7
3
|
options: {
|
|
8
4
|
debug: boolean;
|
|
9
5
|
[key: string]: any;
|
|
10
6
|
};
|
|
11
|
-
_delegateModules:
|
|
7
|
+
_delegateModules: Map<string, NormalModule>;
|
|
12
8
|
constructor(options: {
|
|
13
9
|
debug?: boolean;
|
|
14
10
|
[key: string]: any;
|
|
@@ -17,11 +13,6 @@ declare class DelegateModulesPlugin {
|
|
|
17
13
|
private addDelegatesToChunks;
|
|
18
14
|
private addModuleAndDependenciesToChunk;
|
|
19
15
|
removeDelegatesNonRuntimeChunks(compilation: Compilation, chunks: Iterable<Chunk>): void;
|
|
20
|
-
/**
|
|
21
|
-
* Applies the plugin to the webpack compiler.
|
|
22
|
-
* @param {Compiler} compiler - The webpack compiler instance.
|
|
23
|
-
*/
|
|
24
16
|
apply(compiler: Compiler): void;
|
|
25
|
-
resolveDelegateModules(compilation: Compilation): void;
|
|
26
17
|
}
|
|
27
18
|
export default DelegateModulesPlugin;
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/**
|
|
4
|
-
* A webpack plugin that moves specified modules from chunks to runtime chunk.
|
|
5
|
-
* @class DelegateModulesPlugin
|
|
6
|
-
*/
|
|
7
3
|
class DelegateModulesPlugin {
|
|
8
4
|
constructor(options) {
|
|
9
5
|
this.options = Object.assign({ debug: false }, options);
|
|
10
|
-
this._delegateModules = new
|
|
6
|
+
this._delegateModules = new Map();
|
|
11
7
|
}
|
|
12
8
|
getChunkByName(chunks, name) {
|
|
13
9
|
for (const chunk of chunks) {
|
|
14
|
-
if (chunk.name
|
|
10
|
+
if (chunk.name === name) {
|
|
15
11
|
return chunk;
|
|
16
12
|
}
|
|
17
13
|
}
|
|
@@ -19,9 +15,9 @@ class DelegateModulesPlugin {
|
|
|
19
15
|
}
|
|
20
16
|
addDelegatesToChunks(compilation, chunks) {
|
|
21
17
|
for (const chunk of chunks) {
|
|
22
|
-
|
|
18
|
+
this._delegateModules.forEach(module => {
|
|
23
19
|
this.addModuleAndDependenciesToChunk(module, chunk, compilation);
|
|
24
|
-
}
|
|
20
|
+
});
|
|
25
21
|
}
|
|
26
22
|
}
|
|
27
23
|
addModuleAndDependenciesToChunk(module, chunk, compilation) {
|
|
@@ -30,23 +26,17 @@ class DelegateModulesPlugin {
|
|
|
30
26
|
console.log('adding ', module.identifier(), ' to chunk', chunk.name);
|
|
31
27
|
}
|
|
32
28
|
if (module.buildMeta) {
|
|
33
|
-
|
|
34
|
-
module.buildMeta.eager = true; // non-standard way to keep track of initial
|
|
29
|
+
module.buildMeta['eager'] = true;
|
|
35
30
|
}
|
|
36
|
-
// modules needed by delegate module, so during eager share removal they are perserved
|
|
37
31
|
compilation.chunkGraph.connectChunkAndModule(chunk, module);
|
|
38
32
|
}
|
|
39
|
-
|
|
33
|
+
module.dependencies.forEach(dependency => {
|
|
40
34
|
const dependencyModule = compilation.moduleGraph.getModule(dependency);
|
|
41
35
|
if (dependencyModule &&
|
|
42
36
|
!compilation.chunkGraph.isModuleInChunk(dependencyModule, chunk)) {
|
|
43
|
-
|
|
44
|
-
// dependencyModule,
|
|
45
|
-
// chunk,
|
|
46
|
-
// compilation
|
|
47
|
-
// );
|
|
37
|
+
this.addModuleAndDependenciesToChunk(dependencyModule, chunk, compilation);
|
|
48
38
|
}
|
|
49
|
-
}
|
|
39
|
+
});
|
|
50
40
|
}
|
|
51
41
|
removeDelegatesNonRuntimeChunks(compilation, chunks) {
|
|
52
42
|
for (const chunk of chunks) {
|
|
@@ -59,17 +49,22 @@ class DelegateModulesPlugin {
|
|
|
59
49
|
}
|
|
60
50
|
}
|
|
61
51
|
}
|
|
62
|
-
/**
|
|
63
|
-
* Applies the plugin to the webpack compiler.
|
|
64
|
-
* @param {Compiler} compiler - The webpack compiler instance.
|
|
65
|
-
*/
|
|
66
52
|
apply(compiler) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
53
|
+
compiler.hooks.thisCompilation.tap('DelegateModulesPlugin', (compilation) => {
|
|
54
|
+
compilation.hooks.finishModules.tapAsync('DelegateModulesPlugin', (modules, callback) => {
|
|
55
|
+
const { remotes } = this.options;
|
|
56
|
+
const knownDelegates = new Set(remotes
|
|
57
|
+
? Object.values(remotes).map((remote) => remote.replace('internal ', ''))
|
|
58
|
+
: []);
|
|
59
|
+
for (const module of modules) {
|
|
60
|
+
const normalModule = module;
|
|
61
|
+
if (normalModule.resource && knownDelegates.has(normalModule.resource)) {
|
|
62
|
+
this._delegateModules.set(normalModule.resource, normalModule);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
callback();
|
|
66
|
+
});
|
|
71
67
|
compilation.hooks.optimizeChunks.tap('DelegateModulesPlugin', (chunks) => {
|
|
72
|
-
// Change this line
|
|
73
68
|
const { runtime, container } = this.options;
|
|
74
69
|
const runtimeChunk = this.getChunkByName(chunks, runtime);
|
|
75
70
|
if (!runtimeChunk || !runtimeChunk.hasRuntime()) {
|
|
@@ -86,24 +81,6 @@ class DelegateModulesPlugin {
|
|
|
86
81
|
});
|
|
87
82
|
});
|
|
88
83
|
}
|
|
89
|
-
resolveDelegateModules(compilation) {
|
|
90
|
-
// Tap into the 'finish-modules' hook to access the module list after they are all processed
|
|
91
|
-
compilation.hooks.finishModules.tapAsync('ModuleIDFinderPlugin', (modules, callback) => {
|
|
92
|
-
const { remotes } = this.options;
|
|
93
|
-
// Get the delegate module names for remote chunks if specified
|
|
94
|
-
const knownDelegates = new Set(remotes
|
|
95
|
-
? Object.values(remotes).map((remote) => remote.replace('internal ', ''))
|
|
96
|
-
: []);
|
|
97
|
-
for (const module of modules) {
|
|
98
|
-
// @ts-ignore
|
|
99
|
-
if (module.resource && knownDelegates.has(module.resource)) {
|
|
100
|
-
this._delegateModules.add(module);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
// Continue the process
|
|
104
|
-
callback();
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
84
|
}
|
|
108
85
|
exports.default = DelegateModulesPlugin;
|
|
109
86
|
//# sourceMappingURL=DelegateModulesPlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DelegateModulesPlugin.js","sourceRoot":"","sources":["../../../../../packages/utilities/src/plugins/DelegateModulesPlugin.ts"],"names":[],"mappings":";;AAEA
|
|
1
|
+
{"version":3,"file":"DelegateModulesPlugin.js","sourceRoot":"","sources":["../../../../../packages/utilities/src/plugins/DelegateModulesPlugin.ts"],"names":[],"mappings":";;AAEA,MAAM,qBAAqB;IAIzB,YAAY,OAAgD;QAC1D,IAAI,CAAC,OAAO,mBAAK,KAAK,EAAE,KAAK,IAAK,OAAO,CAAE,CAAC;QAC5C,IAAI,CAAC,gBAAgB,GAAG,IAAI,GAAG,EAAE,CAAC;IACpC,CAAC;IAED,cAAc,CAAC,MAAuB,EAAE,IAAY;QAClD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;YAC1B,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,EAAE;gBACvB,OAAO,KAAK,CAAC;aACd;SACF;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAEO,oBAAoB,CAC1B,WAAwB,EACxB,MAAuB;QAEvB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;YAC1B,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;gBACrC,IAAI,CAAC,+BAA+B,CAAC,MAAM,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC;YACnE,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;IAEO,+BAA+B,CACrC,MAAoB,EACpB,KAAY,EACZ,WAAwB;QAExB,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE;YAC1D,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE;gBACtB,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,UAAU,EAAE,EAAE,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;aACtE;YACD,IAAI,MAAM,CAAC,SAAS,EAAE;gBACpB,MAAM,CAAC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,CAAC,IAAI,CAC3B,CAAC;gBACJ,IAAI,CAAC,oBAAoB,CACvB,WAAW,EACX,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC,MAAM,CAAC,OAAO,CAAY,CAC3D,CAAC;gBAEF,IAAI,CAAC,+BAA+B,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;YAC5D,CAAC,CACF,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AAED,kBAAe,qBAAqB,CAAC"}
|
package/src/types/index.d.ts
CHANGED
|
@@ -12,6 +12,12 @@ export type WebpackShareScopes = Record<string, Record<string, {
|
|
|
12
12
|
}>> & {
|
|
13
13
|
default?: string;
|
|
14
14
|
};
|
|
15
|
+
export type GlobalScopeType = {
|
|
16
|
+
[K: string]: any;
|
|
17
|
+
_config?: Record<string | number, any>;
|
|
18
|
+
_medusa?: Record<string, any> | undefined;
|
|
19
|
+
remoteLoading?: Record<string, Promise<AsyncContainer>>;
|
|
20
|
+
};
|
|
15
21
|
export declare const __webpack_init_sharing__: (parameter: string) => Promise<void>;
|
|
16
22
|
export interface NextFederationPluginExtraOptions {
|
|
17
23
|
enableImageLoaderFix?: boolean;
|
package/src/utils/pure.js
CHANGED
|
@@ -33,40 +33,39 @@ const loadScript = (keyOrRuntimeRemoteItem) => {
|
|
|
33
33
|
: remoteGlobal;
|
|
34
34
|
const __webpack_error__ = new Error();
|
|
35
35
|
// @ts-ignore
|
|
36
|
-
if (!globalThis.__remote_scope__) {
|
|
37
|
-
// create a global scope for container, similar to how remotes are set on window in the browser
|
|
38
|
-
// @ts-ignore
|
|
39
|
-
globalThis.__remote_scope__ = {
|
|
40
|
-
// @ts-ignore
|
|
41
|
-
_config: {},
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
// @ts-ignore
|
|
45
36
|
const globalScope =
|
|
46
37
|
// @ts-ignore
|
|
47
38
|
typeof window !== 'undefined' ? window : globalThis.__remote_scope__;
|
|
48
39
|
if (typeof window === 'undefined') {
|
|
40
|
+
//@ts-ignore
|
|
49
41
|
globalScope['_config'][containerKey] = reference.url;
|
|
50
42
|
}
|
|
51
43
|
else {
|
|
52
44
|
// to match promise template system, can be removed once promise template is gone
|
|
45
|
+
//@ts-ignore
|
|
53
46
|
if (!globalScope['remoteLoading']) {
|
|
47
|
+
//@ts-ignore
|
|
54
48
|
globalScope['remoteLoading'] = {};
|
|
55
49
|
}
|
|
50
|
+
//@ts-ignore
|
|
56
51
|
if (globalScope['remoteLoading'][containerKey]) {
|
|
52
|
+
//@ts-ignore
|
|
57
53
|
return globalScope['remoteLoading'][containerKey];
|
|
58
54
|
}
|
|
59
55
|
}
|
|
60
56
|
// @ts-ignore
|
|
61
57
|
asyncContainer = new Promise(function (resolve, reject) {
|
|
62
58
|
function resolveRemoteGlobal() {
|
|
59
|
+
//@ts-ignore
|
|
63
60
|
const asyncContainer = globalScope[remoteGlobal];
|
|
64
61
|
return resolve(asyncContainer);
|
|
65
62
|
}
|
|
63
|
+
//@ts-ignore
|
|
66
64
|
if (typeof globalScope[remoteGlobal] !== 'undefined') {
|
|
67
65
|
return resolveRemoteGlobal();
|
|
68
66
|
}
|
|
69
67
|
__webpack_require__.l(reference.url, function (event) {
|
|
68
|
+
//@ts-ignore
|
|
70
69
|
if (typeof globalScope[remoteGlobal] !== 'undefined') {
|
|
71
70
|
return resolveRemoteGlobal();
|
|
72
71
|
}
|
|
@@ -107,6 +106,7 @@ const loadScript = (keyOrRuntimeRemoteItem) => {
|
|
|
107
106
|
};
|
|
108
107
|
});
|
|
109
108
|
if (typeof window !== 'undefined') {
|
|
109
|
+
//@ts-ignore
|
|
110
110
|
globalScope['remoteLoading'][containerKey] = asyncContainer;
|
|
111
111
|
}
|
|
112
112
|
}
|
package/src/utils/pure.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pure.js","sourceRoot":"","sources":["../../../../../packages/utilities/src/utils/pure.ts"],"names":[],"mappings":";;;AAQA,MAAM,IAAI,GAAG,OA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