@lemon-fe/vite-plugin-micro-frontend 2.0.4 → 2.0.5
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/README.md +71 -188
- package/dist/cli.js +4 -23
- package/dist/index.d.ts +19 -168
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/runtime-federation.d.ts +6 -12
- package/dist/runtime-federation.js +111 -6
- package/dist/runtime-federation.js.map +1 -1
- package/package.json +4 -9
- package/dist/runtime-react-refresh-init.d.ts +0 -1
- package/dist/runtime-react-refresh-init.js +0 -1
- package/dist/runtime.d.ts +0 -3
- package/dist/runtime.js +0 -3
|
@@ -1,23 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
import { ModuleFederationRuntimePlugin } from '@module-federation/runtime';
|
|
2
|
+
|
|
3
|
+
declare function manifestFirst(configuredEntries: Record<string, string>): ModuleFederationRuntimePlugin;
|
|
2
4
|
|
|
3
|
-
interface DevelopmentApplication {
|
|
4
|
-
name: string;
|
|
5
|
-
entry: string;
|
|
6
|
-
module: string;
|
|
7
|
-
}
|
|
8
5
|
interface DevelopmentAppOptions {
|
|
9
6
|
appName: string;
|
|
10
7
|
/** 消费应用的 MF name,默认由 appName 推导。 */
|
|
11
8
|
federationName?: string;
|
|
12
9
|
}
|
|
13
|
-
type LoadDevelopmentRootOptions = DevelopmentAppOptions;
|
|
14
10
|
/** 通过独立引导实例启动基座,再由基座加载本地应用。 */
|
|
15
11
|
declare function startDevelopmentApp({ appName, federationName, }: DevelopmentAppOptions): Promise<void>;
|
|
16
12
|
|
|
17
|
-
/** 保留直接使用官方默认实例的兼容入口。生成器使用下面的实例绑定加载器。 */
|
|
18
|
-
|
|
19
13
|
interface RemoteLoaderOptions {
|
|
20
|
-
hostName
|
|
14
|
+
hostName: string;
|
|
21
15
|
devHost?: string;
|
|
22
16
|
shareScope?: string | string[];
|
|
23
17
|
remotes: Readonly<Record<string, {
|
|
@@ -29,5 +23,5 @@ interface RemoteLoaderOptions {
|
|
|
29
23
|
/** 动态加载不会经过 Vite 的静态 remote import 转换,必须显式注册到消费应用的实例。 */
|
|
30
24
|
declare function createRemoteLoader(options: RemoteLoaderOptions): <T>(moduleSpecifier: string) => Promise<T | null>;
|
|
31
25
|
|
|
32
|
-
export { createRemoteLoader, startDevelopmentApp };
|
|
33
|
-
export type {
|
|
26
|
+
export { createRemoteLoader, manifestFirst as default, startDevelopmentApp };
|
|
27
|
+
export type { RemoteLoaderOptions };
|
|
@@ -1,5 +1,112 @@
|
|
|
1
1
|
import { createInstance, getInstance } from '@module-federation/runtime';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
const pageVersion = String(globalThis.performance?.timeOrigin || Date.now());
|
|
4
|
+
const versionParam = '_mf';
|
|
5
|
+
function versionUrl(url) {
|
|
6
|
+
url.searchParams.set(versionParam, pageVersion);
|
|
7
|
+
return url;
|
|
8
|
+
}
|
|
9
|
+
function isMissingManifest(response) {
|
|
10
|
+
return (response.status === 404 ||
|
|
11
|
+
response.status === 410 ||
|
|
12
|
+
Boolean(response.ok &&
|
|
13
|
+
!response.redirected &&
|
|
14
|
+
response.headers.get('content-type')?.toLowerCase().includes('text/html')));
|
|
15
|
+
}
|
|
16
|
+
function manifestFirst(configuredEntries) {
|
|
17
|
+
const probes = new Map();
|
|
18
|
+
const selectedManifests = new Set();
|
|
19
|
+
return {
|
|
20
|
+
name: 'lemon-mf-manifest-first',
|
|
21
|
+
async beforeRequest(args) {
|
|
22
|
+
if (typeof window === 'undefined')
|
|
23
|
+
return args;
|
|
24
|
+
const { id, options } = args;
|
|
25
|
+
const remote = options.remotes.find(item => [item.name, item.alias].some(name => name && (id === name || id.startsWith(`${name}/`))));
|
|
26
|
+
if (!remote ||
|
|
27
|
+
!('entry' in remote) ||
|
|
28
|
+
!Object.prototype.hasOwnProperty.call(configuredEntries, remote.name)) {
|
|
29
|
+
return args;
|
|
30
|
+
}
|
|
31
|
+
const origin = window.location.origin;
|
|
32
|
+
const current = new URL(remote.entry, origin);
|
|
33
|
+
if (current.href !== new URL(configuredEntries[remote.name], origin).href)
|
|
34
|
+
return args;
|
|
35
|
+
if (current.pathname.endsWith('.json')) {
|
|
36
|
+
remote.entry = versionUrl(current).href;
|
|
37
|
+
selectedManifests.add(remote.entry);
|
|
38
|
+
return args;
|
|
39
|
+
}
|
|
40
|
+
if (!current.pathname.endsWith('/remote.js') || current.search || current.hash)
|
|
41
|
+
return args;
|
|
42
|
+
if (current.origin !== origin && remote.type === 'var') {
|
|
43
|
+
remote.entry = versionUrl(current).href;
|
|
44
|
+
return args;
|
|
45
|
+
}
|
|
46
|
+
const manifest = versionUrl(new URL('mf-manifest.json', current)).href;
|
|
47
|
+
let probe = probes.get(manifest);
|
|
48
|
+
if (!probe) {
|
|
49
|
+
probe = fetch(manifest, { cache: 'no-store' })
|
|
50
|
+
.then(response => {
|
|
51
|
+
if (!response.ok && !isMissingManifest(response)) {
|
|
52
|
+
throw new Error(`[MF] ${manifest}: HTTP ${response.status}`);
|
|
53
|
+
}
|
|
54
|
+
return response;
|
|
55
|
+
})
|
|
56
|
+
.catch(error => {
|
|
57
|
+
probes.delete(manifest);
|
|
58
|
+
throw error;
|
|
59
|
+
});
|
|
60
|
+
probes.set(manifest, probe);
|
|
61
|
+
}
|
|
62
|
+
const response = await probe;
|
|
63
|
+
// An application may have registered a different entry while the probe was in flight.
|
|
64
|
+
if (!options.remotes.includes(remote) ||
|
|
65
|
+
new URL(remote.entry, origin).href !== current.href) {
|
|
66
|
+
return args;
|
|
67
|
+
}
|
|
68
|
+
if (isMissingManifest(response)) {
|
|
69
|
+
remote.entry = versionUrl(current).href;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
remote.entry = manifest;
|
|
73
|
+
selectedManifests.add(manifest);
|
|
74
|
+
}
|
|
75
|
+
return args;
|
|
76
|
+
},
|
|
77
|
+
fetch(url, options) {
|
|
78
|
+
if (!selectedManifests.has(url))
|
|
79
|
+
return;
|
|
80
|
+
const probe = probes.get(url);
|
|
81
|
+
const request = probe
|
|
82
|
+
? probe.then(response => response.clone())
|
|
83
|
+
: fetch(url, {
|
|
84
|
+
...options,
|
|
85
|
+
cache: 'no-store',
|
|
86
|
+
});
|
|
87
|
+
return request.then(response => {
|
|
88
|
+
if (!response.ok)
|
|
89
|
+
throw new Error(`[MF] ${url}: HTTP ${response.status}`);
|
|
90
|
+
return response;
|
|
91
|
+
});
|
|
92
|
+
},
|
|
93
|
+
loadRemoteSnapshot(args) {
|
|
94
|
+
if (!args.manifestUrl ||
|
|
95
|
+
!selectedManifests.has(args.manifestUrl) ||
|
|
96
|
+
!('remoteEntry' in args.remoteSnapshot)) {
|
|
97
|
+
return args;
|
|
98
|
+
}
|
|
99
|
+
const { remoteSnapshot } = args;
|
|
100
|
+
// Apply the same URL before the MF runtime preloads or imports the entry.
|
|
101
|
+
const entry = remoteSnapshot.remoteEntry;
|
|
102
|
+
const entryUrl = new URL(entry, args.manifestUrl);
|
|
103
|
+
if (entryUrl.pathname.endsWith('/remote.js') && !entryUrl.search) {
|
|
104
|
+
remoteSnapshot.remoteEntry = `${entry.split('#')[0]}${versionUrl(entryUrl).search}${entryUrl.hash}`;
|
|
105
|
+
}
|
|
106
|
+
return args;
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
}
|
|
3
110
|
|
|
4
111
|
/** 通过独立引导实例启动基座,再由基座加载本地应用。 */
|
|
5
112
|
async function startDevelopmentApp({ appName, federationName = appName.replace(/-/g, '_'), }) {
|
|
@@ -38,11 +145,9 @@ async function startDevelopmentApp({ appName, federationName = appName.replace(/
|
|
|
38
145
|
function createRemoteLoader(options) {
|
|
39
146
|
const registeredInstances = new WeakSet();
|
|
40
147
|
return function loadConfiguredRemote(moduleSpecifier) {
|
|
41
|
-
const instance = options.hostName
|
|
42
|
-
? getInstance(candidate => candidate.name === options.hostName)
|
|
43
|
-
: getInstance();
|
|
148
|
+
const instance = getInstance(candidate => candidate.name === options.hostName);
|
|
44
149
|
if (!instance) {
|
|
45
|
-
throw new Error(`[MF] 消费应用 ${options.hostName
|
|
150
|
+
throw new Error(`[MF] 消费应用 ${options.hostName} 的 Runtime 尚未初始化。`);
|
|
46
151
|
}
|
|
47
152
|
if (!registeredInstances.has(instance)) {
|
|
48
153
|
const remotes = Object.entries(options.remotes).map(([alias, remote]) => {
|
|
@@ -65,5 +170,5 @@ function createRemoteLoader(options) {
|
|
|
65
170
|
};
|
|
66
171
|
}
|
|
67
172
|
|
|
68
|
-
export { createRemoteLoader, startDevelopmentApp };
|
|
173
|
+
export { createRemoteLoader, manifestFirst as default, startDevelopmentApp };
|
|
69
174
|
//# sourceMappingURL=runtime-federation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-federation.js","sources":["../src/runtime/development.ts","../src/runtime/federation.ts"],"sourcesContent":[null,null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runtime-federation.js","sources":["../src/runtime/remote-entry.ts","../src/runtime/development.ts","../src/runtime/federation.ts"],"sourcesContent":[null,null,null],"names":[],"mappings":";;AAEA,MAAM,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;AAC5E,MAAM,YAAY,GAAG,KAAK;AAE1B,SAAS,UAAU,CAAC,GAAQ,EAAA;IAC1B,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,YAAY,EAAE,WAAW,CAAC;AAC/C,IAAA,OAAO,GAAG;AACZ;AAEA,SAAS,iBAAiB,CAAC,QAAkB,EAAA;AAC3C,IAAA,QACE,QAAQ,CAAC,MAAM,KAAK,GAAG;QACvB,QAAQ,CAAC,MAAM,KAAK,GAAG;QACvB,OAAO,CACL,QAAQ,CAAC,EAAE;YACX,CAAC,QAAQ,CAAC,UAAU;AACpB,YAAA,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,WAAW,EAAE,CAAC,QAAQ,CAA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CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,KAAI;gBACtE,MAAM,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;sBAC1C,MAAM,CAAC;AACT,sBAAE,IAAI,GAAG,CACL,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,GAAG,IAAI,MAAM,CAAC,KAAK,CAAA,CAAE,EAChE,OAAO,CAAC,OAAO,IAAI,UAAU,CAAC,QAAQ,CAAC,MAAM,CAC9C,CAAC,IAAI;gBACV,OAAO;AACL,oBAAA,IAAI,EAAE,KAAK;oBACX,KAAK;oBACL,IAAI,EAAE,MAAM,CAAC,UAAU,GAAG,QAAQ,GAAG,KAAK;oBAC1C,eAAe,EAAE,MAAM,CAAC,UAAU;AAClC,oBAAA,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,SAAS;iBAC5C;AACH,YAAA,CAAC,CAAC;;AAEF,YAAA,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC;AACjC,YAAA,mBAAmB,CAAC,GAAG,CAAC,QAAQ,CAAC;QACnC;AAEA,QAAA,OAAO,QAAQ,CAAC,UAAU,CAAI,eAAe,CAAC;AAChD,IAAA,CAAC;AACH;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lemon-fe/vite-plugin-micro-frontend",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"description": "基于 Module Federation Runtime 与 React 组件的 Vite 微前端插件集合",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -10,18 +10,13 @@
|
|
|
10
10
|
},
|
|
11
11
|
"exports": {
|
|
12
12
|
".": "./dist/index.js",
|
|
13
|
-
"./runtime": "./dist/runtime.js",
|
|
14
13
|
"./runtime/dynamic": "./dist/runtime-dynamic.js",
|
|
15
14
|
"./runtime/app": "./dist/runtime-app.js",
|
|
16
15
|
"./runtime/federation": "./dist/runtime-federation.js",
|
|
17
|
-
"./runtime/development": "./dist/runtime-federation.js"
|
|
18
|
-
"./runtime/react-refresh-init": "./dist/runtime-react-refresh-init.js"
|
|
16
|
+
"./runtime/development": "./dist/runtime-federation.js"
|
|
19
17
|
},
|
|
20
18
|
"typesVersions": {
|
|
21
19
|
"*": {
|
|
22
|
-
"runtime": [
|
|
23
|
-
"./dist/runtime.d.ts"
|
|
24
|
-
],
|
|
25
20
|
"runtime/development": [
|
|
26
21
|
"./dist/runtime-federation.d.ts"
|
|
27
22
|
],
|
|
@@ -37,6 +32,7 @@
|
|
|
37
32
|
"scripts": {
|
|
38
33
|
"build": "rollup -c",
|
|
39
34
|
"dev": "rollup -c -w",
|
|
35
|
+
"prepare": "npm run build",
|
|
40
36
|
"prepublishOnly": "npm run build"
|
|
41
37
|
},
|
|
42
38
|
"keywords": [
|
|
@@ -86,8 +82,7 @@
|
|
|
86
82
|
"chokidar": "^4.0.3",
|
|
87
83
|
"tslib": "^2.8.0",
|
|
88
84
|
"typescript": "^5.9.3",
|
|
89
|
-
"vite": "^5.4.19"
|
|
90
|
-
"vite-plugin-css-injected-by-js": "^3.5.2"
|
|
85
|
+
"vite": "^5.4.19"
|
|
91
86
|
},
|
|
92
87
|
"pnpm": {
|
|
93
88
|
"overrides": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/runtime.d.ts
DELETED
package/dist/runtime.js
DELETED