Skip to content

Update mockConfig function for v4 firebase-functions #173

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

Merged
merged 3 commits into from
Oct 14, 2022

Conversation

taeold
Copy link
Contributor

@taeold taeold commented Oct 13, 2022

V4 Functions SDK does not expose the config singleton directly.

Use the internal-only resetCache function instead.

In v4 SDK, we don't expose config singleton directly.
In v4 SDK, we don't expose config singleton directly.
Copy link
Member

@inlined inlined left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verify this works. I thought resetCache was @internal, which is stripped. We should mark it hidden instead.

@taeold taeold requested a review from blidd-google October 13, 2022 21:41
@taeold
Copy link
Contributor Author

taeold commented Oct 14, 2022

@inlined stripInternal compiler option doesn't remove the javascript code:

https://www.typescriptlang.org/tsconfig#stripInternal

It is still available for use. I did have to make tsc happy by using @ts-ignore.

Proof:

$ node
> require("firebase-functions").resetCache
[Function: resetCache]

@taeold
Copy link
Contributor Author

taeold commented Oct 14, 2022

Tests are broken because v4 sdk isn't available yet. This will be fixed in future PR where I pull in release candidate version as the dev dependency.

@taeold taeold merged commit d958110 into launch.next Oct 14, 2022
@taeold taeold deleted the dl-ff-sdk-v4-config branch October 14, 2022 17:14
taeold added a commit that referenced this pull request Oct 14, 2022
* Update mockConfig function for v4 firebase-functions (#173)

V4 Functions SDK does not expose the config singleton directly.

Use the internal-only `resetCache` function instead.

* Fix Firebase Functions v4 compatibility issues. (#175)

1. Replace all use of __trigger annotation to __endpoint

2. Correct import path for Expression class/type

* BREAKING: Drop support for Firebase Functions SDK v3 and below - take 2 (#178)

We also pin down peer dep requirement for firebase-admin to peer dependencies required for v4 firebase-functions sdk.

* Bump firebase functions sdk version to v4 release candidate. (#179)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants