Skip to content
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

Change default entrypoint of the firebase-functions package to v2 instead of v1 #1594

Merged
merged 10 commits into from
Sep 5, 2024

Conversation

taeold
Copy link
Contributor

@taeold taeold commented Aug 16, 2024

On the same note of gcloud functions commands defaulting to 2nd Gen functions, Firebase Functions SDK will change default entrypoint of the SDK to point to the v2 namespace in the next major release.

Before:

const functions = require('firebase-functions');

// This is a v1 callable function
exports.v1 = functions.https.onCall((data, context) => {
  // ...
});

After:

const functions = require('firebase-functions');

// This is a v2 callable function
exports.v2 = functions.https.onCall((req) => {
  // ...
});

// Preferred style 
const { onCall } = require('firebase-functions/https');

// This is a v2 callable function
exports.v2 = onCall((req) => {
  // ...
});

@taeold taeold marked this pull request as ready for review September 3, 2024 22:59
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.

Way more files changed than I expected. Thanks!

package.json Show resolved Hide resolved
@taeold taeold added this pull request to the merge queue Sep 5, 2024
Merged via the queue into master with commit d65d35f Sep 5, 2024
13 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.

2 participants