@bleedingdev/modern-js-server 3.9.0-ultramodern.19 → 3.9.0-ultramodern.20
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.
|
@@ -36,22 +36,6 @@ const cleanSSRCache = (distDir)=>{
|
|
|
36
36
|
if (key.startsWith(distDir)) delete require.cache[key];
|
|
37
37
|
});
|
|
38
38
|
};
|
|
39
|
-
const cleanFederationRuntime = ()=>{
|
|
40
|
-
const runtime = globalThis;
|
|
41
|
-
const federation = runtime.__FEDERATION__;
|
|
42
|
-
if (!federation) return;
|
|
43
|
-
for (const instance of federation.__INSTANCES__)instance.moduleCache.forEach(({ remoteInfo })=>{
|
|
44
|
-
if (remoteInfo.entryGlobalName) delete runtime[remoteInfo.entryGlobalName];
|
|
45
|
-
});
|
|
46
|
-
federation.__INSTANCES__ = [];
|
|
47
|
-
federation.__SHARE__ = {};
|
|
48
|
-
federation.__GLOBAL_PLUGIN__ = [];
|
|
49
|
-
federation.moduleInfo = {};
|
|
50
|
-
federation.__MANIFEST_LOADING__ = {};
|
|
51
|
-
federation.__PRELOADED_ASSETS__?.clear();
|
|
52
|
-
const remoteEntries = runtime.__GLOBAL_LOADING_REMOTE_ENTRY__ ?? {};
|
|
53
|
-
for (const key of Object.keys(remoteEntries))delete remoteEntries[key];
|
|
54
|
-
};
|
|
55
39
|
const onRepack = async (distDir, hooks)=>{
|
|
56
40
|
try {
|
|
57
41
|
await hooks.onReset.call({
|
|
@@ -61,7 +45,6 @@ const onRepack = async (distDir, hooks)=>{
|
|
|
61
45
|
});
|
|
62
46
|
} finally{
|
|
63
47
|
cleanSSRCache(distDir);
|
|
64
|
-
cleanFederationRuntime();
|
|
65
48
|
fileReader_namespaceObject.fileReader.reset();
|
|
66
49
|
}
|
|
67
50
|
};
|
|
@@ -4,22 +4,6 @@ const cleanSSRCache = (distDir)=>{
|
|
|
4
4
|
if (key.startsWith(distDir)) delete require.cache[key];
|
|
5
5
|
});
|
|
6
6
|
};
|
|
7
|
-
const cleanFederationRuntime = ()=>{
|
|
8
|
-
const runtime = globalThis;
|
|
9
|
-
const federation = runtime.__FEDERATION__;
|
|
10
|
-
if (!federation) return;
|
|
11
|
-
for (const instance of federation.__INSTANCES__)instance.moduleCache.forEach(({ remoteInfo })=>{
|
|
12
|
-
if (remoteInfo.entryGlobalName) delete runtime[remoteInfo.entryGlobalName];
|
|
13
|
-
});
|
|
14
|
-
federation.__INSTANCES__ = [];
|
|
15
|
-
federation.__SHARE__ = {};
|
|
16
|
-
federation.__GLOBAL_PLUGIN__ = [];
|
|
17
|
-
federation.moduleInfo = {};
|
|
18
|
-
federation.__MANIFEST_LOADING__ = {};
|
|
19
|
-
federation.__PRELOADED_ASSETS__?.clear();
|
|
20
|
-
const remoteEntries = runtime.__GLOBAL_LOADING_REMOTE_ENTRY__ ?? {};
|
|
21
|
-
for (const key of Object.keys(remoteEntries))delete remoteEntries[key];
|
|
22
|
-
};
|
|
23
7
|
const onRepack = async (distDir, hooks)=>{
|
|
24
8
|
try {
|
|
25
9
|
await hooks.onReset.call({
|
|
@@ -29,7 +13,6 @@ const onRepack = async (distDir, hooks)=>{
|
|
|
29
13
|
});
|
|
30
14
|
} finally{
|
|
31
15
|
cleanSSRCache(distDir);
|
|
32
|
-
cleanFederationRuntime();
|
|
33
16
|
fileReader.reset();
|
|
34
17
|
}
|
|
35
18
|
};
|
|
@@ -6,22 +6,6 @@ const cleanSSRCache = (distDir)=>{
|
|
|
6
6
|
if (key.startsWith(distDir)) delete require.cache[key];
|
|
7
7
|
});
|
|
8
8
|
};
|
|
9
|
-
const cleanFederationRuntime = ()=>{
|
|
10
|
-
const runtime = globalThis;
|
|
11
|
-
const federation = runtime.__FEDERATION__;
|
|
12
|
-
if (!federation) return;
|
|
13
|
-
for (const instance of federation.__INSTANCES__)instance.moduleCache.forEach(({ remoteInfo })=>{
|
|
14
|
-
if (remoteInfo.entryGlobalName) delete runtime[remoteInfo.entryGlobalName];
|
|
15
|
-
});
|
|
16
|
-
federation.__INSTANCES__ = [];
|
|
17
|
-
federation.__SHARE__ = {};
|
|
18
|
-
federation.__GLOBAL_PLUGIN__ = [];
|
|
19
|
-
federation.moduleInfo = {};
|
|
20
|
-
federation.__MANIFEST_LOADING__ = {};
|
|
21
|
-
federation.__PRELOADED_ASSETS__?.clear();
|
|
22
|
-
const remoteEntries = runtime.__GLOBAL_LOADING_REMOTE_ENTRY__ ?? {};
|
|
23
|
-
for (const key of Object.keys(remoteEntries))delete remoteEntries[key];
|
|
24
|
-
};
|
|
25
9
|
const onRepack = async (distDir, hooks)=>{
|
|
26
10
|
try {
|
|
27
11
|
await hooks.onReset.call({
|
|
@@ -31,7 +15,6 @@ const onRepack = async (distDir, hooks)=>{
|
|
|
31
15
|
});
|
|
32
16
|
} finally{
|
|
33
17
|
cleanSSRCache(distDir);
|
|
34
|
-
cleanFederationRuntime();
|
|
35
18
|
fileReader.reset();
|
|
36
19
|
}
|
|
37
20
|
};
|
|
@@ -2,6 +2,11 @@ import type { ServerPluginHooks } from '@modern-js/server-core';
|
|
|
2
2
|
/**
|
|
3
3
|
* Reset the dev server after the server bundle is rebuilt.
|
|
4
4
|
*
|
|
5
|
+
* Runtime state a rebuilt bundle keeps outside the require cache belongs to
|
|
6
|
+
* the plugin that owns it and is reset by that plugin's `onReset` handler:
|
|
7
|
+
* `@module-federation/modern-js-v3/server` resets the Module Federation
|
|
8
|
+
* runtime on `globalThis` there (module-federation/core#5152).
|
|
9
|
+
*
|
|
5
10
|
* Contract: the `onReset({ event: { type: 'repack' } })` handlers run in
|
|
6
11
|
* registration order and are awaited before the previous generation is purged.
|
|
7
12
|
* The caller holds new requests until this promise settles, so no request
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"modern",
|
|
18
18
|
"modern.js"
|
|
19
19
|
],
|
|
20
|
-
"version": "3.9.0-ultramodern.
|
|
20
|
+
"version": "3.9.0-ultramodern.20",
|
|
21
21
|
"types": "./dist/types/index.d.ts",
|
|
22
22
|
"main": "./dist/cjs/index.js",
|
|
23
23
|
"exports": {
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.9.0-ultramodern.
|
|
42
|
-
"@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.9.0-ultramodern.
|
|
43
|
-
"@modern-js/server-utils": "npm:@bleedingdev/modern-js-server-utils@3.9.0-ultramodern.
|
|
44
|
-
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.9.0-ultramodern.
|
|
45
|
-
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.9.0-ultramodern.
|
|
41
|
+
"@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.9.0-ultramodern.20",
|
|
42
|
+
"@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.9.0-ultramodern.20",
|
|
43
|
+
"@modern-js/server-utils": "npm:@bleedingdev/modern-js-server-utils@3.9.0-ultramodern.20",
|
|
44
|
+
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.9.0-ultramodern.20",
|
|
45
|
+
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.9.0-ultramodern.20",
|
|
46
46
|
"@swc/helpers": "^0.5.23",
|
|
47
47
|
"connect-history-api-fallback": "^2.0.0",
|
|
48
48
|
"http-compression": "1.1.3",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"ws": "^8.21.3"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.9.0-ultramodern.
|
|
55
|
-
"@module-federation/runtime": "
|
|
54
|
+
"@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.9.0-ultramodern.20",
|
|
55
|
+
"@module-federation/runtime": "2.9.2",
|
|
56
56
|
"@rslib/core": "1.0.2",
|
|
57
57
|
"@scripts/rstest-config": "2.66.0",
|
|
58
58
|
"@types/connect-history-api-fallback": "^1.5.4",
|