Skip to content

Releases: dever-labs/ngx-mfe-broker

v0.2.0

Choose a tag to compare

@czprz czprz released this 15 Jul 23:32

⚠️ 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 initialState values 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 initialState value directly
  • Removed unused internal defaults map from MfeStateService
  • 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

Choose a tag to compare

@czprz czprz released this 15 Jul 23:32

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_STATE removed from the contract — defaults live in the shell's app.config.ts alongside provideNgxMfeBroker()
  • Updated diagram and non-monorepo section to reflect shell ownership model

v0.1.3

Choose a tag to compare

@czprz czprz released this 15 Jul 23:32

Changed

  • State contract pattern simplified: removed APP_STATE_KEYS entirely — injectAppState now derives keys from APP_INITIAL_STATE via Object.keys() automatically. Adding a new state key only requires changes in two places: the AppState interface and APP_INITIAL_STATE.
  • APP_INITIAL_STATE now uses satisfies AppState instead of an explicit type annotation

v0.1.2

Choose a tag to compare

@czprz czprz released this 15 Jul 23:32

Changed

  • Root README.md rewritten as contributor/repo guide (structure, dev setup, scripts, release process)
  • projects/ngx-mfe-broker/README.md is 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_STATE injection token to the API reference
  • Added npx vitest run to the building/scripts section

v0.1.1

Choose a tag to compare

@czprz czprz released this 10 Jul 22:25

Bug Fixes

  • SSR safety: Both MfeStateService and ConfigRepositoryService now guard all localStorage access behind a typeof localStorage !== 'undefined' check, preventing ReferenceError in SSR / non-browser environments. BroadcastChannel was already guarded; localStorage was not.

  • Echo-loop guard in ConfigRepositoryService: Replaced the queueMicrotask-based inbound-key Set with a value-based inboundValues Map — consistent with MfeStateService and immune to microtask timing races (e.g. when used with Angular's TestBed.flushEffects()).

  • Removed unused peer dependency: @angular/common was listed as a peer dependency but never imported. Removed to avoid spurious install warnings for consumers.

Tooling

  • Added vitest.config.ts and test-setup.ts so the test suite can be run directly with npx vitest run without requiring Angular CLI.

Full Changelog

https://github.com/dever-labs/ngx-mfe-broker/blob/main/CHANGELOG.md