Skip to content

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!

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