chore: migrate module-federation to v2

Signed-off-by: secustor <sebastian@poxhofer.at>
This commit is contained in:
secustor
2026-04-16 15:15:04 +02:00
parent 62c16341ba
commit 41070b89c5
7 changed files with 214 additions and 299 deletions
@@ -68,7 +68,7 @@
"@backstage/plugin-search-common": "workspace:^",
"@backstage/types": "workspace:^",
"@manypkg/get-packages": "^1.1.3",
"@module-federation/sdk": "^0.21.6",
"@module-federation/sdk": "^2.3.3",
"chokidar": "^3.5.3",
"express": "^4.22.0",
"express-promise-router": "^4.1.0",
+1 -1
View File
@@ -47,7 +47,7 @@
"@backstage/errors": "workspace:^",
"@backstage/module-federation-common": "workspace:^",
"@manypkg/get-packages": "^1.1.3",
"@module-federation/enhanced": "^0.21.6",
"@module-federation/enhanced": "^2.3.3",
"@pmmmwh/react-refresh-webpack-plugin": "^0.6.0",
"@rollup/plugin-commonjs": "^26.0.0",
"@rollup/plugin-json": "^6.0.0",
@@ -35,9 +35,9 @@
"@backstage/config": "workspace:^",
"@backstage/frontend-plugin-api": "workspace:^",
"@backstage/module-federation-common": "workspace:^",
"@module-federation/enhanced": "^0.21.6",
"@module-federation/runtime": "^0.21.6",
"@module-federation/sdk": "^0.21.6",
"@module-federation/enhanced": "^2.3.3",
"@module-federation/runtime": "^2.3.3",
"@module-federation/sdk": "^2.3.3",
"cross-fetch": "^4.0.0",
"uri-template": "^2.0.0"
},
@@ -991,7 +991,7 @@ describe('dynamicFrontendFeaturesLoader', () => {
expect(warnCalls).toEqual(['[ Federation Runtime ]']);
expect(errorCalls).toEqual([
"Failed loading remote module 'plugin_1' of dynamic plugin 'plugin-1': Error: [ Federation Runtime ]: http://localhost:7007/.backstage/dynamic-features/remotes/plugin-1/mf-manifest.json is not a federation manifest",
`Failed loading remote module 'plugin_1' of dynamic plugin 'plugin-1': Error: [ Federation Runtime ]: "http://localhost:7007/.backstage/dynamic-features/remotes/plugin-1/mf-manifest.json" is not a valid federation manifest for remote "plugin_1". Missing required fields: metaData, exposes, shared.`,
]);
expect(features).toMatchObject([
{
@@ -1089,7 +1089,7 @@ describe('dynamicFrontendFeaturesLoader', () => {
const warnCalls = mocks.console.warn.mock.calls.flatMap(e => e[0]);
expect(warnCalls).toEqual(['[ Federation Runtime ]']);
expect(errorCalls).toEqual([
"Failed loading remote module 'plugin_1' of dynamic plugin 'plugin-1': Error: [ Federation Runtime ]: http://localhost:7007/.backstage/dynamic-features/remotes/plugin-1/mf-manifest.json is not a federation manifest",
`Failed loading remote module 'plugin_1' of dynamic plugin 'plugin-1': Error: [ Federation Runtime ]: "http://localhost:7007/.backstage/dynamic-features/remotes/plugin-1/mf-manifest.json" is not a valid federation manifest for remote "plugin_1". Missing required fields: metaData, exposes, shared.`,
]);
expect(features).toMatchObject([
{
@@ -39,7 +39,7 @@
"@backstage/config": "workspace:^",
"@backstage/errors": "workspace:^",
"@backstage/types": "workspace:^",
"@module-federation/runtime": "^0.21.6"
"@module-federation/runtime": "^2.3.3"
},
"devDependencies": {
"@backstage/cli": "workspace:^",