@module-federation/node 2.1.0-canary.6 → 2.1.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/LICENSE +21 -0
- package/README.md +191 -0
- package/dist/jest.config.js.map +1 -0
- package/dist/package.json +78 -0
- package/dist/src/filesystem/stratagies.d.ts +18 -0
- package/{src → dist/src}/filesystem/stratagies.js +22 -9
- package/dist/src/filesystem/stratagies.js.map +1 -0
- package/{src → dist/src}/index.d.ts +0 -2
- package/{src → dist/src}/index.js +1 -5
- package/dist/src/index.js.map +1 -0
- package/{src → dist/src}/plugins/AutomaticPublicPathPlugin.d.ts +1 -1
- package/{src → dist/src}/plugins/AutomaticPublicPathPlugin.js +3 -3
- package/dist/src/plugins/AutomaticPublicPathPlugin.js.map +1 -0
- package/dist/src/plugins/ChunkCorrelationPlugin.js.map +1 -0
- package/{src → dist/src}/plugins/CommonJsChunkLoadingPlugin.js +24 -23
- package/dist/src/plugins/CommonJsChunkLoadingPlugin.js.map +1 -0
- package/{src → dist/src}/plugins/DynamicFilesystemChunkLoadingRuntimeModule.d.ts +1 -1
- package/{src → dist/src}/plugins/DynamicFilesystemChunkLoadingRuntimeModule.js +28 -56
- package/dist/src/plugins/DynamicFilesystemChunkLoadingRuntimeModule.js.map +1 -0
- package/dist/src/plugins/EntryChunkTrackerPlugin.d.ts +13 -0
- package/dist/src/plugins/EntryChunkTrackerPlugin.js +41 -0
- package/dist/src/plugins/EntryChunkTrackerPlugin.js.map +1 -0
- package/{src → dist/src}/plugins/NodeFederationPlugin.d.ts +0 -20
- package/dist/src/plugins/NodeFederationPlugin.js +79 -0
- package/dist/src/plugins/NodeFederationPlugin.js.map +1 -0
- package/{src → dist/src}/plugins/RemotePublicPathRuntimeModule.d.ts +1 -1
- package/dist/src/plugins/RemotePublicPathRuntimeModule.js +132 -0
- package/dist/src/plugins/RemotePublicPathRuntimeModule.js.map +1 -0
- package/{src → dist/src}/plugins/StreamingTargetPlugin.d.ts +2 -2
- package/{src → dist/src}/plugins/StreamingTargetPlugin.js.map +1 -1
- package/{src → dist/src}/plugins/UniversalFederationPlugin.d.ts +1 -0
- package/{src → dist/src}/plugins/UniversalFederationPlugin.js +7 -3
- package/dist/src/plugins/UniversalFederationPlugin.js.map +1 -0
- package/{src → dist/src}/plugins/webpackChunkUtilities.d.ts +1 -1
- package/{src → dist/src}/plugins/webpackChunkUtilities.js +70 -89
- package/dist/src/plugins/webpackChunkUtilities.js.map +1 -0
- package/dist/src/types/index.js.map +1 -0
- package/{src → dist/src}/utils/flush-chunks.d.ts +2 -1
- package/{src → dist/src}/utils/flush-chunks.js +43 -33
- package/dist/src/utils/flush-chunks.js.map +1 -0
- package/{src → dist/src}/utils/hot-reload.d.ts +3 -3
- package/{src → dist/src}/utils/hot-reload.js +59 -17
- package/dist/src/utils/hot-reload.js.map +1 -0
- package/dist/src/utils/index.js.map +1 -0
- package/package.json +22 -18
- package/jest.config.js.map +0 -1
- package/src/filesystem/stratagies.d.ts +0 -11
- package/src/filesystem/stratagies.js.map +0 -1
- package/src/index.js.map +0 -1
- package/src/plugins/AutomaticPublicPathPlugin.js.map +0 -1
- package/src/plugins/ChunkCorrelationPlugin.js.map +0 -1
- package/src/plugins/CommonJsChunkLoadingPlugin.js.map +0 -1
- package/src/plugins/DynamicFilesystemChunkLoadingRuntimeModule.js.map +0 -1
- package/src/plugins/NodeContainerPlugin.d.ts +0 -57
- package/src/plugins/NodeContainerPlugin.js +0 -105
- package/src/plugins/NodeContainerPlugin.js.map +0 -1
- package/src/plugins/NodeFederationPlugin.js +0 -127
- package/src/plugins/NodeFederationPlugin.js.map +0 -1
- package/src/plugins/RemotePublicPathRuntimeModule.js +0 -109
- package/src/plugins/RemotePublicPathRuntimeModule.js.map +0 -1
- package/src/plugins/UniversalFederationPlugin.js.map +0 -1
- package/src/plugins/webpackChunkUtilities.js.map +0 -1
- package/src/types/index.js.map +0 -1
- package/src/utils/flush-chunks.js.map +0 -1
- package/src/utils/hot-reload.js.map +0 -1
- package/src/utils/index.js.map +0 -1
- package/{jest.config.d.ts → dist/jest.config.d.ts} +0 -0
- package/{jest.config.js → dist/jest.config.js} +0 -0
- package/{src → dist/src}/plugins/ChunkCorrelationPlugin.d.ts +6 -6
- /package/{src → dist/src}/plugins/ChunkCorrelationPlugin.js +0 -0
- /package/{src → dist/src}/plugins/CommonJsChunkLoadingPlugin.d.ts +0 -0
- /package/{src → dist/src}/plugins/StreamingTargetPlugin.js +0 -0
- /package/{src → dist/src}/types/index.d.ts +0 -0
- /package/{src → dist/src}/types/index.js +0 -0
- /package/{src → dist/src}/utils/index.d.ts +0 -0
- /package/{src → dist/src}/utils/index.js +0 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateExternalInstallChunkCode = exports.generateInstallChunk = exports.generateLoadScript = exports.handleOnChunkLoad = exports.generateHmrManifestCode = exports.generateLoadingCode = exports.getInitialChunkIds = exports.generateHmrCode = void 0;
|
|
4
|
-
const
|
|
4
|
+
const normalize_webpack_path_1 = require("@module-federation/sdk/normalize-webpack-path");
|
|
5
|
+
const { RuntimeGlobals, Template } = require((0, normalize_webpack_path_1.normalizeWebpackPath)('webpack'));
|
|
5
6
|
/**
|
|
6
7
|
* Generates the hot module replacement (HMR) code.
|
|
7
8
|
* @param {boolean} withHmr - Flag indicating whether HMR is enabled.
|
|
@@ -12,17 +13,17 @@ function generateHmrCode(withHmr, rootOutputDir) {
|
|
|
12
13
|
if (!withHmr) {
|
|
13
14
|
return '// no HMR';
|
|
14
15
|
}
|
|
15
|
-
return
|
|
16
|
+
return Template.asString([
|
|
16
17
|
// Function to load updated chunk
|
|
17
18
|
'function loadUpdateChunk(chunkId, updatedModulesList) {',
|
|
18
|
-
|
|
19
|
+
Template.indent([
|
|
19
20
|
'return new Promise(function(resolve, reject) {',
|
|
20
|
-
|
|
21
|
+
Template.indent([
|
|
21
22
|
// Construct filename for the updated chunk
|
|
22
|
-
`var filename = require('path').join(__dirname, ${JSON.stringify(rootOutputDir)} + ${
|
|
23
|
+
`var filename = require('path').join(__dirname, ${JSON.stringify(rootOutputDir)} + ${RuntimeGlobals.getChunkUpdateScriptFilename}(chunkId));`,
|
|
23
24
|
// Read the updated chunk file
|
|
24
25
|
"require('fs').readFile(filename, 'utf-8', function(err, content) {",
|
|
25
|
-
|
|
26
|
+
Template.indent([
|
|
26
27
|
'if(err) return reject(err);',
|
|
27
28
|
'var update = {};',
|
|
28
29
|
// Execute the updated chunk in the current context
|
|
@@ -32,9 +33,9 @@ function generateHmrCode(withHmr, rootOutputDir) {
|
|
|
32
33
|
'var runtime = update.runtime;',
|
|
33
34
|
// Iterate over the updated modules
|
|
34
35
|
'for(var moduleId in updatedModules) {',
|
|
35
|
-
|
|
36
|
-
`if(${
|
|
37
|
-
|
|
36
|
+
Template.indent([
|
|
37
|
+
`if(${RuntimeGlobals.hasOwnProperty}(updatedModules, moduleId)) {`,
|
|
38
|
+
Template.indent([
|
|
38
39
|
`currentUpdate[moduleId] = updatedModules[moduleId];`,
|
|
39
40
|
'if(updatedModulesList) updatedModulesList.push(moduleId);',
|
|
40
41
|
]),
|
|
@@ -51,19 +52,19 @@ function generateHmrCode(withHmr, rootOutputDir) {
|
|
|
51
52
|
'}',
|
|
52
53
|
'',
|
|
53
54
|
// Replace placeholders in the HMR runtime code
|
|
54
|
-
|
|
55
|
+
Template.getFunctionContent(
|
|
55
56
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
56
57
|
require('webpack/lib/hmr/JavascriptHotModuleReplacement.runtime.js'))
|
|
57
58
|
.replace(/\$key\$/g, 'readFileVm')
|
|
58
59
|
.replace(/\$installedChunks\$/g, 'installedChunks')
|
|
59
60
|
.replace(/\$loadUpdateChunk\$/g, 'loadUpdateChunk')
|
|
60
|
-
.replace(/\$moduleCache\$/g,
|
|
61
|
-
.replace(/\$moduleFactories\$/g,
|
|
62
|
-
.replace(/\$ensureChunkHandlers\$/g,
|
|
63
|
-
.replace(/\$hasOwnProperty\$/g,
|
|
64
|
-
.replace(/\$hmrModuleData\$/g,
|
|
65
|
-
.replace(/\$hmrDownloadUpdateHandlers\$/g,
|
|
66
|
-
.replace(/\$hmrInvalidateModuleHandlers\$/g,
|
|
61
|
+
.replace(/\$moduleCache\$/g, RuntimeGlobals.moduleCache)
|
|
62
|
+
.replace(/\$moduleFactories\$/g, RuntimeGlobals.moduleFactories)
|
|
63
|
+
.replace(/\$ensureChunkHandlers\$/g, RuntimeGlobals.ensureChunkHandlers)
|
|
64
|
+
.replace(/\$hasOwnProperty\$/g, RuntimeGlobals.hasOwnProperty)
|
|
65
|
+
.replace(/\$hmrModuleData\$/g, RuntimeGlobals.hmrModuleData)
|
|
66
|
+
.replace(/\$hmrDownloadUpdateHandlers\$/g, RuntimeGlobals.hmrDownloadUpdateHandlers)
|
|
67
|
+
.replace(/\$hmrInvalidateModuleHandlers\$/g, RuntimeGlobals.hmrInvalidateModuleHandlers),
|
|
67
68
|
]);
|
|
68
69
|
}
|
|
69
70
|
exports.generateHmrCode = generateHmrCode;
|
|
@@ -109,53 +110,49 @@ function generateLoadingCode(withLoading, fn, hasJsMatcher, rootOutputDir, remot
|
|
|
109
110
|
if (!withLoading) {
|
|
110
111
|
return '// no chunk loading';
|
|
111
112
|
}
|
|
112
|
-
return
|
|
113
|
+
return Template.asString([
|
|
113
114
|
'// Dynamic filesystem chunk loading for javascript',
|
|
114
115
|
`${fn}.readFileVm = function(chunkId, promises) {`,
|
|
115
116
|
hasJsMatcher !== false
|
|
116
|
-
?
|
|
117
|
+
? Template.indent([
|
|
117
118
|
'var installedChunkData = installedChunks[chunkId];',
|
|
118
119
|
'if(installedChunkData !== 0) { // 0 means "already installed".',
|
|
119
|
-
|
|
120
|
+
Template.indent([
|
|
120
121
|
'// array of [resolve, reject, promise] means "currently loading"',
|
|
121
122
|
'if(installedChunkData) {',
|
|
122
|
-
|
|
123
|
+
Template.indent(['promises.push(installedChunkData[2]);']),
|
|
123
124
|
'} else {',
|
|
124
|
-
|
|
125
|
+
Template.indent([
|
|
125
126
|
hasJsMatcher === true
|
|
126
127
|
? 'if(true) { // all chunks have JS'
|
|
127
128
|
: `if(${hasJsMatcher('chunkId')}) {`,
|
|
128
|
-
|
|
129
|
+
Template.indent([
|
|
129
130
|
'// load the chunk and return promise to it',
|
|
130
131
|
'var promise = new Promise(async function(resolve, reject) {',
|
|
131
|
-
|
|
132
|
+
Template.indent([
|
|
132
133
|
'installedChunkData = installedChunks[chunkId] = [resolve, reject];',
|
|
133
134
|
'function installChunkCallback(error,chunk){',
|
|
134
|
-
|
|
135
|
+
Template.indent([
|
|
135
136
|
'if(error) return reject(error);',
|
|
136
137
|
'installChunk(chunk);',
|
|
137
138
|
]),
|
|
138
139
|
'}',
|
|
139
140
|
'var fs = typeof process !== "undefined" ? require(\'fs\') : false;',
|
|
140
|
-
`var filename = typeof process !== "undefined" ? require('path').join(__dirname, ${JSON.stringify(rootOutputDir)} + ${
|
|
141
|
+
`var filename = typeof process !== "undefined" ? require('path').join(__dirname, ${JSON.stringify(rootOutputDir)} + ${RuntimeGlobals.getChunkScriptFilename}(chunkId)) : false;`,
|
|
141
142
|
'if(fs && fs.existsSync(filename)) {',
|
|
142
|
-
|
|
143
|
+
Template.indent([
|
|
143
144
|
`loadChunkStrategy('filesystem', chunkId, ${JSON.stringify(rootOutputDir)}, remotes, installChunkCallback);`,
|
|
144
145
|
]),
|
|
145
146
|
'} else { ',
|
|
146
|
-
|
|
147
|
+
Template.indent([
|
|
147
148
|
`var remotes = ${JSON.stringify(Object.values(remotes).reduce((acc, remote) => {
|
|
148
149
|
const [global, url] = remote.split('@');
|
|
149
150
|
acc[global] = url;
|
|
150
151
|
return acc;
|
|
151
152
|
}, {}))};`,
|
|
152
|
-
`var
|
|
153
|
-
"if(typeof requestedRemote === 'function'){",
|
|
154
|
-
webpack_1.Template.indent('requestedRemote = await requestedRemote()'),
|
|
155
|
-
'}',
|
|
156
|
-
`var chunkName = ${webpack_1.RuntimeGlobals.getChunkScriptFilename}(chunkId);`,
|
|
153
|
+
`var chunkName = ${RuntimeGlobals.getChunkScriptFilename}(chunkId);`,
|
|
157
154
|
"const loadingStrategy = typeof process !== 'undefined' ? 'http-vm' : 'http-eval';",
|
|
158
|
-
`loadChunkStrategy(loadingStrategy, chunkName,${
|
|
155
|
+
`loadChunkStrategy(loadingStrategy, chunkName,${RuntimeGlobals.require}.federation.initOptions.name, ${RuntimeGlobals.require}.federation.initOptions.remotes, installChunkCallback);`,
|
|
159
156
|
]),
|
|
160
157
|
'}',
|
|
161
158
|
]),
|
|
@@ -168,7 +165,7 @@ function generateLoadingCode(withLoading, fn, hasJsMatcher, rootOutputDir, remot
|
|
|
168
165
|
]),
|
|
169
166
|
'}',
|
|
170
167
|
])
|
|
171
|
-
:
|
|
168
|
+
: Template.indent(['installedChunks[chunkId] = 0;']),
|
|
172
169
|
'};',
|
|
173
170
|
]);
|
|
174
171
|
}
|
|
@@ -183,16 +180,16 @@ function generateHmrManifestCode(withHmrManifest, rootOutputDir) {
|
|
|
183
180
|
if (!withHmrManifest) {
|
|
184
181
|
return '// no HMR manifest';
|
|
185
182
|
}
|
|
186
|
-
return
|
|
187
|
-
`${
|
|
188
|
-
|
|
183
|
+
return Template.asString([
|
|
184
|
+
`${RuntimeGlobals.hmrDownloadManifest} = function() {`,
|
|
185
|
+
Template.indent([
|
|
189
186
|
'return new Promise(function(resolve, reject) {',
|
|
190
|
-
|
|
191
|
-
`var filename = require('path').join(__dirname, ${JSON.stringify(rootOutputDir)} + ${
|
|
187
|
+
Template.indent([
|
|
188
|
+
`var filename = require('path').join(__dirname, ${JSON.stringify(rootOutputDir)} + ${RuntimeGlobals.getUpdateManifestFilename}());`,
|
|
192
189
|
"require('fs').readFile(filename, 'utf-8', function(err, content) {",
|
|
193
|
-
|
|
190
|
+
Template.indent([
|
|
194
191
|
'if(err) {',
|
|
195
|
-
|
|
192
|
+
Template.indent([
|
|
196
193
|
'if(err.code === "ENOENT") return resolve();',
|
|
197
194
|
'return reject(err);',
|
|
198
195
|
]),
|
|
@@ -216,7 +213,7 @@ exports.generateHmrManifestCode = generateHmrManifestCode;
|
|
|
216
213
|
*/
|
|
217
214
|
function handleOnChunkLoad(withOnChunkLoad, runtimeTemplate) {
|
|
218
215
|
if (withOnChunkLoad) {
|
|
219
|
-
return `${
|
|
216
|
+
return `${RuntimeGlobals.onChunksLoaded}.readFileVm = ${runtimeTemplate.returningFunction('installedChunks[chunkId] === 0', 'chunkId')};`;
|
|
220
217
|
}
|
|
221
218
|
else {
|
|
222
219
|
return '// no on chunks loaded';
|
|
@@ -230,53 +227,37 @@ exports.handleOnChunkLoad = handleOnChunkLoad;
|
|
|
230
227
|
* @returns {string} - The generated load script.
|
|
231
228
|
*/
|
|
232
229
|
function generateLoadScript(runtimeTemplate) {
|
|
233
|
-
return
|
|
230
|
+
return Template.asString([
|
|
234
231
|
'// load script equivalent for server side',
|
|
235
|
-
`${
|
|
236
|
-
|
|
232
|
+
`${RuntimeGlobals.loadScript} = ${runtimeTemplate.basicFunction('url, callback, chunkId', [
|
|
233
|
+
Template.indent([
|
|
237
234
|
`async function executeLoad(url, callback, name) {
|
|
238
235
|
if (!name) {
|
|
239
236
|
throw new Error('__webpack_require__.l name is required for ' + url);
|
|
240
237
|
}
|
|
241
|
-
|
|
242
|
-
if(
|
|
243
|
-
|
|
238
|
+
const usesInternalRef = name.startsWith('__webpack_require__')
|
|
239
|
+
if (usesInternalRef) {
|
|
240
|
+
const regex = /__webpack_require__\\.federation\\.instance\\.moduleCache\\.get\\(([^)]+)\\)/;
|
|
241
|
+
const match = name.match(regex);
|
|
242
|
+
if (match) {
|
|
243
|
+
name = match[1].replace(/["']/g, '');
|
|
244
|
+
}
|
|
244
245
|
}
|
|
245
|
-
if (typeof globalThis.__remote_scope__[remoteName] !== 'undefined') return callback(globalThis.__remote_scope__[remoteName]);
|
|
246
|
-
globalThis.__remote_scope__._config[remoteName] = url;
|
|
247
246
|
try {
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
const exp = {};
|
|
255
|
-
remote = {exports:{}};
|
|
256
|
-
remoteCapsule(exp,require,remote,'node-federation-loader-' + name + '.vm',__dirname);
|
|
257
|
-
remote = remote.exports || remote;
|
|
258
|
-
} else {
|
|
259
|
-
remote = eval('let module = {};' + scriptContent + '\\nmodule.exports')
|
|
260
|
-
}
|
|
261
|
-
globalThis.__remote_scope__[remoteName] = remote[remoteName] || remote;
|
|
262
|
-
globalThis.__remote_scope__._config[remoteName] = url;
|
|
263
|
-
callback(globalThis.__remote_scope__[remoteName])
|
|
264
|
-
} catch (e) {
|
|
265
|
-
e.target = {src: url};
|
|
266
|
-
globalThis.__remote_scope__[remoteName] = {
|
|
267
|
-
get: function() {
|
|
268
|
-
return function() {
|
|
269
|
-
return ()=>null
|
|
270
|
-
}
|
|
271
|
-
},
|
|
272
|
-
init: function() {},
|
|
273
|
-
fake: true
|
|
247
|
+
const federation = ${RuntimeGlobals.require}.federation;
|
|
248
|
+
const res = await ${RuntimeGlobals.require}.federation.runtime.loadScriptNode(url, { attrs: {} });
|
|
249
|
+
const enhancedRemote = federation.instance.initRawContainer(name, url, res);
|
|
250
|
+
// use normal global assignment
|
|
251
|
+
if(!usesInternalRef && !globalThis[name]) {
|
|
252
|
+
globalThis[name] = enhancedRemote
|
|
274
253
|
}
|
|
275
|
-
|
|
276
|
-
|
|
254
|
+
callback(enhancedRemote);
|
|
255
|
+
} catch (error) {
|
|
256
|
+
callback(error);
|
|
277
257
|
}
|
|
258
|
+
|
|
278
259
|
}`,
|
|
279
|
-
`executeLoad(url,callback,chunkId)
|
|
260
|
+
`executeLoad(url, callback, chunkId);`,
|
|
280
261
|
]),
|
|
281
262
|
])}`,
|
|
282
263
|
]);
|
|
@@ -286,24 +267,24 @@ function generateInstallChunk(runtimeTemplate, withOnChunkLoad) {
|
|
|
286
267
|
return `var installChunk = ${runtimeTemplate.basicFunction('chunk', [
|
|
287
268
|
'var moreModules = chunk.modules, chunkIds = chunk.ids, runtime = chunk.runtime;',
|
|
288
269
|
'for(var moduleId in moreModules) {',
|
|
289
|
-
|
|
290
|
-
`if(${
|
|
291
|
-
|
|
292
|
-
`${
|
|
270
|
+
Template.indent([
|
|
271
|
+
`if(${RuntimeGlobals.hasOwnProperty}(moreModules, moduleId)) {`,
|
|
272
|
+
Template.indent([
|
|
273
|
+
`${RuntimeGlobals.moduleFactories}[moduleId] = moreModules[moduleId];`,
|
|
293
274
|
]),
|
|
294
275
|
'}',
|
|
295
276
|
]),
|
|
296
277
|
'}',
|
|
297
278
|
'if(runtime) runtime(__webpack_require__);',
|
|
298
279
|
'for(var i = 0; i < chunkIds.length; i++) {',
|
|
299
|
-
|
|
280
|
+
Template.indent([
|
|
300
281
|
'if(installedChunks[chunkIds[i]]) {',
|
|
301
|
-
|
|
282
|
+
Template.indent(['installedChunks[chunkIds[i]][0]();']),
|
|
302
283
|
'}',
|
|
303
284
|
'installedChunks[chunkIds[i]] = 0;',
|
|
304
285
|
]),
|
|
305
286
|
'}',
|
|
306
|
-
withOnChunkLoad ? `${
|
|
287
|
+
withOnChunkLoad ? `${RuntimeGlobals.onChunksLoaded}();` : '',
|
|
307
288
|
])};`;
|
|
308
289
|
}
|
|
309
290
|
exports.generateInstallChunk = generateInstallChunk;
|
|
@@ -311,9 +292,9 @@ function generateExternalInstallChunkCode(withExternalInstallChunk, debug) {
|
|
|
311
292
|
if (!withExternalInstallChunk) {
|
|
312
293
|
return '// no external install chunk';
|
|
313
294
|
}
|
|
314
|
-
return
|
|
295
|
+
return Template.asString([
|
|
315
296
|
'module.exports = __webpack_require__;',
|
|
316
|
-
`${
|
|
297
|
+
`${RuntimeGlobals.externalInstallChunk} = function(){`,
|
|
317
298
|
debug
|
|
318
299
|
? `console.debug('node: webpack installing to install chunk id:', arguments['0'].id);`
|
|
319
300
|
: '',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webpackChunkUtilities.js","sourceRoot":"","sources":["../../../src/plugins/webpackChunkUtilities.ts"],"names":[],"mappings":";;;AAAA,0FAAqF;AACrF,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,OAAO,CAC1C,IAAA,6CAAoB,EAAC,SAAS,CAAC,CACJ,CAAC;AAG9B;;;;;GAKG;AACH,SAAgB,eAAe,CAC7B,OAAgB,EAChB,aAAqB;IAErB,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,OAAO,QAAQ,CAAC,QAAQ,CAAC;QACvB,iCAAiC;QACjC,yDAAyD;QACzD,QAAQ,CAAC,MAAM,CAAC;YACd,gDAAgD;YAChD,QAAQ,CAAC,MAAM,CAAC;gBACd,2CAA2C;gBAC3C,kDAAkD,IAAI,CAAC,SAAS,CAC9D,aAAa,CACd,MAAM,cAAc,CAAC,4BAA4B,aAAa;gBAC/D,8BAA8B;gBAC9B,oEAAoE;gBACpE,QAAQ,CAAC,MAAM,CAAC;oBACd,6BAA6B;oBAC7B,kBAAkB;oBAClB,mDAAmD;oBACnD,sHAAsH;wBACpH,iEAAiE;oBACnE,sCAAsC;oBACtC,+BAA+B;oBAC/B,mCAAmC;oBACnC,uCAAuC;oBACvC,QAAQ,CAAC,MAAM,CAAC;wBACd,MAAM,cAAc,CAAC,cAAc,+BAA+B;wBAClE,QAAQ,CAAC,MAAM,CAAC;4BACd,qDAAqD;4BACrD,2DAA2D;yBAC5D,CAAC;wBACF,GAAG;qBACJ,CAAC;oBACF,GAAG;oBACH,iDAAiD;oBACjD,YAAY;iBACb,CAAC;gBACF,KAAK;aACN,CAAC;YACF,KAAK;SACN,CAAC;QACF,GAAG;QACH,EAAE;QACF,+CAA+C;QAC/C,QAAQ,CAAC,kBAAkB;QACzB,8DAA8D;QAC9D,OAAO,CAAC,2DAA2D,CAAC,CACrE;aACE,OAAO,CAAC,UAAU,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;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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":""}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* Initialize usedChunks and share it globally.
|
|
3
3
|
* @type {Set}
|
|
4
4
|
*/
|
|
5
|
-
export declare const usedChunks:
|
|
5
|
+
export declare const usedChunks: any;
|
|
6
|
+
export declare const getAllKnownRemotes: () => {};
|
|
6
7
|
/**
|
|
7
8
|
* Flush the chunks and return a deduplicated array of chunks.
|
|
8
9
|
* @returns {Promise<Array>} A promise that resolves to an array of deduplicated chunks.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* eslint-disable no-undef */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.flushChunks = exports.usedChunks = void 0;
|
|
4
|
+
exports.flushChunks = exports.getAllKnownRemotes = exports.usedChunks = void 0;
|
|
5
5
|
// @ts-ignore
|
|
6
6
|
if (!globalThis.usedChunks) {
|
|
7
7
|
// @ts-ignore
|
|
@@ -19,12 +19,36 @@ exports.usedChunks = globalThis.usedChunks;
|
|
|
19
19
|
*/
|
|
20
20
|
const loadHostStats = () => {
|
|
21
21
|
try {
|
|
22
|
+
//@ts-ignore
|
|
22
23
|
return __non_webpack_require__('../federated-stats.json');
|
|
23
24
|
}
|
|
24
25
|
catch (e) {
|
|
25
26
|
return {};
|
|
26
27
|
}
|
|
27
28
|
};
|
|
29
|
+
const getAllKnownRemotes = function () {
|
|
30
|
+
// Attempt to access the global federation controller safely
|
|
31
|
+
const federationController = new Function('return globalThis')()
|
|
32
|
+
.__FEDERATION__;
|
|
33
|
+
if (!federationController || !federationController.__INSTANCES__) {
|
|
34
|
+
// If the federation controller or instances are not defined, return an empty object
|
|
35
|
+
return {};
|
|
36
|
+
}
|
|
37
|
+
var collected = {};
|
|
38
|
+
// Use a for...of loop to iterate over all federation instances
|
|
39
|
+
for (const instance of federationController.__INSTANCES__) {
|
|
40
|
+
// Use another for...of loop to iterate over the module cache Map entries
|
|
41
|
+
for (const [key, cacheModule] of instance.moduleCache) {
|
|
42
|
+
// Check if the cacheModule has remoteInfo and use it to collect remote names
|
|
43
|
+
if (cacheModule.remoteInfo) {
|
|
44
|
+
//@ts-ignore
|
|
45
|
+
collected[cacheModule.remoteInfo.name] = cacheModule.remoteInfo;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return collected;
|
|
50
|
+
};
|
|
51
|
+
exports.getAllKnownRemotes = getAllKnownRemotes;
|
|
28
52
|
/**
|
|
29
53
|
* Create a shareMap based on the loaded modules.
|
|
30
54
|
* @returns {object} shareMap - An object containing the shareMap data.
|
|
@@ -66,66 +90,53 @@ const createShareMap = () => {
|
|
|
66
90
|
*/
|
|
67
91
|
// @ts-ignore
|
|
68
92
|
const processChunk = async (chunk, shareMap, hostStats) => {
|
|
69
|
-
// Create a set to store the chunks
|
|
70
93
|
const chunks = new Set();
|
|
71
|
-
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
94
|
+
const [remote, req] = chunk.split('/');
|
|
95
|
+
const request = './' + req;
|
|
96
|
+
const knownRemotes = (0, exports.getAllKnownRemotes)();
|
|
97
|
+
//@ts-ignore
|
|
98
|
+
if (!knownRemotes[remote]) {
|
|
99
|
+
console.error(`flush chunks: Remote ${remote} is not defined in the global config`);
|
|
76
100
|
return;
|
|
77
101
|
}
|
|
78
102
|
try {
|
|
79
|
-
// Extract the remote name from the URL
|
|
80
103
|
//@ts-ignore
|
|
81
|
-
const remoteName = new URL(
|
|
104
|
+
const remoteName = new URL(knownRemotes[remote].entry).pathname
|
|
82
105
|
.split('/')
|
|
83
106
|
.pop();
|
|
84
|
-
|
|
85
|
-
const statsFile =
|
|
107
|
+
//@ts-ignore
|
|
108
|
+
const statsFile = knownRemotes[remote].entry
|
|
86
109
|
.replace(remoteName, 'federated-stats.json')
|
|
87
110
|
.replace('ssr', 'chunks');
|
|
88
111
|
let stats = {};
|
|
89
112
|
try {
|
|
90
|
-
// Fetch the remote config and stats file
|
|
91
113
|
stats = await fetch(statsFile).then((res) => res.json());
|
|
92
114
|
}
|
|
93
115
|
catch (e) {
|
|
94
116
|
console.error('flush error', e);
|
|
95
117
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
// global.__remote_scope__._config[remote].replace('ssr', 'chunks')
|
|
100
|
-
// );
|
|
101
|
-
// Extract the prefix from the remote config
|
|
102
|
-
const [prefix] = globalThis.__remote_scope__._config[remote].split('static/');
|
|
103
|
-
// Process federated modules from the stats object
|
|
104
|
-
// @ts-ignore
|
|
118
|
+
//@ts-ignore
|
|
119
|
+
const [prefix] = knownRemotes[remote].entry.split('static/');
|
|
120
|
+
//@ts-ignore
|
|
105
121
|
if (stats.federatedModules) {
|
|
106
|
-
|
|
122
|
+
//@ts-ignore
|
|
107
123
|
stats.federatedModules.forEach((modules) => {
|
|
108
|
-
// Process exposed modules
|
|
109
124
|
if (modules.exposes?.[request]) {
|
|
110
|
-
|
|
125
|
+
//@ts-ignore
|
|
111
126
|
modules.exposes[request].forEach((chunk) => {
|
|
112
127
|
chunks.add([prefix, chunk].join(''));
|
|
113
|
-
//TODO: reimplement this
|
|
114
128
|
Object.values(chunk).forEach((chunk) => {
|
|
115
|
-
|
|
116
|
-
// @ts-ignore
|
|
129
|
+
//@ts-ignore
|
|
117
130
|
if (chunk.files) {
|
|
118
|
-
|
|
131
|
+
//@ts-ignore
|
|
119
132
|
chunk.files.forEach((file) => {
|
|
120
133
|
chunks.add(prefix + file);
|
|
121
134
|
});
|
|
122
135
|
}
|
|
123
|
-
|
|
124
|
-
// @ts-ignore
|
|
136
|
+
//@ts-ignore
|
|
125
137
|
if (chunk.requiredModules) {
|
|
126
|
-
|
|
138
|
+
//@ts-ignore
|
|
127
139
|
chunk.requiredModules.forEach((module) => {
|
|
128
|
-
// Check if the module is in the shareMap
|
|
129
140
|
if (shareMap[module]) {
|
|
130
141
|
// If the module is from the host, log the host stats
|
|
131
142
|
}
|
|
@@ -136,7 +147,6 @@ const processChunk = async (chunk, shareMap, hostStats) => {
|
|
|
136
147
|
}
|
|
137
148
|
});
|
|
138
149
|
}
|
|
139
|
-
// Return the array of chunks
|
|
140
150
|
return Array.from(chunks);
|
|
141
151
|
}
|
|
142
152
|
catch (e) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flush-chunks.js","sourceRoot":"","sources":["../../../src/utils/flush-chunks.ts"],"names":[],"mappings":";AAAA,6BAA6B;;;AAE7B,aAAa;AACb,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC;IAC3B,aAAa;IACb,UAAU,CAAC,UAAU,GAAG,IAAI,GAAG,EAAE,CAAC;AACpC,CAAC;AACD;;;GAGG;AACH,aAAa;AACE,kBAAU,GAAK,UAAU,YAAC;AACzC;;;G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AAO,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC,CAAC;AAjBW,QAAA,WAAW,eAiBtB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare const performReload: (shouldReload: any) => boolean
|
|
1
|
+
export declare const performReload: (shouldReload: any) => Promise<boolean>;
|
|
2
2
|
export declare const checkUnreachableRemote: (remoteScope: any) => boolean;
|
|
3
3
|
export declare const checkMedusaConfigChange: (remoteScope: any, fetchModule: any) => boolean;
|
|
4
4
|
export declare const checkFakeRemote: (remoteScope: any) => boolean;
|
|
5
|
-
export declare const fetchRemote: (remoteScope: any, fetchModule: any) => Promise<
|
|
6
|
-
export declare const revalidate: (
|
|
5
|
+
export declare const fetchRemote: (remoteScope: any, fetchModule: any) => Promise<boolean>;
|
|
6
|
+
export declare const revalidate: (fetchModule?: any, force?: boolean) => Promise<boolean>;
|
|
7
7
|
export declare function getFetchModule(): any;
|
|
@@ -4,27 +4,56 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getFetchModule = exports.revalidate = exports.fetchRemote = exports.checkFakeRemote = exports.checkMedusaConfigChange = exports.checkUnreachableRemote = exports.performReload = void 0;
|
|
7
|
+
const flush_chunks_1 = require("./flush-chunks");
|
|
7
8
|
const hashmap = {};
|
|
8
9
|
const crypto_1 = __importDefault(require("crypto"));
|
|
9
|
-
const requireCacheRegex = /(remote|
|
|
10
|
-
const performReload = (shouldReload) => {
|
|
10
|
+
const requireCacheRegex = /(remote|server|hot-reload|react-loadable-manifest|runtime|styled-jsx)/;
|
|
11
|
+
const performReload = async (shouldReload) => {
|
|
11
12
|
if (!shouldReload) {
|
|
12
13
|
return false;
|
|
13
14
|
}
|
|
15
|
+
const remotesFromAPI = (0, flush_chunks_1.getAllKnownRemotes)();
|
|
14
16
|
let req;
|
|
17
|
+
//@ts-ignore
|
|
15
18
|
if (typeof __non_webpack_require__ === 'undefined') {
|
|
16
19
|
req = require;
|
|
17
20
|
}
|
|
18
21
|
else {
|
|
22
|
+
//@ts-ignore
|
|
19
23
|
req = __non_webpack_require__;
|
|
20
24
|
}
|
|
25
|
+
const gs = new Function('return globalThis')();
|
|
26
|
+
const entries = Array.from(gs.entryChunkCache || []);
|
|
27
|
+
if (!gs.entryChunkCache) {
|
|
28
|
+
Object.keys(req.cache).forEach((key) => {
|
|
29
|
+
//delete req.cache[key];
|
|
30
|
+
if (requireCacheRegex.test(key)) {
|
|
31
|
+
delete req.cache[key];
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
gs.entryChunkCache.clear();
|
|
37
|
+
}
|
|
21
38
|
//@ts-ignore
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
39
|
+
__webpack_require__.federation.instance.moduleCache.clear();
|
|
40
|
+
gs.__GLOBAL_LOADING_REMOTE_ENTRY__ = {};
|
|
41
|
+
//@ts-ignore
|
|
42
|
+
gs.__FEDERATION__.__INSTANCES__.map((i) => {
|
|
43
|
+
i.moduleCache.clear();
|
|
44
|
+
if (gs[i.name]) {
|
|
45
|
+
delete gs[i.name];
|
|
26
46
|
}
|
|
27
47
|
});
|
|
48
|
+
gs.__FEDERATION__.__INSTANCES__ = [];
|
|
49
|
+
for (const entry of entries) {
|
|
50
|
+
//@ts-ignore
|
|
51
|
+
delete __non_webpack_require__.cache[entry];
|
|
52
|
+
}
|
|
53
|
+
//reload entries again
|
|
54
|
+
for (const entry of entries) {
|
|
55
|
+
await __non_webpack_require__(entry);
|
|
56
|
+
}
|
|
28
57
|
return true;
|
|
29
58
|
};
|
|
30
59
|
exports.performReload = performReload;
|
|
@@ -78,9 +107,11 @@ const checkFakeRemote = (remoteScope) => {
|
|
|
78
107
|
exports.checkFakeRemote = checkFakeRemote;
|
|
79
108
|
const fetchRemote = (remoteScope, fetchModule) => {
|
|
80
109
|
const fetches = [];
|
|
81
|
-
|
|
110
|
+
let needReload = false;
|
|
111
|
+
for (const property in remoteScope) {
|
|
82
112
|
const name = property;
|
|
83
|
-
const
|
|
113
|
+
const container = remoteScope[property];
|
|
114
|
+
const url = container.entry;
|
|
84
115
|
const fetcher = fetchModule(url)
|
|
85
116
|
.then((re) => {
|
|
86
117
|
if (!re.ok) {
|
|
@@ -93,6 +124,7 @@ const fetchRemote = (remoteScope, fetchModule) => {
|
|
|
93
124
|
if (hashmap[name]) {
|
|
94
125
|
if (hashmap[name] !== hash) {
|
|
95
126
|
hashmap[name] = hash;
|
|
127
|
+
needReload = true;
|
|
96
128
|
console.log(name, 'hash is different - must hot reload server');
|
|
97
129
|
return true;
|
|
98
130
|
}
|
|
@@ -106,23 +138,31 @@ const fetchRemote = (remoteScope, fetchModule) => {
|
|
|
106
138
|
});
|
|
107
139
|
fetches.push(fetcher);
|
|
108
140
|
}
|
|
109
|
-
return Promise.all(fetches)
|
|
141
|
+
return Promise.all(fetches).then(() => {
|
|
142
|
+
return needReload;
|
|
143
|
+
});
|
|
110
144
|
};
|
|
111
145
|
exports.fetchRemote = fetchRemote;
|
|
112
146
|
//@ts-ignore
|
|
113
|
-
const revalidate = (
|
|
147
|
+
const revalidate = async (fetchModule = getFetchModule() || (() => { }), force = false) => {
|
|
148
|
+
const remotesFromAPI = (0, flush_chunks_1.getAllKnownRemotes)();
|
|
149
|
+
//@ts-ignore
|
|
114
150
|
return new Promise((res) => {
|
|
115
|
-
if (
|
|
116
|
-
|
|
151
|
+
if (force) {
|
|
152
|
+
if (Object.keys(hashmap).length !== 0) {
|
|
153
|
+
res(true);
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
117
156
|
}
|
|
118
|
-
|
|
119
|
-
if ((0, exports.checkMedusaConfigChange)(remoteScope, fetchModule)) {
|
|
157
|
+
if ((0, exports.checkMedusaConfigChange)(remotesFromAPI, fetchModule)) {
|
|
120
158
|
res(true);
|
|
121
159
|
}
|
|
122
|
-
if ((0, exports.checkFakeRemote)(
|
|
160
|
+
if ((0, exports.checkFakeRemote)(remotesFromAPI)) {
|
|
123
161
|
res(true);
|
|
124
162
|
}
|
|
125
|
-
(0, exports.fetchRemote)(
|
|
163
|
+
(0, exports.fetchRemote)(remotesFromAPI, fetchModule).then((val) => {
|
|
164
|
+
res(val);
|
|
165
|
+
});
|
|
126
166
|
}).then((shouldReload) => {
|
|
127
167
|
return (0, exports.performReload)(shouldReload);
|
|
128
168
|
});
|
|
@@ -130,7 +170,9 @@ const revalidate = (remoteScope = globalThis.__remote_scope__ || {}, fetchModule
|
|
|
130
170
|
exports.revalidate = revalidate;
|
|
131
171
|
function getFetchModule() {
|
|
132
172
|
//@ts-ignore
|
|
133
|
-
const loadedModule =
|
|
173
|
+
const loadedModule =
|
|
174
|
+
//@ts-ignore
|
|
175
|
+
globalThis.webpackChunkLoad || global.webpackChunkLoad || global.fetch;
|
|
134
176
|
if (loadedModule) {
|
|
135
177
|
return loadedModule;
|
|
136
178
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hot-reload.js","sourceRoot":"","sources":["../../../src/utils/hot-reload.ts"],"names":[],"mappings":";;;;;;AAAA,iDAAoD;AAEpD,MAAM,OAAO,GAAG,EAA4B,CAAC;AAC7C,oDAA4B;AAE5B,MAAM,iBAAiB,GACrB,uEAAuE,CAAC;AAEnE,MAAM,aAAa,GAAG,KAAK,EAAE,YAAiB,EAAE,EAAE;IACvD,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,cAAc,GAAG,IAAA,iCAAkB,GAAE,CAAC;IAE5C,IAAI,GAAgB,CAAC;IACrB,YAAY;IACZ,IAAI,OAAO,uBAAuB,KAAK,WAAW,EAAE,CAAC;QACnD,GAAG,GAAG,OAAO,CAAC;IAChB,CAAC;SAAM,CAAC;QACN,YAAY;QACZ,GAAG,GAAG,uBAAsC,CAAC;IAC/C,CAAC;IAED,MAAM,E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