Repository navigation
22.0.0-rc.1
#3846
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Upgrading
This is the second release candidate of AngularFire 22, published under npm's
nexttag. It still requires Angular 22 and TypeScript 6.0, and it now acceptsfirebase13 as well asfirebase12.18.0 or newer.From
22.0.0-rc.0, run:From an app on Angular 21 and AngularFire 21, run:
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,listValand the rest) used to hand each value to your subscriber after a timer turn. It now does so at the next microtask checkpoint.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 aftertick()orvi.advanceTimersByTime().setTimeoutregistered when a read emits now runs after the value arrives, not before.AngularFireAuthstreams 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,onValueand the rest) used to keep Angular's pending task for one moresetTimeout(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 onesetTimeout(fn, 0)delay sooner.await whenStable()still needstick()orvi.advanceTimersByTime()first, because Angular runs change detection from a timer.What's Changed
Installing and upgrading
@angular/fire22 acceptsfirebase13 alongside 12 (^12.18.0 || ^13.0.0).ng addandng updatekeep the firebase major you already have, and on npm a new app gets firebase 13, which requires Node.js 24.12 or newer.rxfiremoves to^6.3.0: withidFieldset, a Firestore converter that returns a frozen object now throws. by @armando-navarro in feat: accept firebase 13 alongside firebase 12 #3831 and docs: document the 22.0.0-rc.1 changes #3835Server rendering
initializeBrowserOrServerAppin@angular/fire/appreturns the ordinary Firebase app in the browser and aFirebaseServerAppfor 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 inapp.config.ts, and do not calldeleteAppon the injected app. by @armando-navarro in feat(app): add initializeBrowserOrServerApp for browser & server apps #3844, docs: document the 22.0.0-rc.1 changes #3835 and chore(sample): update the sample app to Angular 22 #3845onLog,onTokenChangedandonChildAdded, 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, uselist(ref)orlistVal(ref). by @armando-navarro in fix: stop twelve wrapped calls from holding the app unstable #3827 and docs: document the 22.0.0-rc.1 changes #3835Zones and the injection context
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 throwingNG0205. by @armando-navarro in fix(core): wrap observer-object handlers like functions, and let a wrapped promise settle after teardown #3829 and docs: document the 22.0.0-rc.1 changes #3835where,docandcollection, are no longer zone wrapped, so they no longer print the injection-context warning. by @armando-navarro in build(firestore): stop zone-wrapping functions that schedule no work #3842 and docs: document the 22.0.0-rc.1 changes #3835Documentation
FirestoreDataConverterandwithConverter()instead ofcollectionData<Item>(...), which did not compile, or a cast, which checked nothing. by @armando-navarro in docs(firestore): type reads with a converter instead of a type argument #3838docs/compat.mdhas a Setup section in standalone and NgModule form, and the compat product pages point at it. by @armando-navarro in docs: document the 22.0.0-rc.1 changes #3835firebasewhile Yarn and pnpm install it with a warning. by @armando-navarro in docs: document the 22.0.0-rc.1 changes #3835Repository
initializeBrowserOrServerApp. by @armando-navarro in chore(sample): update the sample app to Angular 22 #3845Branch protectioncheck fails when a job it waits on fails or is cancelled, instead of being skipped. by @armando-navarro in ci: fail the Branch protection check when a job it waits on does not succeed #3840Full Changelog: 22.0.0-rc.0...22.0.0-rc.1
This discussion was created from the release 22.0.0-rc.1.
All reactions