Repository navigation
build: update dependency @angular/fire to v21.0.0 - #4067
angular-robot wants to merge 1 commit into
Conversation
See associated pull request for more information.
There was a problem hiding this comment.
Code Review
This pull request updates @angular/fire from 21.0.0-rc.2 to 21.0.0 in apps/code-of-conduct/package.json along with the corresponding lockfile updates. A review comment points out a potential peer dependency conflict, as @angular/[email protected] expects Angular ^21.2.0 and TypeScript ^5.8.0, whereas the project currently uses Angular 22.3.0-next.2 and TypeScript 6.0.3 which could lead to compilation or runtime issues.
| "@angular/compiler": "22.3.0-next.2", | ||
| "@angular/core": "22.3.0-next.2", | ||
| "@angular/fire": "21.0.0-rc.2", | ||
| "@angular/fire": "21.0.0", |
There was a problem hiding this comment.
Updating @angular/fire to 21.0.0 introduces a peer dependency conflict with the other Angular dependencies in this project. According to the release notes, @angular/[email protected] requires @angular/core and @angular/common version ^21.2.0 and TypeScript ^5.8.0 (below 6.0.0). However, this project is currently using @angular/[email protected] and [email protected]. Using @angular/fire v21 with Angular v22 can lead to runtime errors or compilation failures due to breaking changes in the major version of Angular. To resolve this, align the Angular version to ^21.2.0 or use a compatible pre-release version of @angular/fire that supports Angular v22.
This PR contains the following updates:
21.0.0-rc.2→21.0.0Release Notes
angular/angularfire (@angular/fire)
v21.0.0Upgrading from AngularFire 20
AngularFire 21 requires Angular 21.2 or newer,
firebase12.18.0 or newer,rxfire6.2.0 or newer, and TypeScript 5.8 or newer (below 6).ng addandng deploywork with firebase-tools 14 or 15.The AngularFire 21 upgrade guide covers the rest, including the Vertex AI to Firebase AI Logic move.
Update
firebasetogether with@angular/fire. If yourpackage.jsonstill requestsfirebase11, npm does not report a conflict. It installs both SDK versions side by side, and the two copies reject each other's objects at runtime.ng update @angular/fire@21moves yourfirebasedependency to^12.18.0for you. If you upgrade by hand, runnpm install firebase@^12with it, then check thatnpm ls firebaseshows one version.Breaking changes
Angular 21.2 or newer is required (#3763). Angular 21 is in long-term support, so 21.2 is its final minor line. Run
ng update @angular/core @angular/clifirst if your app is on 21.0 or 21.1.firebase12.18.0 or newer andrxfire6.2.0 or newer are required (#3761, #3723). Olderrxfireversions ask forfirebase11, which installs a second SDK copy next to yourfirebase12.The
@angular/fire/vertexaientry point is gone. Its replacement is@angular/fire/ai, Firebase AI Logic (#3674).ng update @angular/fire@21rewrites the imports and renamed symbols, emitsAgentPlatformBackendin place of the deprecatedVertexAIBackend, and changes the default location fromus-central1toglobal, warning for every file whose region changed (#3725, #3762). The Imagen API, removed infirebase12.18, is no longer wrapped, and the migration warns remaining Imagen users (#3750).App Check no longer runs during server rendering by default (#3773). AngularFire no longer calls the function passed to
provideAppCheckon the server, andinject(AppCheck)returnsnullthere. Browser-side behavior is unchanged. This fixes theReferenceError: document is not definedbuild failure in server-rendered apps, because the reCAPTCHA providers need a browser. To keep App Check running during server rendering, provideAPP_CHECK_ON_SERVERastruein your server config:Details, including how server-side Firebase requests can still carry an App Check token: App Check during server rendering.
Updating from a 21 release candidate or canary build
Installing a release candidate saves its exact version, so it does not move on its own (#3709). Run:
If you installed a canary build, run
npm install @angular/fire@latestinstead.ng updatedoes not offer 21.0.0 to a21.0.1-canaryinstall, because the canary's version number is higher.What's Changed
Fixes that also shipped to Angular 20 apps in 20.0.3, 20.1.0 and 20.1.1 are not repeated here.
Upgrading to v21
ng update @angular/fireupdates your project'sfirebasedependency to the supported^12.18.0, andng addaligns it during setup, preventing duplicated-SDK installs. by @armando-navarro in #3722ng add @angular/firewarns whenfirebaseis installed at more than one version, and shows the dependency chain. Prevents various hard-to-diagnose bugs. by @armando-navarro in #3760ng update @angular/fireno 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 #3793firebase12.18:onRegistered,onUnregistered,registerandunregister. by @armando-navarro in #3761Setting up (
ng add)ng addgenerates working@angular/fire/aiimports when the AI feature is selected, instead of imports from a removed module path. by @coturiv in #3685provideDataConnect(...)call thatng addgenerates escapes the values it takes from yourdataconnect.yamlandconnector.yaml. A value containing a quote character could previously place arbitrary code in the generated file. by @herdiyana256 in #3727dataconnect.yamlparsing fails, instead of discarding it. by @armando-navarro in #3711Deploying (
ng deploy)ng deployno longer crashes on launch withERR_INVALID_ARG_TYPE. The schematics ship as a CommonJS bundle, which turned the code'simport.metalookup intoundefinedbefore it reached any real work. by @armando-navarro in #3729jsonc-parser,@angular-devkit/core,@angular-devkit/architect). The publishedpackage.jsonnever listed them, song deployfailed to resolve modules under pnpm's default layout and Yarn Plug'n'Play. by @armando-navarro in #3747Server-side rendering
Documentation
ng updatestopping withThe Angular CLI requires a minimum Node.js version of .... by @armando-navarro in #3725, #3788 and #3795APP_CHECK_ON_SERVER, and how to keep App Check out of the server on older releases. by @armando-navarro in #3775ng adddoes today, with current scaffold names, the Firebase Hosting and App Hosting deploy paths, and the prerequisites up front, including npm 11.6 or later, since older npm cannot install a new Angular 21 project (Cannot read properties of null (reading 'edgesOut')). by @armando-navarro in #3736, #3765 and #3787idTokenexample. by @armando-navarro in #3728user$example references the injectedthis.auth. by @arolleaguekeng in #3640@forexample. by @IdanCo in #3606Sample app
New Contributors
Thanks to everyone who tested the release candidates and reported issues. The reports on #3684, #3681 and #3682 are what identified the duplicated-SDK cause, and they are why
ng updatecorrects it for you.Full Changelog: angular/angularfire@20.1.1...21.0.0