Skip to content

Conversation

@jhuleatt
Copy link
Collaborator

@jhuleatt jhuleatt commented Nov 5, 2025

Update to firebase-functions v7. The big breaking change is the full deprecation of functions.config(), which affects a lot of 1st gen samples. They've been migrated to params following the 1st gen guide.

@jhuleatt jhuleatt requested a review from taeold November 5, 2025 15:44
taeold added a commit to firebase/firebase-functions that referenced this pull request Nov 5, 2025
We restore 'typesVersions' in package.json to support TypeScript projects using 'moduleResolution: node'.

This legacy resolution mode ignores the 'exports' field, causing compilation errors when importing subpaths like 'firebase-functions/https'. Restoring 'typesVersions' ensures compatibility for users who haven't migrated to 'node16' or 'nodenext' resolution.

Unblocks firebase/functions-samples#1227.
taeold added a commit to firebase/firebase-functions that referenced this pull request Nov 5, 2025
We restore 'typesVersions' in package.json to support TypeScript projects using 'moduleResolution: node'.

This legacy resolution mode ignores the 'exports' field, causing compilation errors when importing subpaths like 'firebase-functions/https'. Restoring 'typesVersions' ensures compatibility for users who haven't migrated to 'node16' or 'nodenext' resolution.

Unblocks firebase/functions-samples#1227.
taeold added a commit to firebase/firebase-functions that referenced this pull request Nov 5, 2025
We restore 'typesVersions' in package.json to support TypeScript projects using 'moduleResolution: node'.

This legacy resolution mode ignores the 'exports' field, causing compilation errors when importing subpaths like 'firebase-functions/https'. Restoring 'typesVersions' ensures compatibility for users who haven't migrated to 'node16' or 'nodenext' resolution.

Unblocks firebase/functions-samples#1227.
github-merge-queue bot pushed a commit to firebase/firebase-functions that referenced this pull request Nov 5, 2025
We restore 'typesVersions' in package.json to support TypeScript projects using 'moduleResolution: node'.

This legacy resolution mode ignores the 'exports' field, causing compilation errors when importing subpaths like 'firebase-functions/https'. Restoring 'typesVersions' ensures compatibility for users who haven't migrated to 'node16' or 'nodenext' resolution.

Unblocks firebase/functions-samples#1227.
@jhuleatt
Copy link
Collaborator Author

#1229 is in-progress to migrate to params from functions.config in 1st-gen samples

…1229)

* feat: Migrate Node-1st-gen samples from functions.config to params

Migrates all Cloud Functions for Firebase samples in the Node-1st-gen folder that use the functions.config API to the new params API.

This includes:
- Replacing `functions.config()` with `defineString` for non-sensitive data and `defineSecret` for sensitive data.
- Updating function definitions with `runWith({secrets: [...]})` where necessary.
- Moving API client initializations from the global scope into function handlers to ensure that parameter values are available at runtime.
- Updating all relevant README.md files and code comments to reflect the new configuration methods.

* feat(Node-1st-gen): Migrate functions.config to params

Migrates all 1st-gen Node.js samples from the deprecated functions.config API to the new params API.

- Updates all instances of functions.config() to use defineString() or defineSecret().
- Moves client initializations that depend on params into the function bodies.
- Updates variable names to lowerCamelCase to follow the recommended style.
- Updates all relevant README.md files to reflect the new configuration method using .env files and firebase functions:secrets:set.
- Verifies that all 1st-gen samples compile successfully after the changes.

* feat(Node-1st-gen): Migrate functions.config to params

Migrates all 1st-gen Node.js samples from the deprecated functions.config API to the new params API.

- Updates all instances of functions.config() to use defineString() or defineSecret().
- Moves client initializations that depend on params into the function bodies.
- Updates variable names to lowerCamelCase to follow the recommended style.
- Updates all relevant README.md files to reflect the new configuration method using .env files and firebase functions:secrets:set.
- Verifies that all 1st-gen samples compile successfully after the changes.
- Corrects the `runWith` secrets configuration to pass the secret objects directly.
- Refactors all client initializations to use the `onInit` hook.
- Fixes the `google-sheet-sync` trigger.
- Fixes inconsistent naming in `okta-auth` and `testlab-to-slack`.
- Fixes inefficient `cors` initialization in `okta-auth`.

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@jhuleatt jhuleatt changed the title Use the test build of functions v7 Migrate all samples to firebase-functions v7 Nov 12, 2025
@jhuleatt jhuleatt merged commit a6ae4cb into main Nov 12, 2025
7 checks passed
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.

1 participant