-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to Angular 16, TypeScript 5, and latest Firebase SDK #3402
Conversation
…into de-ts5-build
It is done! Can someone use the canary build and let me know how it's working for them?
|
On it. |
Haven't checked every app of ours yet but it seems to be working! builds pass, app loads with authentication working. Tried with the webpack and esbuild builder. |
doesn't have the correct firebase dependency from what I can see... rxfire has ^10.0.0 as peer and @angular/fire has ^9.8.0 as dep, giving a warning for incorrect peer dependency... Other than that it seems to be working fine, I already used an override to use the latest firebase package, and used that on the canary build as well... |
@atsjo Thank you for picking that up! I'll need to put a range in there for AngularFire but that should be an easy enough fix. |
It doesn't seem to zonewrap getCountFromServer firestore function from what I can see either, not sure if zonewrapping new functions should be part of this release... I don't use the rxfire wrappers, I just want the zonewrapped functions from the firebase sdk... |
My mistake. I only added the observable wrappers on this release but I can also add |
@@ -1,7 +1,7 @@ | |||
import { SchematicsException, Tree } from '@angular-devkit/schematics'; | |||
import { setupProject } from '@angular/fire/schematics/setup'; | |||
// import { setupProject } from '@angular/fire/schematics/setup'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you forget this comment
@@ -47,7 +47,8 @@ ncp(pathToTestSrcFolder, pathToTestFolder, () => { | |||
} | |||
}); | |||
})) | |||
.catch(_ => { | |||
.catch(error => { | |||
console.log(error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't it be console.error
@@ -6,6 +6,8 @@ | |||
"outDir": "tools", | |||
"skipLibCheck": true, | |||
"lib": ["es2019"], | |||
"module": "commonjs", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why commonjs?
@@ -1,11 +1,11 @@ | |||
import firebase from 'firebase/compat/app'; | |||
import { Observable, Subject } from 'rxjs'; | |||
import { Observable, Subject, forkJoin, merge, tap } from 'rxjs'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forkJoin, merge, tap
aren't used, should be removed
I can work on eslint, I have experience on it, but won't work on it unless I have green light so I don't waste time on it while it won't be merged |
I can work on eslint, I have experience on it, but won't work on it unless I have green light so I don't waste time on it while it won't be merged I'd use eslint flat configuration with |
I get an error when trying to use: firebase.firestore.FieldValue.serverTimestamp(); TypeError: Cannot read properties of undefined (reading 'FieldValue') and firebase.analytics().logEvent Error logEvent firebase TypeError: firebase_compat_app__WEBPACK_IMPORTED_MODULE_1__.default.analytics is not a function Errors goes away if I downgrade to v9. Using compact mode, if that is relevant (should still be supported right?). |
This would be amazing! If you get a PR going I'll get it merged. |
works perfectly for me |
Testing the
|
I npm install these: I get these compilation errors: Error: src/app/services/user.service.ts:30:29 - error TS2345: Argument of type 'import(".../node_modules/@angular/fire/auth/auth").Auth' is not assignable to parameter of type 'import(".../node_modules/@firebase/auth/dist/auth-public").Auth'.
node_modules/@firebase/auth/dist/auth-public.d.ts:397:5 The odd thing is: if roll back firebase to version 10.0.0 instead of 10.3.1 then compilation errors disappear and app works. I don't have a repo to share unfortunately. It could be a code problem of course, but I wanted to let you know in case it means anything to your efforts. Thanks for working on this upgrade. ================= Update/edit: Thanks again for your efforts on this upgrade. |
I have the same issue as @JakobMadsen717 |
The version range change 5793d6f had no effect on the build output... I tested 16.0.0-canary.5793d6f, and it seems to still have |
changing the firebase dep in https://github.com/angular/angularfire/blob/master/src/package.json to |
|
rxfire 6.0.5 produces typing error: Error: node_modules/rxfire/firestore/lite/interfaces.d.ts:8:29 - error TS2314: Generic type 'AggregateQuerySnapshot<T>' requires 1 type argument(s).
8 export type CountSnapshot = lite.AggregateQuerySnapshot<{
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9 count: lite.AggregateField<number>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 }, any, DocumentData>;
~~~~~~~~~~~~~~~~~~~~~ |
@anisabboud This is how I was able to resolve that issue: |
👀 |
16.0.0-rc.0 seems to be working fine here and fixed the issues I mentioned. |
Note: This PR is not ready for testing yet but as we progress we'll provide instructions to get proper testing and feedback.
What is this?
This PR aims to update AngularFire to full compatibility with Angular 16 and the latest Firebase features. However, this requires a jump to TypeScript 5 which requires a refactoring of our build system.
This will likely require a major version bump and as we will detail soon we are looking to match versions with Angular. Therefore the next AngularFire version could jump from 7 to 16. We'll have an open discussion in the near future but please let us know your thoughts.
Addresses
#3320, #3347
Todo