Skip to content

22.0.0-rc.1

Pre-release
Pre-release

Choose a tag to compare

@jhuleatt jhuleatt released this 16 Nov 15:41
Immutable release. Only release title and notes can be modified.
ba07218

Upgrading

This is the second release candidate of AngularFire 22, published under npm's next tag. It still requires Angular 22 and TypeScript 6.0, and it now accepts firebase 13 as well as firebase 12.18.0 or newer.

From 22.0.0-rc.0, run:

ng update @angular/fire@next

From an app on Angular 21 and AngularFire 21, run:

ng update @angular/core@22 @angular/cli@22 @angular/fire@next

On a new Angular 22 app, run ng add @angular/fire@next. The AngularFire 22 upgrade guide covers the rest, including the two timing changes below.

Breaking changes

Both changes make values and stability arrive one timer turn sooner. Apps see the same values in the same order, and the DOM still updates on delivery. Tests that wait on exact timing are what may need a change.

Observable reads deliver their values as microtasks (#3833)

Every Observable read (collectionData, docData, authState, user, objectVal, listVal and the rest) used to hand each value to your subscriber after a timer turn. It now does so at the next microtask checkpoint.

  • A test that waits only for microtasks (awaited promises, flushMicrotasks()) now sees values from sources that emit in a microtask, such as Auth. In a test with fake timers, a Firestore value still arrives only after tick() or vi.advanceTimersByTime().
  • Your own setTimeout registered when a read emits now runs after the value arrives, not before.
  • The compat AngularFireAuth streams change the same way.

Callback reads release Angular's pending task right after the callback (#3837)

Every callback read that holds the app unstable until its first value (onSnapshot, onAuthStateChanged, onValue and the rest) used to keep Angular's pending task for one more setTimeout(fn, 0) delay after the callback ran, and again after unsubscribing. It now releases the task as soon as the callback returns or throws.

  • whenStable() and server rendering follow a callback read's first value one setTimeout(fn, 0) delay sooner.
  • A test that inspects pending tasks sees the task gone as soon as the callback has run. In a test with fake timers, await whenStable() still needs tick() or vi.advanceTimersByTime() first, because Angular runs change detection from a timer.

What's Changed

Installing and upgrading

  • feat: @angular/fire 22 accepts firebase 13 alongside 12 (^12.18.0 || ^13.0.0). ng add and ng update keep the firebase major you already have, and on npm a new app gets firebase 13, which requires Node.js 24.12 or newer. rxfire moves to ^6.3.0: with idField set, a Firestore converter that returns a frozen object now throws. by @armando-navarro in #3831 and #3835

Server rendering

  • feat(app): initializeBrowserOrServerApp in @angular/fire/app returns the ordinary Firebase app in the browser and a FirebaseServerApp for the visitor's tokens on the server, and releases that server app for you. It replaces the server-app callback the Authentication guide used to ask for. Call it in app.config.ts, and do not call deleteApp on the injected app. by @armando-navarro in #3844, #3835 and #3845
  • fix: twelve wrapped calls whose first callback may never come, such as onLog, onTokenChanged and onChildAdded, no longer keep the app unstable, which could hang a server render or an SSR build until a 30-second timeout. The full list is in the zones guide. To make a server render wait for a Realtime Database list, use list(ref) or listVal(ref). by @armando-navarro in #3827 and #3835

Zones and the injection context

  • feat(zones)!: Observable reads deliver their values as microtasks. See "Breaking changes" above. by @armando-navarro in #3833 and #3835
  • feat(zones)!: callback reads release Angular's pending task right after the callback. See "Breaking changes" above. by @armando-navarro in #3837 and #3835
  • fix(core): a handler passed as an observer object, such as onSnapshot(ref, { next }), now behaves like one passed as a function. A wrapped promise or handler that completes after its injector is destroyed now runs instead of hanging or throwing NG0205. by @armando-navarro in #3829 and #3835
  • build(firestore): 25 synchronous Firestore functions, such as where, doc and collection, are no longer zone wrapped, so they no longer print the injection-context warning. by @armando-navarro in #3842 and #3835

Documentation

  • docs(firestore): the README, the Quickstart and the Firestore guide type reads with a FirestoreDataConverter and withConverter() instead of collectionData<Item>(...), which did not compile, or a cast, which checked nothing. by @armando-navarro in #3838
  • docs(compat): docs/compat.md has a Setup section in standalone and NgModule form, and the compat product pages point at it. by @armando-navarro in #3835
  • docs: the upgrade guide says that npm refuses an incompatible firebase while Yarn and pnpm install it with a warning. by @armando-navarro in #3835

Repository

  • chore(sample): the sample app runs on Angular 22 and firebase 13, and builds its Firebase app with initializeBrowserOrServerApp. by @armando-navarro in #3845
  • ci: the required Branch protection check fails when a job it waits on fails or is cancelled, instead of being skipped. by @armando-navarro in #3840

Full Changelog: 22.0.0-rc.0...22.0.0-rc.1