github angular/angularfire 21.0.0-rc.2

pre-release4 hours ago

Breaking change

App Check no longer runs during server rendering by default (#3773). During server rendering, AngularFire no longer calls the function passed to provideAppCheck, and inject(AppCheck) returns null there. Browser-side behavior is unchanged. This fixes the ReferenceError: document is not defined build failure in server-rendered apps, because the reCAPTCHA providers need a browser.

To keep App Check running during server rendering, provide APP_CHECK_ON_SERVER as true in your server config:

import { APP_CHECK_ON_SERVER } from '@angular/fire/app-check';

// in your server app config's providers
{ provide: APP_CHECK_ON_SERVER, useValue: true },

Details, including how server-side Firebase requests can still carry an App Check token: App Check during server rendering.

Updating from 21.0.0-rc.1

Installing a release candidate saves its exact version, so it does not move on its own. Run:

ng update @angular/fire@21.0.0-rc.2

What's Changed

Installing and upgrading

  • fix: remove the unused optional @angular/platform-server peer dependency, which made npm install and ng add @angular/fire fail with ERESOLVE on an app one Angular patch behind the newest release. by @armando-navarro in #3792
  • fix: ng update @angular/fire no longer stops before the v21 migration when it runs under Angular CLI 22.3, whose schematics package refuses the file path AngularFire's schematics loaded. by @armando-navarro in #3793
  • fix: ng add @angular/fire no longer stops with Invalid project id: myApp. for a project whose name has capital letters. It and ng deploy also no longer crash with Cannot read properties of undefined (reading 'email') on firebase-tools 15.26 or later when run without a terminal, for example by an AI agent. by @armando-navarro in #3769
  • fix: the @angular/fire/compat/storage typings no longer import firebase/compat, which failed the build with TS2307 under moduleResolution: "bundler". by @armando-navarro in #3796

Server-side rendering

  • fix(app-check)!: skip App Check during server rendering by default. See "Breaking change" above. by @armando-navarro in #3773
  • fix: beforeAuthStateChanged from @angular/fire/auth no longer keeps the app from ever becoming stable for a visitor who never signs in or out. Its callback still runs inside Angular's zone and injection context. by @armando-navarro in #3770

Documentation

  • docs: the Quickstart lists npm 11.6 or later as a requirement, since older npm, including the npm 10 that ships with Node.js 20 and 22, cannot install a new Angular 21 project (Cannot read properties of null (reading 'edgesOut')). by @armando-navarro in #3787
  • docs: the upgrade guide covers ng update stopping with The Angular CLI requires a minimum Node.js version of ..., and how to get past it. by @armando-navarro in #3788
  • docs: the App Check guide explains what changes during server rendering, how to run App Check there with APP_CHECK_ON_SERVER, and how to keep App Check out of the server on 21.0.0-rc.1 and earlier. by @armando-navarro in #3775
  • docs: the upgrade guide lists the removed @angular/platform-server peer dependency and the App Check change. by @armando-navarro in #3795
  • docs: the Quickstart and the upgrade guide install AngularFire 21 with Angular 21, and the product pages point at the Quickstart. by @armando-navarro in #3765
  • docs: drop the --save-exact step for the release candidate. by @armando-navarro in #3778

Release tooling

  • fix(ci): a release now chooses its npm tag when it publishes, so a 20.x release made after 21.0.0 goes to v20-lts instead of replacing 21 on latest, and next moves up to a stable release that passes it. by @armando-navarro in #3794
  • fix: canary builds are named one patch above the newest release of their major, for example 21.0.1-canary.<time>.sha-<commit>. ng add @angular/fire@canary now installs the canary rather than the release candidate, and installing @next or a release candidate never picks up a canary. by @armando-navarro in #3767 and #3780
  • fix: canary builds are ordered by commit time, and the canary tag can no longer move back to an older build. by @armando-navarro in #3772 and #3784
  • chore: the pull request template asks whether a change is breaking. by @armando-navarro in #3782

Full Changelog: 21.0.0-rc.1...21.0.0-rc.2

Don't miss a new angularfire release

NewReleases is sending notifications on new releases.