-
Notifications
You must be signed in to change notification settings - Fork 204
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
Rework apps, update admin, remove lodash #1144
Conversation
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.
Couple leftover comments
src/common/app.ts
Outdated
import { | ||
App, | ||
applicationDefault, | ||
// getApp as getAppNamed, |
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.
remove this comment
src/common/app.ts
Outdated
export function getApp(): App { | ||
// if (typeof cache === 'undefined') { | ||
// cache = getAppNamed(/* default */); | ||
// } |
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.
remove these comments
@@ -55,6 +52,8 @@ export { | |||
logger, | |||
}; | |||
|
|||
export const app = { setEmulatedAdminApp }; |
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.
sigh I wish I knew why this function is needed for the emulator to work.
(I have a theory that this is just a historical artifact before admin sdk natively supported the emulator)
* N.B. For clarity for use in testing this name has no mention of emulation, but | ||
* it must be exported from index as app.setEmulatedAdminApp or we break the emulator. | ||
* We can remove this export when: | ||
* A) We complete the new emulator and no longer depend on monkeypatching |
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.
actively researching this. I think recent versions of the admin sdk doesn't rely on this monkey patching, and I'll try to confirm/deny this.
@colerogers You left this with a change request. Does uncommenting those lines fix everything? |
This change involved a number of small things that kinda got smushed together. Sorry.
before
andafter
inmakeCloudFunction
. Importantly, we will now share the default app if it already exists when we need it. This should help consolidate network connections/caches. OTOH, it could lead to subtle bugs. Push back if you think this optimization is too dangerous.launch.next
already, I switched over to the v10 syntax so that we load fewer files on demand.