When using @angular-architects/native-federation@22.0.0 with Angular 22:
Setup
- Host app (port 4200) loads remote MFE-1 via native federation
- MFE-1 (port 4201) served via
@angular-architects/native-federation:build builder
buildNotifications: { enable: true } configured on MFE-1
- Host uses
initFederation() from @softarc/native-federation-orchestrator to load remote MFE-1
Problem
When code changes in MFE-1:
- MFE-1 rebuilds successfully
- The host shell does NOT auto-reload — SSE build notifications don't trigger
- Developers must manually F5/refresh the browser to see changes
Console shows SSE connection opens ([Federation SSE] Client connected) but completed events don't propagate to trigger a reload in the host shell.
What I've tried
- Enabling
buildNotifications in angular.json on the remote MFE-1
- Creating a custom
EventSource in the host to listen for build events
- Using
useShimImportMap({ shimMode: true }) — shim mode may interfere with native EventSource behavior
- The SSE connection establishes, but
BUILD_COMPLETED events don't cause a page reload
Workaround (temporary)
Patched the MFE-1 builder (builder.js in node_modules) to write a build-timestamp.json to the output directory on each rebuild, then poll it from the host. Not ideal.
Related
Expected behavior
When a remote MFE finishes rebuilding in development mode, the host shell should automatically detect the change and reload/refresh the page — restoring the fast feedback loop developers expect.
When using
@angular-architects/native-federation@22.0.0with Angular 22:Setup
@angular-architects/native-federation:buildbuilderbuildNotifications: { enable: true }configured on MFE-1initFederation()from@softarc/native-federation-orchestratorto load remote MFE-1Problem
When code changes in MFE-1:
Console shows SSE connection opens (
[Federation SSE] Client connected) butcompletedevents don't propagate to trigger a reload in the host shell.What I've tried
buildNotificationsinangular.jsonon the remote MFE-1EventSourcein the host to listen for build eventsuseShimImportMap({ shimMode: true })— shim mode may interfere with native EventSource behaviorBUILD_COMPLETEDevents don't cause a page reloadWorkaround (temporary)
Patched the MFE-1 builder (
builder.jsin node_modules) to write abuild-timestamp.jsonto the output directory on each rebuild, then poll it from the host. Not ideal.Related
@angular/build), which may affect how SSE middleware is processedExpected behavior
When a remote MFE finishes rebuilding in development mode, the host shell should automatically detect the change and reload/refresh the page — restoring the fast feedback loop developers expect.