Skip to content
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
# Cache node_modules
- uses: actions/setup-node@v3
with:
node-version: 20
node-version: 24
cache: 'npm'
- run: npm ci
- uses: nrwl/nx-set-shas@v4
Expand Down
2 changes: 1 addition & 1 deletion apps/mfe1-e2e/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": ["plugin:cypress/recommended", "../../.eslintrc.json"],
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
Expand Down
2 changes: 1 addition & 1 deletion apps/mfe2-e2e/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": ["plugin:cypress/recommended", "../../.eslintrc.json"],
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
Expand Down
6 changes: 3 additions & 3 deletions apps/native-federation-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/native-federation-e2e/src",
"tags": [],
"implicitDependencies": ["native-federation"],
"targets": {
"e2e": {
"executor": "@nx/jest:jest",
Expand All @@ -16,7 +18,5 @@
"test": {
"command": "echo Noop"
}
},
"tags": [],
"implicitDependencies": ["native-federation"]
}
}
2 changes: 1 addition & 1 deletion apps/playground-e2e/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": ["plugin:cypress/recommended", "../../.eslintrc.json"],
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
Expand Down
4 changes: 2 additions & 2 deletions libs/mf-runtime/enhanced/src/lib/init-federation.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { init } from '@module-federation/enhanced/runtime';
import { FederationHost, UserOptions } from '@module-federation/runtime-core';
import { ModuleFederation, UserOptions } from '@module-federation/runtime-core';

export type ManifestFile<T extends RemoteConfig = RemoteConfig> = {
[key: string]: string | T;
Expand Down Expand Up @@ -38,7 +38,7 @@ let config: Manifest = {};
export async function initFederation(
manifest: string | ManifestFile,
options?: InitFederationOptions
): Promise<FederationHost> {
): Promise<ModuleFederation> {
if (typeof manifest === 'string') {
config = await loadManifest(manifest);
} else {
Expand Down
8 changes: 4 additions & 4 deletions libs/mf-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"license": "MIT",
"version": "20.0.0",
"peerDependencies": {
"@angular/common": ">=20.0.0",
"@angular/core": ">=20.0.0",
"@module-federation/enhanced": "^0.9.0",
"@module-federation/runtime-core": "^0.6.21"
"@angular/common": ">=20.1.0",
"@angular/core": ">=20.1.0",
"@module-federation/enhanced": "^0.21.2",
"@module-federation/runtime-core": "^0.21.2"
},
"dependencies": {
"tslib": "^2.0.0"
Expand Down
6 changes: 3 additions & 3 deletions libs/mf-tools/src/lib/web-components/bootstrap-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ function getPlatformCache(): Map<Version, PlatformRef> {

function setPlatform(version: Version, platform: PlatformRef): void {
if (platformSharing) {
legacyMode && setLegacyPlatform(version.full, platform);
if (legacyMode) setLegacyPlatform(version.full, platform);
getPlatformCache().set(version, platform);
}
}
Expand All @@ -151,7 +151,7 @@ function getPlatform(options: Options): PlatformRef {
if (!platform) {
platform = options.platformFactory();
setPlatform(VERSION, platform);
options.production && enableProdMode();
if (options.production) enableProdMode();
}

return platform;
Expand All @@ -166,7 +166,7 @@ function getNgZone(): NgZone {

export function shareNgZone(zone: NgZone): void {
if (ngZoneSharing) {
legacyMode && setLegacyNgZone(zone);
if (legacyMode) setLegacyNgZone(zone);
setGlobalStateSlice({ ngZone: zone });
}
}
Expand Down
4 changes: 2 additions & 2 deletions libs/mf-tools/src/lib/web-components/web-component-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
AfterContentInit,
Component,
ElementRef,
inject,
Input,
OnChanges,
ViewChild,
Expand Down Expand Up @@ -32,8 +33,7 @@ export class WebComponentWrapper implements AfterContentInit, OnChanges {
@Input() events: { [event: string]: (event: Event) => void };

element: HTMLElement;

constructor(private route: ActivatedRoute) {}
private route = inject(ActivatedRoute);

ngOnChanges(): void {
if (!this.element) return;
Expand Down
6 changes: 3 additions & 3 deletions libs/mf/src/rspack/with-federation.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ModuleFederationConfig, RsbuildConfig } from '@rsbuild/core';
import { pluginScriptModule } from './plugin-script-module';
import { applySkipList, normalizeSkipList, SkipList } from '../utils/skip-list';
import { SharedObject } from '@module-federation/enhanced/dist/src/declarations/plugins/sharing/SharePlugin';
Copy link
Collaborator Author

@Aukevanoost Aukevanoost Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@manfredsteyer Small question, the interfaces appear to be identical, just typescript is not accepting using them intertwined. What's your take on this? Or anyone else? Which one should be used?

import { Shared } from '@rspack/core/dist/sharing/SharePlugin';
import { findRootTsConfigJson, SharedMappings } from '../webpack';

export type FederationConfig = {
Expand Down Expand Up @@ -36,15 +36,15 @@ export function applyFederation(
const mappings = new SharedMappings();
mappings.register(findRootTsConfigJson());

const shared = (mfConfig.options.shared ?? {}) as SharedObject;
const shared = (mfConfig.options.shared ?? {}) as Shared;
const sharedWithLibs = {
...mappings.getDescriptors(),
...shared,
};

const filteredSkipList = applySkipList(normalizedSkip, sharedWithLibs);

mfConfig.options.shared = filteredSkipList;
mfConfig.options.shared = filteredSkipList as Shared;

const config: RsbuildConfig = {
...rsbuildConfig,
Expand Down
2 changes: 1 addition & 1 deletion libs/mf/src/schematics/init-rspack/schematic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type PackageJson = {
};

const RSPACK_DEPS = {
'@module-federation/enhanced': '0.14.3',
'@module-federation/enhanced': '0.21.2',
};

const RSPACK_DEV_DEPS = {
Expand Down
2 changes: 1 addition & 1 deletion libs/mf/src/universal/create-fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { promises } from 'fs';
import { normalize } from 'path';

import fetch = require('node-fetch');
import fetch from 'node-fetch';

export type AbortablePromise<T> = Promise<T> & {
abort: () => unknown;
Expand Down
2 changes: 0 additions & 2 deletions libs/mf/src/utils/shared-mappings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ export class SharedMappings {
return result;
}

// eslint-disable-next-line @typescript-eslint/ban-types
getDescriptors(eager?: boolean): object {
const result = {};

Expand All @@ -119,7 +118,6 @@ export class SharedMappings {
return result;
}

// eslint-disable-next-line @typescript-eslint/ban-types
getDescriptor(mappedPath: string, requiredVersion: string = null): object {
const lib = this.mappings.find((m) => m.key === mappedPath);

Expand Down
6 changes: 3 additions & 3 deletions libs/mf/src/utils/skip-list.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SharedObject } from '@module-federation/enhanced/dist/src/declarations/plugins/sharing/SharePlugin';
import { Shared } from '@rspack/core/dist/sharing/SharePlugin';

export type CheckSkipFn = (packageName: string) => boolean;
export type SkipListItem = string | RegExp | CheckSkipFn;
Expand All @@ -19,9 +19,9 @@ export function normalizeSkipList(skipList: SkipList = []): NormalizedSkipList {

export function applySkipList(
normalizedSkip: NormalizedSkipList,
shared: SharedObject
shared: Shared
) {
const filtered: SharedObject = {};
const filtered: Shared = {};
for (const key in shared) {
if (!normalizedSkip.find((f) => f(key))) {
filtered[key] = shared[key];
Expand Down
2 changes: 1 addition & 1 deletion libs/native-federation-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "MIT",
"dependencies": {
"json5": "^2.2.0",
"chalk": "^4.1.2",
"chalk": "^5.6.2",
"@softarc/native-federation-runtime": "3.3.6",
"fast-glob": "^3.3.3",
"@softarc/sheriff-core": "0.19.2"
Expand Down
4 changes: 2 additions & 2 deletions libs/native-federation-esbuild/src/lib/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
import * as esbuild from 'esbuild';
import { rollup } from 'rollup';
import resolve from '@rollup/plugin-node-resolve';
import { externals } from 'rollup-plugin-node-externals';
import { nodeExternals } from 'rollup-plugin-node-externals';
import * as fs from 'fs';
import path from 'path';

Expand Down Expand Up @@ -151,7 +151,7 @@ async function prepareNodePackage(

plugins: [
commonjs(),
externals({ include: external }),
nodeExternals({ include: external }),
resolve(),
replace({
preventAssignment: true,
Expand Down
2 changes: 1 addition & 1 deletion libs/native-federation-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "3.3.6",
"license": "MIT",
"dependencies": {
"@softarc/native-federation-runtime": "^3.3.1",
"@softarc/native-federation-runtime": "^3.3.6",
"tslib": "^2.8.1"
}
}
2 changes: 1 addition & 1 deletion libs/native-federation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@babel/core": "^7.19.0",
"@softarc/native-federation": "3.3.6",
"@softarc/native-federation-runtime": "3.3.6",
"@chialab/esbuild-plugin-commonjs": "^0.18.0",
"@chialab/esbuild-plugin-commonjs": "^0.19.0",
"esbuild": "^0.25.1",
"mrmime": "^1.0.1",
"signale": "^1.4.0",
Expand Down
7 changes: 4 additions & 3 deletions libs/playground-lib/src/lib/auth.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, inject } from '@angular/core';
import { AuthService } from './auth.service';

@Component({
Expand All @@ -17,8 +17,9 @@ import { AuthService } from './auth.service';
})
export class AuthComponent {
userName = '';
private authService = inject(AuthService);

constructor(authService: AuthService) {
this.userName = authService.userName;
constructor() {
this.userName = this.authService.userName;
}
}
Loading