@module-federation/node 0.0.0-next-20240528115713 → 0.0.0-next-20240528203231
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 +2 -19
- package/dist/src/index.d.ts +0 -1
- package/dist/src/index.js +1 -3
- package/dist/src/index.js.map +1 -1
- package/dist/src/plugins/EntryChunkTrackerPlugin.js +2 -2
- package/dist/src/utils/hot-reload.d.ts +0 -4
- package/dist/src/utils/hot-reload.js +16 -20
- package/dist/src/utils/hot-reload.js.map +1 -1
- package/package.json +5 -22
- package/dist/src/recordDynamicRemoteEntryHashPlugin.d.ts +0 -3
- package/dist/src/recordDynamicRemoteEntryHashPlugin.js +0 -55
- package/dist/src/recordDynamicRemoteEntryHashPlugin.js.map +0 -1
package/dist/package.json
CHANGED
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
},
|
|
12
12
|
"./package.json": "./package.json",
|
|
13
13
|
"./runtimePlugin": "./dist/src/runtimePlugin.js",
|
|
14
|
-
"./record-dynamic-remote-entry-hash-plugin": "./dist/src/recordDynamicRemoteEntryHashPlugin.js",
|
|
15
14
|
"./utils": {
|
|
16
15
|
"import": "./dist/src/utils/index.js",
|
|
17
16
|
"require": "./dist/src/utils/index.js"
|
|
@@ -20,22 +19,6 @@
|
|
|
20
19
|
"./src/plugins/NodeFederationPlugin.js": "./dist/src/plugins/NodeFederationPlugin.js",
|
|
21
20
|
"./src/": "./dist/src/"
|
|
22
21
|
},
|
|
23
|
-
"typesVersions": {
|
|
24
|
-
"*": {
|
|
25
|
-
".": [
|
|
26
|
-
"./dist/src/index.d.ts"
|
|
27
|
-
],
|
|
28
|
-
"runtimePlugin": [
|
|
29
|
-
"./dist/src/runtimePlugin.d.ts"
|
|
30
|
-
],
|
|
31
|
-
"utils": [
|
|
32
|
-
"./dist/src/utils/index.d.ts"
|
|
33
|
-
],
|
|
34
|
-
"record-dynamic-remote-entry-hash-plugin": [
|
|
35
|
-
"./dist/src/record-dynamic-remote-entry-hash-plugin.d.ts"
|
|
36
|
-
]
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
22
|
"files": [
|
|
40
23
|
"dist/",
|
|
41
24
|
"README.md"
|
|
@@ -65,7 +48,7 @@
|
|
|
65
48
|
"@module-federation/webpack-bundler-runtime": "0.0.8",
|
|
66
49
|
"@types/koa": "2.11.2",
|
|
67
50
|
"@types/node-schedule": "2.1.7",
|
|
68
|
-
"@types/ws": "8.5.
|
|
51
|
+
"@types/ws": "8.5.10",
|
|
69
52
|
"adm-zip": "0.5.10",
|
|
70
53
|
"ansi-colors": "4.1.3",
|
|
71
54
|
"axios": "1.6.7",
|
|
@@ -86,7 +69,7 @@
|
|
|
86
69
|
"upath": "2.0.1",
|
|
87
70
|
"url": "0.11.3",
|
|
88
71
|
"webpack-sources": "3.2.3",
|
|
89
|
-
"ws": "8.
|
|
72
|
+
"ws": "8.17.0",
|
|
90
73
|
"@module-federation/dts-plugin": "0.1.15",
|
|
91
74
|
"@module-federation/managers": "0.1.15",
|
|
92
75
|
"@module-federation/manifest": "0.1.15",
|
package/dist/src/index.d.ts
CHANGED
|
@@ -3,4 +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 EntryChunkTrackerPlugin } from './plugins/EntryChunkTrackerPlugin';
|
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,6 +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 EntryChunkTrackerPlugin_1 = require("./plugins/EntryChunkTrackerPlugin");
|
|
18
|
-
Object.defineProperty(exports, "EntryChunkTrackerPlugin", { enumerable: true, get: function () { return __importDefault(EntryChunkTrackerPlugin_1).default; } });
|
|
19
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"}
|
|
@@ -26,10 +26,10 @@ class EntryChunkTrackerPlugin {
|
|
|
26
26
|
return Template.asString([
|
|
27
27
|
`if(typeof module !== 'undefined') {
|
|
28
28
|
globalThis.entryChunkCache = globalThis.entryChunkCache || new Set();
|
|
29
|
-
|
|
29
|
+
globalThis.entryChunkCache.add(module.filename);
|
|
30
30
|
if(module.children) {
|
|
31
31
|
module.children.forEach(function(c) {
|
|
32
|
-
|
|
32
|
+
globalThis.entryChunkCache.add(c.filename);
|
|
33
33
|
})
|
|
34
34
|
}
|
|
35
35
|
}`,
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
var mfHashMap: Record<string, string> | undefined;
|
|
3
|
-
}
|
|
4
1
|
export declare const performReload: (shouldReload: any) => Promise<boolean>;
|
|
5
2
|
export declare const checkUnreachableRemote: (remoteScope: any) => boolean;
|
|
6
3
|
export declare const checkMedusaConfigChange: (remoteScope: any, fetchModule: any) => boolean;
|
|
7
4
|
export declare const checkFakeRemote: (remoteScope: any) => boolean;
|
|
8
|
-
export declare const createFetcher: (url: string, fetchModule: any, name: string, cb: (hash: string) => void) => any;
|
|
9
5
|
export declare const fetchRemote: (remoteScope: any, fetchModule: any) => Promise<boolean>;
|
|
10
6
|
export declare const revalidate: (fetchModule?: any, force?: boolean) => Promise<boolean>;
|
|
11
7
|
export declare function getFetchModule(): any;
|
|
@@ -3,15 +3,16 @@ 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.getFetchModule = exports.revalidate = exports.fetchRemote = exports.
|
|
6
|
+
exports.getFetchModule = exports.revalidate = exports.fetchRemote = exports.checkFakeRemote = exports.checkMedusaConfigChange = exports.checkUnreachableRemote = exports.performReload = void 0;
|
|
7
7
|
const flush_chunks_1 = require("./flush-chunks");
|
|
8
|
+
const hashmap = {};
|
|
8
9
|
const crypto_1 = __importDefault(require("crypto"));
|
|
9
|
-
const hashmap = globalThis.mfHashMap || {};
|
|
10
10
|
const requireCacheRegex = /(remote|server|hot-reload|react-loadable-manifest|runtime|styled-jsx)/;
|
|
11
11
|
const performReload = async (shouldReload) => {
|
|
12
12
|
if (!shouldReload) {
|
|
13
13
|
return false;
|
|
14
14
|
}
|
|
15
|
+
const remotesFromAPI = (0, flush_chunks_1.getAllKnownRemotes)();
|
|
15
16
|
let req;
|
|
16
17
|
//@ts-ignore
|
|
17
18
|
if (typeof __non_webpack_require__ === 'undefined') {
|
|
@@ -104,23 +105,6 @@ const checkFakeRemote = (remoteScope) => {
|
|
|
104
105
|
return false;
|
|
105
106
|
};
|
|
106
107
|
exports.checkFakeRemote = checkFakeRemote;
|
|
107
|
-
const createFetcher = (url, fetchModule, name, cb) => {
|
|
108
|
-
return fetchModule(url)
|
|
109
|
-
.then((re) => {
|
|
110
|
-
if (!re.ok) {
|
|
111
|
-
throw new Error(`Error loading remote: status: ${re.status}, content-type: ${re.headers.get('content-type')}`);
|
|
112
|
-
}
|
|
113
|
-
return re.text();
|
|
114
|
-
})
|
|
115
|
-
.then((contents) => {
|
|
116
|
-
const hash = crypto_1.default.createHash('md5').update(contents).digest('hex');
|
|
117
|
-
cb(hash);
|
|
118
|
-
})
|
|
119
|
-
.catch((e) => {
|
|
120
|
-
console.error('Remote', name, url, 'Failed to load or is not online', e);
|
|
121
|
-
});
|
|
122
|
-
};
|
|
123
|
-
exports.createFetcher = createFetcher;
|
|
124
108
|
const fetchRemote = (remoteScope, fetchModule) => {
|
|
125
109
|
const fetches = [];
|
|
126
110
|
let needReload = false;
|
|
@@ -128,17 +112,29 @@ const fetchRemote = (remoteScope, fetchModule) => {
|
|
|
128
112
|
const name = property;
|
|
129
113
|
const container = remoteScope[property];
|
|
130
114
|
const url = container.entry;
|
|
131
|
-
const fetcher = (
|
|
115
|
+
const fetcher = fetchModule(url)
|
|
116
|
+
.then((re) => {
|
|
117
|
+
if (!re.ok) {
|
|
118
|
+
throw new Error(`Error loading remote: status: ${re.status}, content-type: ${re.headers.get('content-type')}`);
|
|
119
|
+
}
|
|
120
|
+
return re.text();
|
|
121
|
+
})
|
|
122
|
+
.then((contents) => {
|
|
123
|
+
const hash = crypto_1.default.createHash('md5').update(contents).digest('hex');
|
|
132
124
|
if (hashmap[name]) {
|
|
133
125
|
if (hashmap[name] !== hash) {
|
|
134
126
|
hashmap[name] = hash;
|
|
135
127
|
needReload = true;
|
|
136
128
|
console.log(name, 'hash is different - must hot reload server');
|
|
129
|
+
return true;
|
|
137
130
|
}
|
|
138
131
|
}
|
|
139
132
|
else {
|
|
140
133
|
hashmap[name] = hash;
|
|
141
134
|
}
|
|
135
|
+
})
|
|
136
|
+
.catch((e) => {
|
|
137
|
+
console.error('Remote', name, url, 'Failed to load or is not online', e);
|
|
142
138
|
});
|
|
143
139
|
fetches.push(fetcher);
|
|
144
140
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hot-reload.js","sourceRoot":"","sources":["../../../src/utils/hot-reload.ts"],"names":[],"mappings":";;;;;;AAAA,iDAAoD;
|
|
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,cA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CAAC;IACxC,OAAO,SAAS,CAAC,OAAO,IAAI,SAAS,CAAC;AACxC,CAAC;AAXD,wCAWC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"public": true,
|
|
3
3
|
"name": "@module-federation/node",
|
|
4
|
-
"version": "0.0.0-next-
|
|
4
|
+
"version": "0.0.0-next-20240528203231",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./dist/src/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
},
|
|
12
12
|
"./package.json": "./package.json",
|
|
13
13
|
"./runtimePlugin": "./dist/src/runtimePlugin.js",
|
|
14
|
-
"./record-dynamic-remote-entry-hash-plugin": "./dist/src/recordDynamicRemoteEntryHashPlugin.js",
|
|
15
14
|
"./utils": {
|
|
16
15
|
"import": "./dist/src/utils/index.js",
|
|
17
16
|
"require": "./dist/src/utils/index.js"
|
|
@@ -20,22 +19,6 @@
|
|
|
20
19
|
"./src/plugins/NodeFederationPlugin.js": "./dist/src/plugins/NodeFederationPlugin.js",
|
|
21
20
|
"./src/": "./dist/src/"
|
|
22
21
|
},
|
|
23
|
-
"typesVersions": {
|
|
24
|
-
"*": {
|
|
25
|
-
".": [
|
|
26
|
-
"./dist/src/index.d.ts"
|
|
27
|
-
],
|
|
28
|
-
"runtimePlugin": [
|
|
29
|
-
"./dist/src/runtimePlugin.d.ts"
|
|
30
|
-
],
|
|
31
|
-
"utils": [
|
|
32
|
-
"./dist/src/utils/index.d.ts"
|
|
33
|
-
],
|
|
34
|
-
"record-dynamic-remote-entry-hash-plugin": [
|
|
35
|
-
"./dist/src/record-dynamic-remote-entry-hash-plugin.d.ts"
|
|
36
|
-
]
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
22
|
"files": [
|
|
40
23
|
"dist/",
|
|
41
24
|
"README.md"
|
|
@@ -59,10 +42,10 @@
|
|
|
59
42
|
"dependencies": {
|
|
60
43
|
"encoding": "^0.1.13",
|
|
61
44
|
"node-fetch": "2.7.0",
|
|
62
|
-
"@module-federation/enhanced": "0.0.0-next-
|
|
63
|
-
"@module-federation/sdk": "0.0.0-next-
|
|
64
|
-
"@module-federation/utilities": "0.0.0-next-
|
|
65
|
-
"@module-federation/runtime": "0.0.0-next-
|
|
45
|
+
"@module-federation/enhanced": "0.0.0-next-20240528203231",
|
|
46
|
+
"@module-federation/sdk": "0.0.0-next-20240528203231",
|
|
47
|
+
"@module-federation/utilities": "0.0.0-next-20240528203231",
|
|
48
|
+
"@module-federation/runtime": "0.0.0-next-20240528203231"
|
|
66
49
|
},
|
|
67
50
|
"peerDependencies": {
|
|
68
51
|
"react": "^16||^17||^18",
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
const recordDynamicRemoteEntryHashPlugin = () => ({
|
|
27
|
-
name: 'record-dynamic-remote-entry-hash-plugin',
|
|
28
|
-
beforeInit(args) {
|
|
29
|
-
if (!globalThis.mfHashMap) {
|
|
30
|
-
globalThis.mfHashMap = {};
|
|
31
|
-
}
|
|
32
|
-
return args;
|
|
33
|
-
},
|
|
34
|
-
async onLoad(args) {
|
|
35
|
-
const { moduleInstance } = args;
|
|
36
|
-
if (!moduleInstance.remoteInfo) {
|
|
37
|
-
return args;
|
|
38
|
-
}
|
|
39
|
-
const hashmap = globalThis.mfHashMap;
|
|
40
|
-
if (!hashmap) {
|
|
41
|
-
return args;
|
|
42
|
-
}
|
|
43
|
-
const { name, entry } = moduleInstance.remoteInfo;
|
|
44
|
-
if (!hashmap[name]) {
|
|
45
|
-
const hotReloadUtils = await Promise.resolve().then(() => __importStar(require('./utils/hot-reload')));
|
|
46
|
-
const fetcher = hotReloadUtils.createFetcher(entry, hotReloadUtils.getFetchModule(), name, (hash) => {
|
|
47
|
-
hashmap[name] = hash;
|
|
48
|
-
});
|
|
49
|
-
await fetcher;
|
|
50
|
-
}
|
|
51
|
-
return args;
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
exports.default = recordDynamicRemoteEntryHashPlugin;
|
|
55
|
-
//# sourceMappingURL=recordDynamicRemoteEntryHashPlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"recordDynamicRemoteEntryHashPlugin.js","sourceRoot":"","sources":["../../src/recordDynamicRemoteEntryHashPlugin.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAAM,kCAAkC,GACtC,GAAG,EAAE,CAAC,CAAC;IACL,IAAI,EAAE,yCAAyC;IAC/C,UAAU,CAAC,IAAI;QACb,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC;YAC1B,UAAU,CAAC,SAAS,GAAG,EAAE,CAAC;QAC5B,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,IAAI;QACf,MAAM,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC;QAEhC,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC;YAC/B,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,OAAO,GAAG,UAAU,CAAC,SAAS,CAAC;QAErC,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,cAAc,CAAC,UAAU,CAAC;QAElD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YACnB,MAAM,cAAc,GAAG,wDAAa,oBAAoB,GAAC,CAAC;YAC1D,MAAM,OAAO,GAAG,cAAc,CAAC,aAAa,CAC1C,KAAK,EACL,cAAc,CAAC,cAAc,EAAE,EAC/B,IAAI,EACJ,CAAC,IAAI,EAAE,EAAE;gBACP,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;YACvB,CAAC,CACF,CAAC;YACF,MAAM,OAAO,CAAC;QAChB,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC,CAAC;AACL,kBAAe,kCAAkC,CAAC"}
|