Modernize functions/ to Firebase v2 SDK, Node ≥22; remove node-fetch from root lib#60
Merged
Merged
Conversation
33 tasks
Copilot
AI
changed the title
[WIP] Update Firebase Functions to use v2 SDK and modern dependencies
Modernize functions/ to Firebase v2 SDK, Node ≥22; remove node-fetch from root lib
Jul 15, 2026
ernysans
force-pushed
the
copilot/epic-cleanup-firebase-functions
branch
from
July 15, 2026 15:14
57b2485 to
6187c5f
Compare
ernysans
marked this pull request as ready for review
July 15, 2026 15:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The
functions/sub-project was pinned to an EOL stack (Node 16,firebase-admin@^11,firebase-functions@^4, ESLint 8 +eslint-config-google) while the root library had already moved to v2/Node 22. It also relied on a Gen-1 Auth trigger with no direct Gen-2 equivalent, and the root library depended onnode-fetchwith atimeoutoption that is silently ignored onnode-fetch@3.Auth trigger migration
functions.runWith().auth.user().onCreate()trigger with the Gen-2 blocking functionbeforeUserCreated(firebase-functions/v2/identity), dropping the@ts-ignorein favor of an explicit typed cast:@ts-ignoreinactions.tswith typedcatch (error: any)narrowing.functions/dependency & tooling upgradeengines.node→>=22,firebase-admin→^13,firebase-functions→^7,typescript→^6.cors,@google-cloud/functions-framework,firebase-functions-test..eslintrc.json/.eslintignorewith a flateslint.config.jsmirroring the root config; dropped the unmaintainedeslint-config-google/ESLint 8 toolchain.tsconfig.json'smodule/moduleResolutionmismatch and removed unusedexperimentalDecorators,emitDecoratorMetadata,downlevelIteration, and other deprecated compiler options.media/open.ts: a requiredrequestfield was missing from theMedia.Helper.previewcall — now passed through.Root library: drop
node-fetchsrc/api-request.tsandsrc/media.tsnow use nativefetch(Node ≥22) instead ofnode-fetch, replacing the ignoredtimeoutoption withAbortSignal.timeout(60000)and dropping node-fetch-only options (follow,size,agent,compress).node-fetchdependency and updated tests to mock the globalfetch.experimentalDecorators/emitDecoratorMetadatafrom the roottsconfig.json.Docs
README.MD/functions/README.MDto reflect the new Node/SDK versions and the v1→v2 trigger change.Out of scope
strictNullChecks/noImplicitAnyre-enablement was not attempted — it surfaces ~30 unrelated null-safety diagnostics acrossuser.ts,media.ts,global.ts, etc., and warrants a dedicated follow-up.expressstays at^4infunctions/; bumping to^5changes wildcard route matching (/media/**) and needs its own review.@types/expresswas aligned to^5(dev-only) to match the compiled root library types.