-
Notifications
You must be signed in to change notification settings - Fork 937
modular autoinit #6526
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
modular autoinit #6526
Conversation
🦋 Changeset detectedLatest commit: 87c03a4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 29 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Size Report 1Affected Products
Test Logs |
Size Analysis Report 1This report is too large (1,423,165 characters) to be displayed here in a GitHub comment. Please use the below link to see the full report on Google Cloud Storage.Test Logs |
FYI @hsubox76 Need to clean up but here's a first pass on an implementation. Any initial thoughts? We've started bashing on it go/web-frameworks-bug-bash-init-exp |
* Addressed Angular not working, `defaultProject` is gone in new projects now * Added more error logging to the Angular codepath * `npm run dev` wasn't patching the globally installed CLI * Bumped version * Migrating to ESM * Adding nuxt & nuxt3 to Github Actions * Bumping deps * Fix dynamic import paths in Windows with pathToFileURL * Adding Windows tests to Actions * Marked as compatible with Node 16, 18. * Dropped Node 14 from Actions * Pack filesystem NPM overrides * Console log NPM install * Integrate with [firebase-js-sdk#6526](firebase/firebase-js-sdk#6526) and [firebase-tools##4868](firebase/firebase-tools#4868) * Next broke, `next export` no longer fails for fallbacks and api routes, detect these to determine if a Cloud Function should be spun up * Fixed relative directory handling * Silenced next export failures by spawning * Rearranged framework detection order so custom servers are first * Error if it could not determine the framework * Next minimal mode
import { Auth, User } from '../model/public_types'; | ||
import { getDefaultEmulatorHost, getExperimentalSetting } from '@firebase/util'; | ||
|
||
const ID_TOKEN_MAX_AGE = 5 * 60; |
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.
should put this into the configuration object
e09043c
to
233cc69
Compare
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.
LGTM with respect to changes in firestore/, app/, and util/.
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.
LGTM
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.
Approval for auth, but see comments inline
common/api-review/util.api.md
Outdated
@@ -195,6 +195,23 @@ export class FirebaseError extends Error { | |||
// @public | |||
export type FirebaseSignInProvider = 'custom' | 'email' | 'password' | 'phone' | 'anonymous' | 'google.com' | 'facebook.com' | 'github.com' | 'twitter.com' | 'microsoft.com' | 'apple.com'; | |||
|
|||
// Warning: (ae-missing-release-tag) "getDefaultAppConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) |
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.
Please address these warnings
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.
Added @public
flag and added more comments to everything in defaults.ts
.
if (authTokenSyncUrl) { | ||
const mintCookie = mintCookieFactory(authTokenSyncUrl); | ||
beforeAuthStateChanged(auth, mintCookie, () => { | ||
void mintCookie(auth.currentUser); |
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 is the Promise ignored? Please add a comment.
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.
Looks like I fixed an eslint error the wrong way. beforeAuthStateChanged
does seem to await its callbacks so returned the promise instead.
@@ -132,6 +140,12 @@ export function initializeApp( | |||
}); | |||
} | |||
|
|||
options ||= getDefaultAppConfig(); |
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.
First time seeing this syntax. Thank you for the education
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_OR_assignment
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.
That was James, heh.
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.
👍 Just mind that it overrides all falsy values—false, 0, "", null, undefined, NaN, etc. This can be surprise folk, especially with ints.
You can use the nullish form, ??=
if you only want to override null & undefined.
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.
LGTM
PoC of go/firebase-api-client-autoinit