Migrate Firebase Functions to V2 API and Update Dependencies #98
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Change Summary
What is this?
This change modernizes our Firebase Functions implementation by upgrading to the V2 API. We're also updating our dependencies to their latest stable versions to ensure we're using the most secure and feature-rich versions available.
This comes as a response to users wanting to migrate to the V2 API to make use of all the new features that it provides.
Changes
Code Changes:
In
functions/src/indexOnWrite.js
:functions.firestore.document().onWrite()
toonDocumentWritten()
V2 APIfunctions.logger
with granular imports fromfirebase-functions/logger
In
functions/src/backfill.js
:onDocumentWritten
syntaxinfo
,error
) fromfirebase-functions/logger
In
functions/src/index.js
:dotenv
configuration for better environment variable managementDependency Updates:
Major Version Updates:
firebase-admin
:12.2.0
→13.0.1
firebase-functions
:5.0.1
→6.1.1
Added Dependencies:
dotenv
:^16.4.7
for improved environment variable handlingRemoved Dependencies:
firebase-functions-test
: Removed as it's not needed in the current test setupThis update maintains all existing functionality while modernizing the codebase.
PR Checklist