@module-federation/node 2.0.5 → 2.0.7
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/package.json +10 -3
- package/dist/src/filesystem/stratagies.d.ts +12 -5
- package/dist/src/filesystem/stratagies.js +22 -9
- package/dist/src/filesystem/stratagies.js.map +1 -1
- package/dist/src/index.d.ts +0 -2
- package/dist/src/index.js +1 -5
- package/dist/src/index.js.map +1 -1
- package/dist/src/plugins/DynamicFilesystemChunkLoadingRuntimeModule.js +0 -13
- package/dist/src/plugins/DynamicFilesystemChunkLoadingRuntimeModule.js.map +1 -1
- package/dist/src/plugins/NodeFederationPlugin.d.ts +0 -20
- package/dist/src/plugins/NodeFederationPlugin.js +16 -69
- package/dist/src/plugins/NodeFederationPlugin.js.map +1 -1
- package/dist/src/plugins/UniversalFederationPlugin.d.ts +1 -0
- package/dist/src/plugins/UniversalFederationPlugin.js +3 -3
- package/dist/src/plugins/UniversalFederationPlugin.js.map +1 -1
- package/dist/src/plugins/webpackChunkUtilities.js +1 -6
- package/dist/src/plugins/webpackChunkUtilities.js.map +1 -1
- package/package.json +4 -4
- package/dist/src/plugins/NodeContainerPlugin.d.ts +0 -57
- package/dist/src/plugins/NodeContainerPlugin.js +0 -105
- package/dist/src/plugins/NodeContainerPlugin.js.map +0 -1
package/dist/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"public": true,
|
|
3
3
|
"name": "@module-federation/node",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.7",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./src/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"./package.json": "./package.json",
|
|
13
13
|
"./utils": {
|
|
14
|
-
"import": "./dist
|
|
14
|
+
"import": "./dist/src/utils/index.js",
|
|
15
15
|
"require": "./dist/src/utils/index.js"
|
|
16
16
|
},
|
|
17
17
|
"./src/plugins/RemotePublicPathPlugin.js": "./dist/src/plugins/RemotePublicPathPlugin.js",
|
|
@@ -43,8 +43,15 @@
|
|
|
43
43
|
"@module-federation/sdk": "workspace:*",
|
|
44
44
|
"@module-federation/utilities": "workspace:*",
|
|
45
45
|
"node-fetch": "2.7.0",
|
|
46
|
+
"semver": "6.3.1",
|
|
46
47
|
"tapable": "2.2.1",
|
|
47
|
-
"webpack-
|
|
48
|
+
"terser-webpack-plugin": "5.3.9",
|
|
49
|
+
"url": "0.11.3",
|
|
50
|
+
"util": "0.12.5",
|
|
51
|
+
"webpack-sources": "3.2.3",
|
|
52
|
+
"@module-federation/runtime": "0.0.9",
|
|
53
|
+
"@module-federation/runtime-tools": "0.0.9",
|
|
54
|
+
"@module-federation/webpack-bundler-runtime": "0.0.9"
|
|
48
55
|
},
|
|
49
56
|
"peerDependencies": {
|
|
50
57
|
"next": "^12||^13",
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
export declare function fileSystemRunInContextStrategy(chunkId:
|
|
2
|
-
export declare function httpEvalStrategy(chunkName:
|
|
1
|
+
export declare function fileSystemRunInContextStrategy(chunkId: string, rootOutputDir: string, remotes: Remotes, callback: CallbackFunction): Promise<void>;
|
|
2
|
+
export declare function httpEvalStrategy(chunkName: string, remoteName: string, remotes: Remotes, callback: CallbackFunction): Promise<void>;
|
|
3
|
+
interface Remotes {
|
|
4
|
+
[key: string]: {
|
|
5
|
+
entry: string;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
type CallbackFunction = (error: Error | null, chunk?: any) => void;
|
|
3
9
|
/**
|
|
4
10
|
* HttpVmStrategy
|
|
5
11
|
* This function is used to execute a chunk of code in a VM using HTTP or HTTPS based on the protocol.
|
|
6
12
|
* @param {string} chunkName - The name of the chunk to be executed.
|
|
7
13
|
* @param {string} remoteName - The name of the remote server.
|
|
8
|
-
* @param {
|
|
9
|
-
* @param {
|
|
14
|
+
* @param {Remotes} remotes - An object containing the remote servers.
|
|
15
|
+
* @param {CallbackFunction} callback - A callback function to be executed after the chunk is executed.
|
|
10
16
|
*/
|
|
11
|
-
export declare function httpVmStrategy(chunkName:
|
|
17
|
+
export declare function httpVmStrategy(chunkName: string, remoteName: string, remotes: Remotes, callback: CallbackFunction): Promise<void>;
|
|
18
|
+
export {};
|
|
@@ -39,7 +39,7 @@ async function httpEvalStrategy(chunkName, remoteName, remotes, callback) {
|
|
|
39
39
|
url = new URL(chunkName, __webpack_require__.p);
|
|
40
40
|
}
|
|
41
41
|
catch (e) {
|
|
42
|
-
console.error('module-federation: failed to construct absolute chunk path of', remoteName, 'for', chunkName
|
|
42
|
+
console.error('module-federation: failed to construct absolute chunk path of', remoteName, 'for', chunkName);
|
|
43
43
|
url = new URL(remotes[remoteName]);
|
|
44
44
|
const getBasenameFromUrl = (url) => {
|
|
45
45
|
const urlParts = url.split('/');
|
|
@@ -52,7 +52,7 @@ async function httpEvalStrategy(chunkName, remoteName, remotes, callback) {
|
|
|
52
52
|
const chunk = {};
|
|
53
53
|
try {
|
|
54
54
|
const urlDirname = url.pathname.split('/').slice(0, -1).join('/');
|
|
55
|
-
eval('(function(exports, require, __dirname, __filename) {' + data + '\n})'
|
|
55
|
+
eval('(function(exports, require, __dirname, __filename) {' + data + '\n})')(chunk, require, urlDirname, chunkName);
|
|
56
56
|
callback(null, chunk);
|
|
57
57
|
}
|
|
58
58
|
catch (e) {
|
|
@@ -65,8 +65,8 @@ exports.httpEvalStrategy = httpEvalStrategy;
|
|
|
65
65
|
* This function is used to execute a chunk of code in a VM using HTTP or HTTPS based on the protocol.
|
|
66
66
|
* @param {string} chunkName - The name of the chunk to be executed.
|
|
67
67
|
* @param {string} remoteName - The name of the remote server.
|
|
68
|
-
* @param {
|
|
69
|
-
* @param {
|
|
68
|
+
* @param {Remotes} remotes - An object containing the remote servers.
|
|
69
|
+
* @param {CallbackFunction} callback - A callback function to be executed after the chunk is executed.
|
|
70
70
|
*/
|
|
71
71
|
async function httpVmStrategy(chunkName, remoteName, remotes, callback) {
|
|
72
72
|
const http = require('http');
|
|
@@ -74,25 +74,38 @@ async function httpVmStrategy(chunkName, remoteName, remotes, callback) {
|
|
|
74
74
|
const vm = require('vm');
|
|
75
75
|
const path = require('path');
|
|
76
76
|
let url;
|
|
77
|
+
const globalThisVal = new Function('return globalThis')();
|
|
77
78
|
try {
|
|
78
79
|
url = new URL(chunkName, __webpack_require__.p);
|
|
79
80
|
}
|
|
80
81
|
catch (e) {
|
|
81
|
-
console.error('module-federation: failed to construct absolute chunk path of', remoteName, 'for', chunkName
|
|
82
|
-
|
|
82
|
+
console.error('module-federation: failed to construct absolute chunk path of', remoteName, 'for', chunkName);
|
|
83
|
+
// search all instances to see if any have the remote
|
|
84
|
+
const container = globalThisVal['__FEDERATION__']['__INSTANCES__'].find((instance) => {
|
|
85
|
+
if (!instance.moduleCache.has(remoteName))
|
|
86
|
+
return;
|
|
87
|
+
const container = instance.moduleCache.get(remoteName);
|
|
88
|
+
if (!container.remoteInfo)
|
|
89
|
+
return;
|
|
90
|
+
return container.remoteInfo.entry;
|
|
91
|
+
});
|
|
92
|
+
if (!container) {
|
|
93
|
+
throw new Error('Container not found');
|
|
94
|
+
}
|
|
95
|
+
url = new URL(container.moduleCache.get(remoteName).remoteInfo.entry);
|
|
83
96
|
const fileToReplace = path.basename(url.pathname);
|
|
84
97
|
url.pathname = url.pathname.replace(fileToReplace, chunkName);
|
|
85
98
|
}
|
|
86
99
|
const protocol = url.protocol === 'https:' ? https : http;
|
|
87
|
-
protocol.get(url, (res) => {
|
|
100
|
+
protocol.get(url.href, (res) => {
|
|
88
101
|
let data = '';
|
|
89
102
|
res.on('data', (chunk) => {
|
|
90
|
-
data += chunk;
|
|
103
|
+
data += chunk.toString();
|
|
91
104
|
});
|
|
92
105
|
res.on('end', () => {
|
|
93
106
|
const chunk = {};
|
|
94
107
|
const urlDirname = url.pathname.split('/').slice(0, -1).join('/');
|
|
95
|
-
vm.runInThisContext(
|
|
108
|
+
vm.runInThisContext(`(function(exports, require, __dirname, __filename) {${data}\n})`, chunkName)(chunk, require, urlDirname, chunkName);
|
|
96
109
|
callback(null, chunk);
|
|
97
110
|
});
|
|
98
111
|
res.on('error', (err) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stratagies.js","sourceRoot":"","sources":["../../../src/filesystem/stratagies.ts"],"names":[],"mappings":";;;AAAA,aAAa;AACN,KAAK,UAAU,8BAA8B,CAClD,
|
|
1
|
+
{"version":3,"file":"stratagies.js","sourceRoot":"","sources":["../../../src/filesystem/stratagies.ts"],"names":[],"mappings":";;;AAAA,aAAa;AACN,KAAK,UAAU,8BAA8B,CAClD,OAAe,EACf,aAAqB,EACrB,OAAgB,EAChB,QAA0B;IAE1B,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7B,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CACxB,SAAS,EACT,aAAa,GAAG,mBAAmB,CAAC,CAAC,CAAC,OAAO,CAAC,CAC/C,CAAC;IACF,IAAI,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC5B,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC,GAAU,EAAE,OAAe,EAAE,EAAE;YAC7D,IAAI,GAAG,EAAE,CAAC;gBACR,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;gBACpB,OAAO;YACT,CAAC;YACD,MAAM,KAAK,GAAG,EAAE,CAAC;YACjB,IAAI,CAAC;gBACH,EAAE,CAAC,gBAAgB,CACjB,sDAAsD;oBACpD,OAAO;oBACP,MAAM,EACR,QAAQ,CACT,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,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CAAC;QACH,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;YACjB,MAAM,KAAK,GAAG,EAAE,CAAC;YACjB,MAAM,UAAU,GAAG,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAElE,EAAE,CAAC,gBAAgB,CACjB,uDAAuD,IAAI,MAAM,EACjE,SAAS,CACV,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;YACzC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACxB,CAAC,CAAC,CAAC;QACH,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;YACtB,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACtB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AA7DD,wCA6DC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -3,5 +3,3 @@ export { default as NodeFederationPlugin } from './plugins/NodeFederationPlugin'
|
|
|
3
3
|
export { default as UniversalFederationPlugin } from './plugins/UniversalFederationPlugin';
|
|
4
4
|
export { default as ChunkCorrelationPlugin } from './plugins/ChunkCorrelationPlugin';
|
|
5
5
|
export { default as RemotePublicPathPlugin } from './plugins/RemotePublicPathRuntimeModule';
|
|
6
|
-
export { default as NodeContainerPlugin } from './plugins/NodeContainerPlugin';
|
|
7
|
-
export { parseRemotes } from './plugins/NodeFederationPlugin';
|
package/dist/src/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.RemotePublicPathPlugin = exports.ChunkCorrelationPlugin = exports.UniversalFederationPlugin = exports.NodeFederationPlugin = exports.StreamingTargetPlugin = void 0;
|
|
7
7
|
var StreamingTargetPlugin_1 = require("./plugins/StreamingTargetPlugin");
|
|
8
8
|
Object.defineProperty(exports, "StreamingTargetPlugin", { enumerable: true, get: function () { return __importDefault(StreamingTargetPlugin_1).default; } });
|
|
9
9
|
var NodeFederationPlugin_1 = require("./plugins/NodeFederationPlugin");
|
|
@@ -14,8 +14,4 @@ var ChunkCorrelationPlugin_1 = require("./plugins/ChunkCorrelationPlugin");
|
|
|
14
14
|
Object.defineProperty(exports, "ChunkCorrelationPlugin", { enumerable: true, get: function () { return __importDefault(ChunkCorrelationPlugin_1).default; } });
|
|
15
15
|
var RemotePublicPathRuntimeModule_1 = require("./plugins/RemotePublicPathRuntimeModule");
|
|
16
16
|
Object.defineProperty(exports, "RemotePublicPathPlugin", { enumerable: true, get: function () { return __importDefault(RemotePublicPathRuntimeModule_1).default; } });
|
|
17
|
-
var NodeContainerPlugin_1 = require("./plugins/NodeContainerPlugin");
|
|
18
|
-
Object.defineProperty(exports, "NodeContainerPlugin", { enumerable: true, get: function () { return __importDefault(NodeContainerPlugin_1).default; } });
|
|
19
|
-
var NodeFederationPlugin_2 = require("./plugins/NodeFederationPlugin");
|
|
20
|
-
Object.defineProperty(exports, "parseRemotes", { enumerable: true, get: function () { return NodeFederationPlugin_2.parseRemotes; } });
|
|
21
17
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,yEAAmF;AAA1E,+IAAA,OAAO,OAAyB;AACzC,uEAAiF;AAAxE,6IAAA,OAAO,OAAwB;AACxC,iFAA2F;AAAlF,uJAAA,OAAO,OAA6B;AAC7C,2EAAqF;AAA5E,iJAAA,OAAO,OAA0B;AAC1C,yFAA4F;AAAnF,wJAAA,OAAO,OAA0B
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,yEAAmF;AAA1E,+IAAA,OAAO,OAAyB;AACzC,uEAAiF;AAAxE,6IAAA,OAAO,OAAwB;AACxC,iFAA2F;AAAlF,uJAAA,OAAO,OAA6B;AAC7C,2EAAqF;AAA5E,iJAAA,OAAO,OAA0B;AAC1C,yFAA4F;AAAnF,wJAAA,OAAO,OAA0B"}
|
|
@@ -84,20 +84,7 @@ class DynamicFilesystemChunkLoadingRuntimeModule extends RuntimeModule {
|
|
|
84
84
|
]),
|
|
85
85
|
'};',
|
|
86
86
|
]);
|
|
87
|
-
const remoteRegistry = Template.asString([
|
|
88
|
-
`var remotes = ${JSON.stringify(Object.values(remotes).reduce((acc, remote) => {
|
|
89
|
-
const [global, url] = remote.split('@');
|
|
90
|
-
acc[global] = url;
|
|
91
|
-
return acc;
|
|
92
|
-
}, {}))};`,
|
|
93
|
-
Template.asString([
|
|
94
|
-
'Object.keys(remotes).forEach(function(remote) {',
|
|
95
|
-
Template.indent('globalThis.__remote_scope__._config[remote] = remotes[remote];'),
|
|
96
|
-
'});',
|
|
97
|
-
]),
|
|
98
|
-
]);
|
|
99
87
|
return Template.asString([
|
|
100
|
-
remoteRegistry,
|
|
101
88
|
dynamicFilesystemChunkLoadingPluginCode,
|
|
102
89
|
this.runtimeRequirements.has(RuntimeGlobals.baseURI)
|
|
103
90
|
? this._generateBaseUri(chunk, rootOutputDir)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicFilesystemChunkLoadingRuntimeModule.js","sourceRoot":"","sources":["../../../src/plugins/DynamicFilesystemChunkLoadingRuntimeModule.ts"],"names":[],"mappings":";;AAIA,0FAAqF;AACrF,MAAM,EAAE,cAAc,EAAE,aAAa,EAAE,GAAG,OAAO,CAC/C,IAAA,6CAAoB,EAAC,SAAS,CAAC,CACJ,CAAC;AAC9B,MAAM,EAAE,WAAW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,CAAC;QACF,MAAM,eAAe,GAAG,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAClD,cAAc,CAAC,yBAAyB,CACzC;YACC,CAAC,CAAC,GAAG,cAAc,CAAC,qBAAqB,aAAa;YACtD,CAAC,CAAC,SAAS,CAAC;QAEd,MAAM,uCAAuC,GAAG,QAAQ,CAAC,QAAQ,CAAC;YAChE,2CAA8B,CAAC,QAAQ,EAAE;YACzC,6BAAgB,CAAC,QAAQ,EAAE;YAC3B,2BAAc,CAAC,QAAQ,EAAE;YACzB,8FAA8F;YAC9F,QAAQ,CAAC,MAAM,CAAC;gBACd,yBAAyB;gBACzB,QAAQ,CAAC,MAAM,CAAC;oBACd,2GAA2G;oBAC3G,4FAA4F;oBAC5F,wFAAwF;oBACxF,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAC1B,oDAAoD,CAC3C;iBACZ,CAAC;gBACF,GAAG;aACJ,CAAC;YACF,IAAI;SACL,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"DynamicFilesystemChunkLoadingRuntimeModule.js","sourceRoot":"","sources":["../../../src/plugins/DynamicFilesystemChunkLoadingRuntimeModule.ts"],"names":[],"mappings":";;AAIA,0FAAqF;AACrF,MAAM,EAAE,cAAc,EAAE,aAAa,EAAE,GAAG,OAAO,CAC/C,IAAA,6CAAoB,EAAC,SAAS,CAAC,CACJ,CAAC;AAC9B,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAC7B,IAAA,6CAAoB,EAAC,6BAA6B,CAAC,CACJ,CAAC;AAClD,qCAA4C;AAC5C,MAAM,qBAAqB,GAAG,OAAO,CACnC,IAAA,6CAAoB,EAAC,wCAAwC,CAAC,CACJ,CAAC;AAC7D,mEASiC;AACjC,yDAIkC;AAmBlC,MAAM,0CAA2C,SAAQ,aAAa;IAQpE,YACE,mBAAgC,EAChC,OAA0D,EAC1D,mBAAwC;QAExC,KAAK,CAAC,wBAAwB,EAAE,aAAa,CAAC,YAAY,GAAG,CAA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C,GAAG,CAAC,cAAc,CAAC,mBAAmB,CAAC;gBAC9D,CAAC,CAAC,IAAA,2CAAmB,EACjB,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,cAAc,CAAC,mBAAmB,CAAC,EAChE,EAAE,EACF,YAAY,EACZ,aAAa,EACb,OAAO,EACP,IAAI,CACL;gBACH,CAAC,CAAC,qBAAqB;YACzB,EAAE;YACF,IAAA,wDAAgC,EAC9B,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,cAAc,CAAC,oBAAoB,CAAC,EACjE,IAAI,CAAC,OAAO,CAAC,KAAK,CACnB;YACD,EAAE;YACF,IAAA,uCAAe,EACb,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,cAAc,CAAC,yBAAyB,CAAC,EACtE,aAAa,CACd;YACD,EAAE;YACF,IAAA,+CAAuB,EACrB,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,cAAc,CAAC,mBAAmB,CAAC,EAChE,aAAa,CACd;SACF,CAAC,CAAC;IACL,CAAC;CACF;AAED,kBAAe,0CAA0C,CAAC"}
|
|
@@ -18,25 +18,6 @@ interface NodeFederationOptions extends ModuleFederationPluginOptions {
|
|
|
18
18
|
interface Context {
|
|
19
19
|
ModuleFederationPlugin?: typeof container.ModuleFederationPlugin;
|
|
20
20
|
}
|
|
21
|
-
/**
|
|
22
|
-
* This function iterates over all remotes and checks if they
|
|
23
|
-
* are internal or not. If it's an internal remote then we add it to our new object
|
|
24
|
-
* with a key of the name of the remote and value as internal. If it's not an internal
|
|
25
|
-
* remote then we check if there is a '@' in that string which likely means it is a global @ url
|
|
26
|
-
*
|
|
27
|
-
* @param {Record<string, any>} remotes - The remotes to parse.
|
|
28
|
-
* @returns {Record<string, string>} - The parsed remotes.
|
|
29
|
-
* */
|
|
30
|
-
export declare const parseRemotes: (remotes: Record<string, any>) => Record<string, string>;
|
|
31
|
-
/**
|
|
32
|
-
* Parses the remote syntax and returns a formatted string if the remote includes '@' and does not start with 'window', 'global', or 'globalThis'.
|
|
33
|
-
* Otherwise, it returns the original remote string.
|
|
34
|
-
*
|
|
35
|
-
* @param {string} remote - The remote string to parse.
|
|
36
|
-
* @returns {string} - The parsed remote string or the original remote string.
|
|
37
|
-
* @throws {Error} - Throws an error if the remote is not a string.
|
|
38
|
-
*/
|
|
39
|
-
export declare const parseRemoteSyntax: (remote: any) => string;
|
|
40
21
|
/**
|
|
41
22
|
* Class representing a NodeFederationPlugin.
|
|
42
23
|
* @class
|
|
@@ -61,6 +42,5 @@ declare class NodeFederationPlugin {
|
|
|
61
42
|
private preparePluginOptions;
|
|
62
43
|
private updateCompilerOptions;
|
|
63
44
|
private getModuleFederationPlugin;
|
|
64
|
-
private loadModuleFederationPlugin;
|
|
65
45
|
}
|
|
66
46
|
export default NodeFederationPlugin;
|
|
@@ -1,51 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseRemoteSyntax = exports.parseRemotes = void 0;
|
|
4
|
-
const utilities_1 = require("@module-federation/utilities");
|
|
5
|
-
const enhanced_1 = require("@module-federation/enhanced");
|
|
6
|
-
/**
|
|
7
|
-
* This function iterates over all remotes and checks if they
|
|
8
|
-
* are internal or not. If it's an internal remote then we add it to our new object
|
|
9
|
-
* with a key of the name of the remote and value as internal. If it's not an internal
|
|
10
|
-
* remote then we check if there is a '@' in that string which likely means it is a global @ url
|
|
11
|
-
*
|
|
12
|
-
* @param {Record<string, any>} remotes - The remotes to parse.
|
|
13
|
-
* @returns {Record<string, string>} - The parsed remotes.
|
|
14
|
-
* */
|
|
15
|
-
const parseRemotes = (remotes) => {
|
|
16
|
-
if (!remotes || typeof remotes !== 'object') {
|
|
17
|
-
throw new Error('remotes must be an object');
|
|
18
|
-
}
|
|
19
|
-
return Object.entries(remotes).reduce((acc, [key, value]) => {
|
|
20
|
-
const isInternal = value.startsWith('internal ');
|
|
21
|
-
const isGlobal = value.includes('@') &&
|
|
22
|
-
!['window.', 'global.', 'globalThis.', 'self.'].some((prefix) => value.startsWith(prefix));
|
|
23
|
-
acc[key] = isInternal || !isGlobal ? value : (0, exports.parseRemoteSyntax)(value);
|
|
24
|
-
return acc;
|
|
25
|
-
}, {});
|
|
26
|
-
};
|
|
27
|
-
exports.parseRemotes = parseRemotes;
|
|
28
|
-
/**
|
|
29
|
-
* Parses the remote syntax and returns a formatted string if the remote includes '@' and does not start with 'window', 'global', or 'globalThis'.
|
|
30
|
-
* Otherwise, it returns the original remote string.
|
|
31
|
-
*
|
|
32
|
-
* @param {string} remote - The remote string to parse.
|
|
33
|
-
* @returns {string} - The parsed remote string or the original remote string.
|
|
34
|
-
* @throws {Error} - Throws an error if the remote is not a string.
|
|
35
|
-
*/
|
|
36
|
-
const parseRemoteSyntax = (remote) => {
|
|
37
|
-
if (typeof remote !== 'string') {
|
|
38
|
-
throw new Error('remote must be a string');
|
|
39
|
-
}
|
|
40
|
-
if (remote.includes('@')) {
|
|
41
|
-
const [url, global] = (0, utilities_1.extractUrlAndGlobal)(remote);
|
|
42
|
-
if (!['window.', 'global.', 'globalThis.'].some((prefix) => global.startsWith(prefix))) {
|
|
43
|
-
return `globalThis.__remote_scope__.${global}@${url}`;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return remote;
|
|
47
|
-
};
|
|
48
|
-
exports.parseRemoteSyntax = parseRemoteSyntax;
|
|
49
3
|
/**
|
|
50
4
|
* Class representing a NodeFederationPlugin.
|
|
51
5
|
* @class
|
|
@@ -69,7 +23,6 @@ class NodeFederationPlugin {
|
|
|
69
23
|
*/
|
|
70
24
|
apply(compiler) {
|
|
71
25
|
const { webpack } = compiler;
|
|
72
|
-
new enhanced_1.ModuleInfoRuntimePlugin().apply(compiler);
|
|
73
26
|
const pluginOptions = this.preparePluginOptions();
|
|
74
27
|
this.updateCompilerOptions(compiler);
|
|
75
28
|
const ModuleFederationPlugin = this.getModuleFederationPlugin(compiler, webpack);
|
|
@@ -78,13 +31,12 @@ class NodeFederationPlugin {
|
|
|
78
31
|
preparePluginOptions() {
|
|
79
32
|
return {
|
|
80
33
|
...this._options,
|
|
81
|
-
remotes: this._options.remotes
|
|
82
|
-
? (0, exports.parseRemotes)(this._options.remotes)
|
|
83
|
-
: {},
|
|
34
|
+
remotes: this._options.remotes || {},
|
|
84
35
|
};
|
|
85
36
|
}
|
|
86
37
|
updateCompilerOptions(compiler) {
|
|
87
38
|
if (compiler.options && compiler.options.output) {
|
|
39
|
+
//todo, need to change / remove
|
|
88
40
|
compiler.options.output.importMetaName = 'remoteContainerRegistry';
|
|
89
41
|
}
|
|
90
42
|
const chunkFileName = compiler.options?.output?.chunkFilename;
|
|
@@ -97,30 +49,25 @@ class NodeFederationPlugin {
|
|
|
97
49
|
}
|
|
98
50
|
}
|
|
99
51
|
getModuleFederationPlugin(compiler, webpack) {
|
|
100
|
-
let ModuleFederationPlugin;
|
|
101
|
-
if (this.context.ModuleFederationPlugin) {
|
|
102
|
-
ModuleFederationPlugin = this.context.ModuleFederationPlugin;
|
|
103
|
-
}
|
|
104
|
-
else if (webpack &&
|
|
105
|
-
webpack.container &&
|
|
106
|
-
webpack.container.ModuleFederationPlugin) {
|
|
107
|
-
ModuleFederationPlugin = webpack.container.ModuleFederationPlugin;
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
ModuleFederationPlugin = this.loadModuleFederationPlugin();
|
|
111
|
-
}
|
|
112
|
-
return ModuleFederationPlugin;
|
|
113
|
-
}
|
|
114
|
-
loadModuleFederationPlugin() {
|
|
115
52
|
let ModuleFederationPlugin;
|
|
116
53
|
try {
|
|
117
|
-
ModuleFederationPlugin
|
|
118
|
-
require('@module-federation/enhanced').ModuleFederationPlugin;
|
|
54
|
+
return require('@module-federation/enhanced').ModuleFederationPlugin;
|
|
119
55
|
}
|
|
120
56
|
catch (e) {
|
|
121
|
-
|
|
57
|
+
console.error("Can't find @module-federation/enhanced, falling back to webpack ModuleFederationPlugin, this may not work");
|
|
58
|
+
if (this.context.ModuleFederationPlugin) {
|
|
59
|
+
ModuleFederationPlugin = this.context.ModuleFederationPlugin;
|
|
60
|
+
}
|
|
61
|
+
else if (webpack &&
|
|
62
|
+
webpack.container &&
|
|
63
|
+
webpack.container.ModuleFederationPlugin) {
|
|
64
|
+
ModuleFederationPlugin = webpack.container.ModuleFederationPlugin;
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin');
|
|
68
|
+
}
|
|
69
|
+
return ModuleFederationPlugin;
|
|
122
70
|
}
|
|
123
|
-
return ModuleFederationPlugin;
|
|
124
71
|
}
|
|
125
72
|
}
|
|
126
73
|
exports.default = NodeFederationPlugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeFederationPlugin.js","sourceRoot":"","sources":["../../../src/plugins/NodeFederationPlugin.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;
|
|
1
|
+
{"version":3,"file":"NodeFederationPlugin.js","sourceRoot":"","sources":["../../../src/plugins/NodeFederationPlugin.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAyBb;;;GAGG;AACH,MAAM,oBAAoB;IAKxB;;;;;OAKG;IACH,YACE,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,OAAO,EAAyB,EACzD,OAAgB;QAEhB,IAAI,CAAC,QAAQ,GAAG,OAAO,IAAK,EAAoC,CAAC;QACjE,IAAI,CAAC,OAAO,GAAG,OAAO,IAAK,EAAc,CAAC;QAC1C,IAAI,CAAC,WAAW,GAAG,WAAW,IAAI,EAAE,CAAC;IACvC,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,QAAkB;QACtB,MAAM,EAAE,OAAO,EAAE,GAAG,QAAQ,CAAC;QAC7B,MAAM,aAAa,GAAG,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAClD,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC;QACrC,MAAM,sBAAsB,GAAG,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,EAAE,CAAC;gBACxC,sBAAsB,GAAG,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC;YAC/D,CAAC;iBAAM,IACL,OAAO;gBACP,OAAO,CAAC,SAAS;gBACjB,OAAO,CAAC,SAAS,CAAC,sBAAsB,EACxC,CAAC;gBACD,sBAAsB,GAAG,OAAO,CAAC,SAAS,CAAC,sBAAsB,CAAC;YACpE,CAAC;iBAAM,CAAC;gBACN,sBAAsB,GAAG,OAAO,CAAC,8CAA8C,CAAC,CAAC;YACnF,CAAC;YACD,OAAO,sBAAsB,CAAC;QAChC,CAAC;IACH,CAAC;CACF;AAED,kBAAe,oBAAoB,CAAC"}
|
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
*/
|
|
9
9
|
const StreamingTargetPlugin_1 = __importDefault(require("./StreamingTargetPlugin"));
|
|
10
10
|
const NodeFederationPlugin_1 = __importDefault(require("./NodeFederationPlugin"));
|
|
11
|
+
const enhanced_1 = require("@module-federation/enhanced");
|
|
11
12
|
const normalize_webpack_path_1 = require("@module-federation/sdk/normalize-webpack-path");
|
|
12
13
|
/**
|
|
13
14
|
* Class representing a UniversalFederationPlugin
|
|
@@ -21,6 +22,7 @@ class UniversalFederationPlugin {
|
|
|
21
22
|
constructor(options, context) {
|
|
22
23
|
this._options = options || {};
|
|
23
24
|
this.context = context || {};
|
|
25
|
+
this.name = 'ModuleFederationPlugin';
|
|
24
26
|
}
|
|
25
27
|
/**
|
|
26
28
|
* Apply the plugin to the compiler
|
|
@@ -40,9 +42,7 @@ class UniversalFederationPlugin {
|
|
|
40
42
|
new StreamingTargetPlugin_1.default({ ...options, debug }).apply(compiler);
|
|
41
43
|
}
|
|
42
44
|
else {
|
|
43
|
-
new (
|
|
44
|
-
(webpack && webpack.container.ModuleFederationPlugin) ||
|
|
45
|
-
require((0, normalize_webpack_path_1.normalizeWebpackPath)('webpack/lib/container/ModuleFederationPlugin')))(options).apply(compiler);
|
|
45
|
+
new enhanced_1.ModuleFederationPlugin(options).apply(compiler);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UniversalFederationPlugin.js","sourceRoot":"","sources":["../../../src/plugins/UniversalFederationPlugin.ts"],"names":[],"mappings":";;;;;AAAA;;GAEG;AACH,oFAA4D;AAC5D,kFAA0D;
|
|
1
|
+
{"version":3,"file":"UniversalFederationPlugin.js","sourceRoot":"","sources":["../../../src/plugins/UniversalFederationPlugin.ts"],"names":[],"mappings":";;;;;AAAA;;GAEG;AACH,oFAA4D;AAC5D,kFAA0D;AAC1D,0DAAqE;AAGrE,0FAGuD;AAsBvD;;GAEG;AACH,MAAM,yBAAyB;IAK7B;;;;OAIG;IACH,YAAY,OAA8B,EAAE,OAA8B;QACxE,IAAI,CAAC,QAAQ,GAAG,OAAO,IAAK,EAA4B,CAAC;QACzD,IAAI,CAAC,OAAO,GAAG,OAAO,IAAK,EAA4B,CAAC;QACxD,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC;IACvC,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,QAAkB;QACtB,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC;QACtD,MAAM,EAAE,OAAO,EAAE,GAAG,QAAQ,CAAC;QAC7B,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,EAAE,CAAC;YAC5C,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,GAAG,IAAA,uCAAc,EAAC,QAAQ,CAAC,CAAC;QACpE,CAAC;QACD,IACE,QAAQ;YACR,QAAQ,CAAC,OAAO,CAAC,IAAI,KAAK,QAAQ;YAClC,QAAQ,CAAC,OAAO,CAAC,MAAM,KAAK,MAAM;YAClC,QAAQ,CAAC,OAAO,CAAC,MAAM,KAAK,YAAY,EACxC,CAAC;YACD,IAAI,8BAAoB,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YAChE,IAAI,+BAAqB,CAAC,EAAE,GAAG,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACnE,CAAC;aAAM,CAAC;YACN,IAAI,iCAAsB,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;CACF;AAED;;GAEG;AACH,kBAAe,yBAAyB,CAAC"}
|
|
@@ -150,13 +150,9 @@ function generateLoadingCode(withLoading, fn, hasJsMatcher, rootOutputDir, remot
|
|
|
150
150
|
acc[global] = url;
|
|
151
151
|
return acc;
|
|
152
152
|
}, {}))};`,
|
|
153
|
-
`var requestedRemote = globalThis.__remote_scope__[${JSON.stringify(name)}]`,
|
|
154
|
-
"if(typeof requestedRemote === 'function'){",
|
|
155
|
-
Template.indent('requestedRemote = await requestedRemote()'),
|
|
156
|
-
'}',
|
|
157
153
|
`var chunkName = ${RuntimeGlobals.getChunkScriptFilename}(chunkId);`,
|
|
158
154
|
"const loadingStrategy = typeof process !== 'undefined' ? 'http-vm' : 'http-eval';",
|
|
159
|
-
`loadChunkStrategy(loadingStrategy, chunkName,${
|
|
155
|
+
`loadChunkStrategy(loadingStrategy, chunkName,${RuntimeGlobals.require}.federation.initOptions.name, ${RuntimeGlobals.require}.federation.initOptions.remotes, installChunkCallback);`,
|
|
160
156
|
]),
|
|
161
157
|
'}',
|
|
162
158
|
]),
|
|
@@ -273,7 +269,6 @@ function generateLoadScript(runtimeTemplate) {
|
|
|
273
269
|
init: function() {},
|
|
274
270
|
fake: true
|
|
275
271
|
}
|
|
276
|
-
console.log(e);
|
|
277
272
|
callback(e);
|
|
278
273
|
}
|
|
279
274
|
}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpackChunkUtilities.js","sourceRoot":"","sources":["../../../src/plugins/webpackChunk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Ae,CAAC,aAAa,CAAC,OAAO,EAAE;QAClE,iFAAiF;QACjF,oCAAoC;QACpC,QAAQ,CAAC,MAAM,CAAC;YACd,MAAM,cAAc,CAAC,cAAc,4BAA4B;YAC/D,QAAQ,CAAC,MAAM,CAAC;gBACd,GAAG,cAAc,CAAC,eAAe,qCAAqC;aACvE,CAAC;YACF,GAAG;SACJ,CAAC;QACF,GAAG;QACH,2CAA2C;QAC3C,4CAA4C;QAC5C,QAAQ,CAAC,MAAM,CAAC;YACd,oCAAoC;YACpC,QAAQ,CAAC,MAAM,CAAC,CAAC,oCAAoC,CAAC,CAAC;YACvD,GAAG;YACH,mCAAmC;SACpC,CAAC;QACF,GAAG;QACH,eAAe,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,cAAc,KAAK,CAAC,CAAC,CAAC,EAAE;KAC7D,CAAC,GAAG,CAAC;AACR,CAAC;AA1BD,oDA0BC;AACD,SAAgB,gCAAgC,CAC9C,wBAAiC,EACjC,KAA0B;IAE1B,IAAI,CAAC,wBAAwB,EAAE,CAAC;QAC9B,OAAO,8BAA8B,CAAC;IACxC,CAAC;IAED,OAAO,QAAQ,CAAC,QAAQ,CAAC;QACvB,uCAAuC;QACvC,GAAG,cAAc,CAAC,oBAAoB,gBAAgB;QACtD,KAAK;YACH,CAAC,CAAC,oFAAoF;YACtF,CAAC,CAAC,EAAE;QACN,8CAA8C;KAC/C,CAAC,CAAC;AACL,CAAC;AAhBD,4EAgBC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"public": true,
|
|
3
3
|
"name": "@module-federation/node",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.7",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./dist/src/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"./package.json": "./package.json",
|
|
13
13
|
"./utils": {
|
|
14
|
-
"import": "./dist
|
|
14
|
+
"import": "./dist/src/utils/index.js",
|
|
15
15
|
"require": "./dist/src/utils/index.js"
|
|
16
16
|
},
|
|
17
17
|
"./src/plugins/RemotePublicPathPlugin.js": "./dist/src/plugins/RemotePublicPathPlugin.js",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"license": "MIT",
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"node-fetch": "2.7.0",
|
|
43
|
-
"@module-federation/enhanced": "0.0.
|
|
44
|
-
"@module-federation/sdk": "0.0.
|
|
43
|
+
"@module-federation/enhanced": "0.0.9",
|
|
44
|
+
"@module-federation/sdk": "0.0.9",
|
|
45
45
|
"@module-federation/utilities": "3.0.5"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import type { Compiler, container } from 'webpack';
|
|
2
|
-
/**
|
|
3
|
-
* Interface for NodeContainerOptions which extends ContainerPluginOptions
|
|
4
|
-
* @interface
|
|
5
|
-
* @property {Record<string, unknown>} experiments - Optional experiments configuration
|
|
6
|
-
* @property {boolean} debug - Optional debug flag
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Interface for Context
|
|
10
|
-
* @interface
|
|
11
|
-
* @property {typeof container.ContainerPlugin} ContainerPlugin - Optional ContainerPlugin
|
|
12
|
-
*/
|
|
13
|
-
interface Context {
|
|
14
|
-
ContainerPlugin?: typeof container.ContainerPlugin;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* This function iterates over all remotes and checks if they
|
|
18
|
-
* are internal or not. If it's an internal remote then we add it to our new object
|
|
19
|
-
* with a key of the name of the remote and value as internal. If it's not an internal
|
|
20
|
-
* remote then we check if there is a '@' in that string which likely means it is a global @ url
|
|
21
|
-
*
|
|
22
|
-
* @param {Record<string, any>} remotes - The remotes to parse.
|
|
23
|
-
* @returns {Record<string, string>} - The parsed remotes.
|
|
24
|
-
* */
|
|
25
|
-
export declare const parseRemotes: (remotes: Record<string, any>) => Record<string, string>;
|
|
26
|
-
/**
|
|
27
|
-
* Parses the remote syntax and returns a formatted string if the remote includes '@' and does not start with 'window', 'global', or 'globalThis'.
|
|
28
|
-
* Otherwise, it returns the original remote string.
|
|
29
|
-
*
|
|
30
|
-
* @param {string} remote - The remote string to parse.
|
|
31
|
-
* @returns {string} - The parsed remote string or the original remote string.
|
|
32
|
-
* @throws {Error} - Throws an error if the remote is not a string.
|
|
33
|
-
*/
|
|
34
|
-
export declare const parseRemoteSyntax: (remote: any) => string;
|
|
35
|
-
/**
|
|
36
|
-
* Class representing a NodeContainerPlugin.
|
|
37
|
-
* @class
|
|
38
|
-
*/
|
|
39
|
-
declare class NodeContainerPlugin {
|
|
40
|
-
private _options;
|
|
41
|
-
private context;
|
|
42
|
-
private experiments;
|
|
43
|
-
/**
|
|
44
|
-
* Create a NodeContainerPlugin.
|
|
45
|
-
* @constructor
|
|
46
|
-
* @param {NodeContainerOptions} options - The options for the NodeContainerPlugin
|
|
47
|
-
* @param {Context} context - The context for the NodeContainerPlugin
|
|
48
|
-
*/
|
|
49
|
-
constructor({ experiments, debug, ...options }: any, context: Context);
|
|
50
|
-
/**
|
|
51
|
-
* Apply method for the NodeContainerPlugin class.
|
|
52
|
-
* @method
|
|
53
|
-
* @param {Compiler} compiler - The webpack compiler.
|
|
54
|
-
*/
|
|
55
|
-
apply(compiler: Compiler): void;
|
|
56
|
-
}
|
|
57
|
-
export default NodeContainerPlugin;
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseRemoteSyntax = exports.parseRemotes = void 0;
|
|
4
|
-
const utilities_1 = require("@module-federation/utilities");
|
|
5
|
-
// possible remote evaluators
|
|
6
|
-
// this depends on the chunk format selected.
|
|
7
|
-
// commonjs2 - it think, is lazily evaluated - beware
|
|
8
|
-
// const remote = eval(scriptContent + '\n try{' + moduleName + '}catch(e) { null; };');
|
|
9
|
-
// commonjs - fine to use but exports marker doesnt exist
|
|
10
|
-
// const remote = eval('let exports = {};' + scriptContent + 'exports');
|
|
11
|
-
// commonjs-module, ideal since it returns a commonjs module format
|
|
12
|
-
// const remote = eval(scriptContent + 'module.exports')
|
|
13
|
-
/**
|
|
14
|
-
* This function iterates over all remotes and checks if they
|
|
15
|
-
* are internal or not. If it's an internal remote then we add it to our new object
|
|
16
|
-
* with a key of the name of the remote and value as internal. If it's not an internal
|
|
17
|
-
* remote then we check if there is a '@' in that string which likely means it is a global @ url
|
|
18
|
-
*
|
|
19
|
-
* @param {Record<string, any>} remotes - The remotes to parse.
|
|
20
|
-
* @returns {Record<string, string>} - The parsed remotes.
|
|
21
|
-
* */
|
|
22
|
-
const parseRemotes = (remotes) => {
|
|
23
|
-
if (!remotes || typeof remotes !== 'object') {
|
|
24
|
-
throw new Error('remotes must be an object');
|
|
25
|
-
}
|
|
26
|
-
return Object.entries(remotes).reduce((acc, [key, value]) => {
|
|
27
|
-
const isInternal = value.startsWith('internal ');
|
|
28
|
-
const isGlobal = value.includes('@') &&
|
|
29
|
-
!['window.', 'global.', 'globalThis.', 'self.'].some((prefix) => value.startsWith(prefix));
|
|
30
|
-
acc[key] = isInternal || !isGlobal ? value : (0, exports.parseRemoteSyntax)(value);
|
|
31
|
-
return acc;
|
|
32
|
-
}, {});
|
|
33
|
-
};
|
|
34
|
-
exports.parseRemotes = parseRemotes;
|
|
35
|
-
/**
|
|
36
|
-
* Parses the remote syntax and returns a formatted string if the remote includes '@' and does not start with 'window', 'global', or 'globalThis'.
|
|
37
|
-
* Otherwise, it returns the original remote string.
|
|
38
|
-
*
|
|
39
|
-
* @param {string} remote - The remote string to parse.
|
|
40
|
-
* @returns {string} - The parsed remote string or the original remote string.
|
|
41
|
-
* @throws {Error} - Throws an error if the remote is not a string.
|
|
42
|
-
*/
|
|
43
|
-
const parseRemoteSyntax = (remote) => {
|
|
44
|
-
if (typeof remote !== 'string') {
|
|
45
|
-
throw new Error('remote must be a string');
|
|
46
|
-
}
|
|
47
|
-
if (remote.includes('@')) {
|
|
48
|
-
const [url, global] = (0, utilities_1.extractUrlAndGlobal)(remote);
|
|
49
|
-
if (!['window.', 'global.', 'globalThis.'].some((prefix) => global.startsWith(prefix))) {
|
|
50
|
-
return `globalThis.__remote_scope__.${global}@${url}`;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return remote;
|
|
54
|
-
};
|
|
55
|
-
exports.parseRemoteSyntax = parseRemoteSyntax;
|
|
56
|
-
/**
|
|
57
|
-
* Class representing a NodeContainerPlugin.
|
|
58
|
-
* @class
|
|
59
|
-
*/
|
|
60
|
-
class NodeContainerPlugin {
|
|
61
|
-
/**
|
|
62
|
-
* Create a NodeContainerPlugin.
|
|
63
|
-
* @constructor
|
|
64
|
-
* @param {NodeContainerOptions} options - The options for the NodeContainerPlugin
|
|
65
|
-
* @param {Context} context - The context for the NodeContainerPlugin
|
|
66
|
-
*/
|
|
67
|
-
constructor({ experiments, debug, ...options }, context) {
|
|
68
|
-
this._options = options || {};
|
|
69
|
-
this.context = context || {};
|
|
70
|
-
this.experiments = experiments || {};
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Apply method for the NodeContainerPlugin class.
|
|
74
|
-
* @method
|
|
75
|
-
* @param {Compiler} compiler - The webpack compiler.
|
|
76
|
-
*/
|
|
77
|
-
apply(compiler) {
|
|
78
|
-
// When used with Next.js, context is needed to use Next.js webpack
|
|
79
|
-
const { webpack } = compiler;
|
|
80
|
-
const pluginOptions = {
|
|
81
|
-
name: this._options.name,
|
|
82
|
-
filename: this._options.filename,
|
|
83
|
-
exposes: this._options.exposes,
|
|
84
|
-
library: this._options.library,
|
|
85
|
-
runtime: this._options.runtime,
|
|
86
|
-
shareScope: this._options.shareScope,
|
|
87
|
-
};
|
|
88
|
-
// //TODO can use import meta mock object but need to update data structure of remote_scope
|
|
89
|
-
// if (compiler.options && compiler.options.output) {
|
|
90
|
-
// compiler.options.output.importMetaName = 'remoteContainerRegistry';
|
|
91
|
-
// }
|
|
92
|
-
// const chunkFileName = compiler.options?.output?.chunkFilename;
|
|
93
|
-
// const uniqueName =
|
|
94
|
-
// compiler?.options?.output?.uniqueName || this._options.name;
|
|
95
|
-
// if (typeof chunkFileName === 'string' && uniqueName && !chunkFileName.includes(uniqueName)) {
|
|
96
|
-
// const suffix = `-[chunkhash].js`;
|
|
97
|
-
// compiler.options.output.chunkFilename = chunkFileName.replace('.js', suffix);
|
|
98
|
-
// }
|
|
99
|
-
new (this.context.ContainerPlugin ||
|
|
100
|
-
(webpack && webpack.container.ContainerPlugin) ||
|
|
101
|
-
require('webpack/lib/container/ContainerPlugin'))(pluginOptions).apply(compiler);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
exports.default = NodeContainerPlugin;
|
|
105
|
-
//# sourceMappingURL=NodeContainerPlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NodeContainerPlugin.js","sourceRoot":"","sources":["../../../src/plugins/NodeContainerPlugin.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAGb,4DAAmE;AAkBnE,6BAA6B;AAC7B,6CAA6C;AAC7C,qDAAqD;AACrD,yFAAyF;AACzF,yDAAyD;AACzD,wEAAwE;AACxE,mEAAmE;AACnE,wDAAwD;AAExD;;;;;;;;KAQK;AAEE,MAAM,YAAY,GAAG,CAC1B,OAA4B,EACJ,EAAE;IAC1B,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAC5C,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IAC/C,CAAC;IAED,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CACnC,CAAC,GAA2B,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QAC5C,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QACjD,M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