Conversation
There was a problem hiding this comment.
Pull request overview
Upgrades @zajno/common-firebase server-side Firebase Functions helpers from firebase-functions/v1 APIs to firebase-functions/v2, restructuring the low-level “create” helpers into provider-specific modules and updating types/docs/tests accordingly.
Changes:
- Migrated HTTPS callable/request, scheduler, and Pub/Sub helper factories to Firebase Functions v2 APIs.
- Refactored
create.tsintocreate/modules (https,scheduler,pubsub, shared helpers) and updated imports/exports. - Updated runtime settings/types/docs/tests to match v2 (e.g.,
memory: 'MiB', callable request typing).
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/common-firebase/src/server/pubsub/index.ts | Updates Pub/Sub function typing/imports for v2 and redirects to new pubsub create module. |
| packages/common-firebase/src/server/functions/middleware.ts | Replaces boolean chain lock with active-executions counter to prevent mutation during concurrent runs. |
| packages/common-firebase/src/server/functions/loader.ts | Switches to v2 HTTPS types and new create module imports; updates async wrapper signatures. |
| packages/common-firebase/src/server/functions/interface.ts | Updates callable context types for v2 and tightens some typings (unknown, Record<string, any>). |
| packages/common-firebase/src/server/functions/index.ts | Re-exports the new create/ barrel. |
| packages/common-firebase/src/server/functions/globalSettings.ts | Updates default memory unit to MiB. |
| packages/common-firebase/src/server/functions/factory.ts | Updates import to v2 HTTPS create helper location. |
| packages/common-firebase/src/server/functions/create/scheduler.ts | Adds v2 scheduler factory via onSchedule. |
| packages/common-firebase/src/server/functions/create/pubsub.ts | Adds v2 Pub/Sub topic listener factory via onMessagePublished. |
| packages/common-firebase/src/server/functions/create/index.ts | Adds barrel exports for provider-specific create modules. |
| packages/common-firebase/src/server/functions/create/https.ts | Adds v2 HTTPS callable/request factories (onCall, onRequest). |
| packages/common-firebase/src/server/functions/create/helpers.ts | Adds option-merging helpers and FilterRequestMethod middleware in new location. |
| packages/common-firebase/src/server/functions/create.ts | Removes old v1 “create” module (replaced by create/ folder). |
| packages/common-firebase/src/functions/interface.ts | Migrates EndpointSettings to v2 GlobalOptions subset. |
| packages/common-firebase/src/tests/functions/config.ts | Updates callable test wrapper to v2 callable request shape. |
| packages/common-firebase/package.json | Bumps package version, updates deps, and adds an exports entry for ./server/functions/create. |
| packages/common-firebase/docs/functions.md | Updates docs for v2 memory units and new create/ module layout. |
| packages/common-firebase/README.md | Updates README wording to reflect v2 functions. |
| package-lock.json | Updates lockfile for dependency upgrades. |
Comments suppressed due to low confidence (1)
packages/common-firebase/src/server/functions/loader.ts:77
createAsyncHttpsRequestFunctionacceptsHttpsOptions, but it forwardsoptionsintocreateHttpsRequestFunction, whose public signature only acceptsEndpointSettings. This creates an inconsistent API surface (and hides which options are actually supported). Consider either (a) changingcreateAsyncHttpsRequestFunctionto acceptEndpointSettingsfor consistency, or (b) wideningcreateHttpsRequestFunction(and itsmergeOptions) to acceptHttpsOptionsso both paths support the same configuration (e.g.,cors,invoker).
export function createAsyncHttpsRequestFunction<TRes = any>(workerLoader: () => Promise<RequestEndpointFunction<TRes>>, options: HttpsOptions | null = null): HttpsFunction {
return createHttpsRequestFunction(
wrapRequestFunction(workerLoader),
options,
);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.