@vc-shell/mf-host 2.0.0-alpha.8 → 2.0.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/CHANGELOG.md +56 -9
- package/dist/register-remote-modules.d.ts.map +1 -1
- package/dist/register-remote-modules.js +23 -13
- package/dist/register-remote-modules.js.map +1 -1
- package/dist/vite-helper.d.ts +7 -0
- package/dist/vite-helper.d.ts.map +1 -0
- package/dist/vite-helper.js +12 -0
- package/dist/vite-helper.js.map +1 -0
- package/package.json +23 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,56 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
# [2.0.0](https://github.com/VirtoCommerce/vc-shell/compare/v1.2.3...v2.0.0) (2026-04-22)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- **mf-host:** add mfHostConfig() vite helper for optimizeDeps ([501841d](https://github.com/VirtoCommerce/vc-shell/commit/501841d457ad9f3c671c41723b65045fae075d28))
|
|
8
|
+
- **mf-host:** import shared deps from mf-config instead of duplicating ([51d2df1](https://github.com/VirtoCommerce/vc-shell/commit/51d2df126ac45ca388c7eb5ce8943fc324938a25))
|
|
9
|
+
- **mf:** extract Module Federation loader into @vc-shell/mf-config and @vc-shell/mf-host ([9b079c2](https://github.com/VirtoCommerce/vc-shell/commit/9b079c27bc1497d89849b909f62c1403eff0c9b4))
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
- **mf-host:** capture initial URL before blade guard redirect ([65dddbe](https://github.com/VirtoCommerce/vc-shell/commit/65dddbe3abf2549d1225000b53892ae4257dadcf))
|
|
14
|
+
- topological build order, deprecation fixes, and dependency updates ([bf01eaf](https://github.com/VirtoCommerce/vc-shell/commit/bf01eaf7574eda5ae393941b553cbea5918a768f))
|
|
15
|
+
|
|
16
|
+
### Code Refactoring
|
|
17
|
+
|
|
18
|
+
- **cli,configs,packages:** apply ESLint flat config lint fixes ([394d5ca](https://github.com/VirtoCommerce/vc-shell/commit/394d5caa30f07ff8408dead09c998deabe0c163f))
|
|
19
|
+
|
|
20
|
+
### Styles
|
|
21
|
+
|
|
22
|
+
- **lint:** one-time cleanup of pre-existing violations and tech debt ([a7113c5](https://github.com/VirtoCommerce/vc-shell/commit/a7113c5d25b5b4dc9da20f6bc40c54b57fe46422))
|
|
23
|
+
|
|
24
|
+
### Chores
|
|
25
|
+
|
|
26
|
+
- update package versions and enhance lint/build scripts ([75b8de6](https://github.com/VirtoCommerce/vc-shell/commit/75b8de6e229a3b1c62a37573c714713b943af847))
|
|
27
|
+
|
|
28
|
+
### release
|
|
29
|
+
|
|
30
|
+
- v2.0.0-alpha.10 ([5a9c0af](https://github.com/VirtoCommerce/vc-shell/commit/5a9c0af632a17e2d01dcd0dc07a166aabe6fe903))
|
|
31
|
+
- v2.0.0-alpha.11 ([4e5d63e](https://github.com/VirtoCommerce/vc-shell/commit/4e5d63ee34bb825d8e363e40fbac27e711261f9e))
|
|
32
|
+
- v2.0.0-alpha.12 ([7143a74](https://github.com/VirtoCommerce/vc-shell/commit/7143a74ae0bdd3d70f0133b69d380b82c10526c1))
|
|
33
|
+
- v2.0.0-alpha.13 ([c422678](https://github.com/VirtoCommerce/vc-shell/commit/c42267854f9ed51215e8363165c9bfe077c313a3))
|
|
34
|
+
- v2.0.0-alpha.14 ([0c91031](https://github.com/VirtoCommerce/vc-shell/commit/0c91031706843ccbc2f5d32093c8655c6bbc718f))
|
|
35
|
+
- v2.0.0-alpha.15 ([fa8958e](https://github.com/VirtoCommerce/vc-shell/commit/fa8958e7241117ebff164a2d399f13f74d48b55f))
|
|
36
|
+
- v2.0.0-alpha.16 ([79ab2b1](https://github.com/VirtoCommerce/vc-shell/commit/79ab2b1022258332c327e742ab0adf1b8fde35ce))
|
|
37
|
+
- v2.0.0-alpha.17 ([408e4af](https://github.com/VirtoCommerce/vc-shell/commit/408e4af487f37b8aff790398d5a992820c8f05a2))
|
|
38
|
+
- v2.0.0-alpha.18 ([2466e35](https://github.com/VirtoCommerce/vc-shell/commit/2466e359313c9d78893d2473474ec5ce46ad49ca))
|
|
39
|
+
- v2.0.0-alpha.19 ([9d5a075](https://github.com/VirtoCommerce/vc-shell/commit/9d5a075e0a722c6c7371706f582b59bbf570ef37))
|
|
40
|
+
- v2.0.0-alpha.20 ([98bd4a6](https://github.com/VirtoCommerce/vc-shell/commit/98bd4a62ffa933bbfdae16ef7e46777084f15190))
|
|
41
|
+
- v2.0.0-alpha.21 ([bbd0d70](https://github.com/VirtoCommerce/vc-shell/commit/bbd0d70464ff5c0dafbc67ed3bf8ea36f65b0a7a))
|
|
42
|
+
- v2.0.0-alpha.22 ([ec455eb](https://github.com/VirtoCommerce/vc-shell/commit/ec455eba6bb91ae5fdbea64817ce1650116b9d50))
|
|
43
|
+
- v2.0.0-alpha.23 ([65b2144](https://github.com/VirtoCommerce/vc-shell/commit/65b214434ef1630069aecd6f2eaf916531bf37ef))
|
|
44
|
+
- v2.0.0-alpha.24 ([05ff510](https://github.com/VirtoCommerce/vc-shell/commit/05ff5107b81e0280447872ea52771fc47cb3cd67))
|
|
45
|
+
- v2.0.0-alpha.25 ([19d09b9](https://github.com/VirtoCommerce/vc-shell/commit/19d09b998861836b288aba36a6d18d7b26cff0b7))
|
|
46
|
+
- v2.0.0-alpha.26 ([ee6818c](https://github.com/VirtoCommerce/vc-shell/commit/ee6818ceb60b24d26b7011f2584c8d23f6b4fd3e))
|
|
47
|
+
- v2.0.0-alpha.27 ([f43652d](https://github.com/VirtoCommerce/vc-shell/commit/f43652d1aae8af36d5d2f00312492ea9de57f2f1))
|
|
48
|
+
- v2.0.0-alpha.28 ([7954dfd](https://github.com/VirtoCommerce/vc-shell/commit/7954dfddf1126d00038b8f66a6fe3efc5c19cfe8))
|
|
49
|
+
- v2.0.0-alpha.29 ([ffa72cf](https://github.com/VirtoCommerce/vc-shell/commit/ffa72cf458eed77c78955c88d211a82ead152b0f))
|
|
50
|
+
- v2.0.0-alpha.30 ([2db7f17](https://github.com/VirtoCommerce/vc-shell/commit/2db7f17d74afe97e3c6dfef2de436a797f0c32f4))
|
|
51
|
+
- v2.0.0-alpha.31 ([8d92fba](https://github.com/VirtoCommerce/vc-shell/commit/8d92fbad5954c71164e7815193b3496e569a5703))
|
|
52
|
+
- v2.0.0-alpha.32 ([1ed5533](https://github.com/VirtoCommerce/vc-shell/commit/1ed5533a6a20081e655f2e628bf824de40472f5d))
|
|
53
|
+
- v2.0.0-alpha.33 ([49cad36](https://github.com/VirtoCommerce/vc-shell/commit/49cad36a454534136b52576e6a0d97dfe48ae895))
|
|
54
|
+
- v2.0.0-alpha.34 ([78bed5a](https://github.com/VirtoCommerce/vc-shell/commit/78bed5af3aeb7ace2eb9f58ddde3235fced47b37))
|
|
55
|
+
- v2.0.0-alpha.35 ([05d6f25](https://github.com/VirtoCommerce/vc-shell/commit/05d6f2562c939dd4a2e7e4e7a3d80948beccbef1))
|
|
56
|
+
- v2.0.0-alpha.9 ([ef631bd](https://github.com/VirtoCommerce/vc-shell/commit/ef631bdbccbf2be1afbc592418e680e79d2c1fbe))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-remote-modules.d.ts","sourceRoot":"","sources":["../src/register-remote-modules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,GAAG,EAAe,MAAM,KAAK,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"register-remote-modules.d.ts","sourceRoot":"","sources":["../src/register-remote-modules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,GAAG,EAAe,MAAM,KAAK,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AA+CzC,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE;QACf,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACtC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACnC,CAAC;CACH;AAMD,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAuCD;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,4BAA4B,GAAG,IAAI,CAoI3F"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ref } from "vue";
|
|
2
2
|
import * as semver from "semver";
|
|
3
|
-
import {
|
|
3
|
+
import { createInstance } from "@module-federation/runtime";
|
|
4
|
+
import { SHARED_DEPS_BASE } from "@vc-shell/mf-config";
|
|
4
5
|
// Shared deps — statically imported. No circular dependency because
|
|
5
6
|
// this package is separate from @vc-shell/framework.
|
|
6
7
|
import * as Vue from "vue";
|
|
@@ -18,17 +19,22 @@ import lodashEsPkg from "lodash-es/package.json";
|
|
|
18
19
|
import vueusePkg from "@vueuse/core/package.json";
|
|
19
20
|
import frameworkPkg from "@vc-shell/framework/package.json";
|
|
20
21
|
const REGISTRY_URL = "/api/frontend-modules";
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
vue: { lib: () =>
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"@vueuse/core": { lib: () => VueuseCore, version: vueusePkg.version, requiredVersion: "^10.0.0" },
|
|
30
|
-
"@vc-shell/framework": { lib: () => Framework, version: frameworkPkg.version, requiredVersion: `^${frameworkPkg.version}` },
|
|
22
|
+
const RUNTIME_LIBS = {
|
|
23
|
+
vue: { lib: () => Vue, version: vuePkg.version },
|
|
24
|
+
"vue-router": { lib: () => VueRouter, version: vueRouterPkg.version },
|
|
25
|
+
"vue-i18n": { lib: () => VueI18n, version: vueI18nPkg.version },
|
|
26
|
+
"vee-validate": { lib: () => VeeValidate, version: VeeValidate.version ?? "4.0.0" },
|
|
27
|
+
"lodash-es": { lib: () => LodashEs, version: lodashEsPkg.version },
|
|
28
|
+
"@vueuse/core": { lib: () => VueuseCore, version: vueusePkg.version },
|
|
29
|
+
"@vc-shell/framework": { lib: () => Framework, version: frameworkPkg.version },
|
|
31
30
|
};
|
|
31
|
+
const SHARED_LIBS = Object.fromEntries(Object.entries(SHARED_DEPS_BASE).map(([name, config]) => {
|
|
32
|
+
const runtime = RUNTIME_LIBS[name];
|
|
33
|
+
if (!runtime) {
|
|
34
|
+
throw new Error(`[mf-host] Missing runtime mapping for shared dep "${name}". Update RUNTIME_LIBS.`);
|
|
35
|
+
}
|
|
36
|
+
return [name, { ...runtime, requiredVersion: config.requiredVersion ?? "*" }];
|
|
37
|
+
}));
|
|
32
38
|
// --- Helper functions ---
|
|
33
39
|
/** Resolve Vue plugin(s) from MF module exports. */
|
|
34
40
|
function resolvePlugins(exports) {
|
|
@@ -88,6 +94,10 @@ export function registerRemoteModules(app, options) {
|
|
|
88
94
|
const { ModulesReadyKey, ModulesLoadErrorKey } = Framework;
|
|
89
95
|
const modulesReady = ref(false);
|
|
90
96
|
const modulesLoadError = ref(false);
|
|
97
|
+
// Capture the original URL before the blade router guard can redirect it away.
|
|
98
|
+
// During async module loading, the guard may not find workspaces (not registered yet)
|
|
99
|
+
// and redirect to root — losing the tenant prefix and blade URL.
|
|
100
|
+
const _initialUrl = window.location.hash.replace(/^#/, "") || "/";
|
|
91
101
|
app.provide(ModulesReadyKey, modulesReady);
|
|
92
102
|
app.provide(ModulesLoadErrorKey, modulesLoadError);
|
|
93
103
|
// Fire-and-forget async loading
|
|
@@ -145,13 +155,13 @@ export function registerRemoteModules(app, options) {
|
|
|
145
155
|
shareConfig: { singleton: true, requiredVersion: entry.requiredVersion },
|
|
146
156
|
};
|
|
147
157
|
}
|
|
148
|
-
|
|
158
|
+
const mfInstance = createInstance({
|
|
149
159
|
name: "host",
|
|
150
160
|
remotes: compatible.map((mod) => ({ name: mod.id, entry: mod.entry, type: "module" })),
|
|
151
161
|
shared,
|
|
152
162
|
});
|
|
153
163
|
// 5. Load all in parallel
|
|
154
|
-
const results = await Promise.allSettled(compatible.map(async (mod) => ({ mod, exports: await loadRemote(`${mod.id}/module`) })));
|
|
164
|
+
const results = await Promise.allSettled(compatible.map(async (mod) => ({ mod, exports: await mfInstance.loadRemote(`${mod.id}/module`) })));
|
|
155
165
|
performance.mark("vc:modules-loaded");
|
|
156
166
|
const loaded = [];
|
|
157
167
|
const failed = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-remote-modules.js","sourceRoot":"","sources":["../src/register-remote-modules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAyB,MAAM,KAAK,CAAC;AAEjD,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"register-remote-modules.js","sourceRoot":"","sources":["../src/register-remote-modules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAyB,MAAM,KAAK,CAAC;AAEjD,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,oEAAoE;AACpE,qDAAqD;AACrD,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,UAAU,CAAC;AACpC,OAAO,KAAK,WAAW,MAAM,cAAc,CAAC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AAC;YACJ,CAAC;YAED,WAAW,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;YACzC,YAAY,CAAC,KAAK,GAAG,IAAI,CAAC;YAE1B,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC;YAChE,IAAI,YAAY,KAAK,GAAG;gBAAE,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;YAE/D,WAAW,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACtC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,KAAK,CAAC,CAAC;YACzD,gBAAgB,CAAC,KAAK,GAAG,IAAI,CAAC;YAC9B,WAAW,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACtC,CAAC;IACH,CAAC,CAAC,EAAE,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { UserConfig } from "vite";
|
|
2
|
+
/**
|
|
3
|
+
* Vite config helper for MF host apps.
|
|
4
|
+
* Pre-bundles transitive MF runtime dependency to prevent dev-mode full-reloads.
|
|
5
|
+
*/
|
|
6
|
+
export declare function mfHostConfig(): UserConfig;
|
|
7
|
+
//# sourceMappingURL=vite-helper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite-helper.d.ts","sourceRoot":"","sources":["../src/vite-helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAEvC;;;GAGG;AACH,wBAAgB,YAAY,IAAI,UAAU,CAMzC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vite config helper for MF host apps.
|
|
3
|
+
* Pre-bundles transitive MF runtime dependency to prevent dev-mode full-reloads.
|
|
4
|
+
*/
|
|
5
|
+
export function mfHostConfig() {
|
|
6
|
+
return {
|
|
7
|
+
optimizeDeps: {
|
|
8
|
+
include: ["@vc-shell/mf-host > @module-federation/runtime"],
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=vite-helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite-helper.js","sourceRoot":"","sources":["../src/vite-helper.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO;QACL,YAAY,EAAE;YACZ,OAAO,EAAE,CAAC,gDAAgD,CAAC;SAC5D;KACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,44 +1,56 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vc-shell/mf-host",
|
|
3
3
|
"description": "Module Federation host runtime for VC Shell — discovers and loads remote modules",
|
|
4
|
-
"version": "2.0.0
|
|
4
|
+
"version": "2.0.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./vite": {
|
|
14
|
+
"types": "./dist/vite-helper.d.ts",
|
|
15
|
+
"import": "./dist/vite-helper.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
8
18
|
"files": [
|
|
9
19
|
"dist"
|
|
10
20
|
],
|
|
11
21
|
"scripts": {
|
|
12
|
-
"build": "tsc && tsc-alias",
|
|
22
|
+
"build": "tsc -b --clean && tsc && tsc-alias",
|
|
13
23
|
"test": "vitest run",
|
|
14
24
|
"test:watch": "vitest"
|
|
15
25
|
},
|
|
16
26
|
"dependencies": {
|
|
17
|
-
"@module-federation/
|
|
27
|
+
"@module-federation/runtime": "^2.1.0",
|
|
28
|
+
"@vc-shell/mf-config": "2.0.0",
|
|
18
29
|
"semver": "^7.6.2"
|
|
19
30
|
},
|
|
20
31
|
"peerDependencies": {
|
|
21
|
-
"@vc-shell/framework": "^2.0.0
|
|
32
|
+
"@vc-shell/framework": "^2.0.0",
|
|
22
33
|
"@vueuse/core": "^10.0.0",
|
|
23
34
|
"lodash-es": "^4.0.0",
|
|
24
|
-
"vee-validate": "^4.
|
|
35
|
+
"vee-validate": "^4.12.0",
|
|
25
36
|
"vue": "^3.4.0",
|
|
26
|
-
"vue-i18n": "^9.0.0",
|
|
27
|
-
"vue-router": "^4.0.0"
|
|
37
|
+
"vue-i18n": "^9.0.0 || ^11.0.0",
|
|
38
|
+
"vue-router": "^4.0.0 || ^5.0.0"
|
|
28
39
|
},
|
|
29
40
|
"devDependencies": {
|
|
30
41
|
"@types/semver": "^7.5.0",
|
|
31
|
-
"@vc-shell/framework": "2.0.0
|
|
32
|
-
"@vc-shell/ts-config": "2.0.0
|
|
42
|
+
"@vc-shell/framework": "2.0.0",
|
|
43
|
+
"@vc-shell/ts-config": "2.0.0",
|
|
33
44
|
"@vueuse/core": "^10.7.1",
|
|
34
45
|
"lodash-es": "^4.17.21",
|
|
35
46
|
"tsc-alias": "^1.8.8",
|
|
36
47
|
"typescript": "^5.8.3",
|
|
37
48
|
"vee-validate": "^4.12.4",
|
|
49
|
+
"vite": "^6.0.0",
|
|
38
50
|
"vitest": "^3.2.4",
|
|
39
|
-
"vue": "^3.5.
|
|
51
|
+
"vue": "^3.5.30",
|
|
40
52
|
"vue-i18n": "^11.3.0",
|
|
41
|
-
"vue-router": "^
|
|
53
|
+
"vue-router": "^5.0.3"
|
|
42
54
|
},
|
|
43
55
|
"publishConfig": {
|
|
44
56
|
"access": "public",
|