Releases: dever-labs/ngx-mfe-broker
Release list
v0.2.0
⚠️ Breaking Change
MfeStateService no longer falls back to in-memory defaults when a key is missing from localStorage.
Changed
- Fail-fast initialisation: if a key is missing from localStorage in a browser environment, an error is thrown immediately rather than silently using a default value
- Two-pass init: shell-provided
initialStatevalues are written to localStorage on first boot (if not already present), then signals are initialised exclusively from localStorage - SSR / non-browser environments (no localStorage) still use the provided
initialStatevalue directly - Removed unused internal
defaultsmap fromMfeStateService - Updated docs to reflect fail-fast semantics and shell ownership of initial values
Why
The shell always loads first and owns all initial values. Any key missing from localStorage at init time indicates misconfiguration — surfacing it as an error is safer than returning a stale or wrong default.
v0.1.4
Changed
- State contract is now explicitly shell-owned: the shell team maintains it and reviews all change requests from MFE teams
- Defaults (
initialState) are the shell's responsibility — the contract only exports the type shape (AppState) and key names (APP_STATE_KEYS) APP_INITIAL_STATEremoved from the contract — defaults live in the shell'sapp.config.tsalongsideprovideNgxMfeBroker()- Updated diagram and non-monorepo section to reflect shell ownership model
v0.1.3
Changed
- State contract pattern simplified: removed
APP_STATE_KEYSentirely —injectAppStatenow derives keys fromAPP_INITIAL_STATEviaObject.keys()automatically. Adding a new state key only requires changes in two places: theAppStateinterface andAPP_INITIAL_STATE. APP_INITIAL_STATEnow usessatisfies AppStateinstead of an explicit type annotation
v0.1.2
Changed
- Root
README.mdrewritten as contributor/repo guide (structure, dev setup, scripts, release process) projects/ngx-mfe-broker/README.mdis now consumer-facing docs published to npm (replaces Angular CLI scaffold placeholder)- Corrected "No echo loops" description to reflect value-based inbound guard (no microtask) introduced in 0.1.1
- Added
NGX_MFE_INITIAL_STATEinjection token to the API reference - Added
npx vitest runto the building/scripts section
v0.1.1
Bug Fixes
-
SSR safety: Both
MfeStateServiceandConfigRepositoryServicenow guard alllocalStorageaccess behind atypeof localStorage !== 'undefined'check, preventingReferenceErrorin SSR / non-browser environments.BroadcastChannelwas already guarded;localStoragewas not. -
Echo-loop guard in
ConfigRepositoryService: Replaced thequeueMicrotask-based inbound-keySetwith a value-basedinboundValuesMap— consistent withMfeStateServiceand immune to microtask timing races (e.g. when used with Angular'sTestBed.flushEffects()). -
Removed unused peer dependency:
@angular/commonwas listed as a peer dependency but never imported. Removed to avoid spurious install warnings for consumers.
Tooling
- Added
vitest.config.tsandtest-setup.tsso the test suite can be run directly withnpx vitest runwithout requiring Angular CLI.
Full Changelog
https://github.com/dever-labs/ngx-mfe-broker/blob/main/CHANGELOG.md