Skip to content

Conversation

morganchen12
Copy link
Contributor

No description provided.

@morganchen12 morganchen12 requested a review from jhuleatt August 1, 2025 20:21
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.

I would revert all the "/v2" sort of migrations--this codebase is already on V2 which has been the default for a while.

As a design pattern I might make a params/config namespace where you've exported all your params (they're immutable, so you should be OK providing direct const access). Then when you're initializing globals, you should do so in an onInit callback, during which params can be safely accessed.

const emailDebug = params.defineBoolean("EMAIL_DEBUG");
const emailGroup = params.defineString("EMAIL_GROUP");

export function getGitHubToken(): string {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of these helpers? Is this a common enough need that we should take feedback for the Functions SDK?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just wanted them to be named so I didn't have to call params.defineString(string) everywhere. Some of these are used only once so I'm not really saving any work in those cases.

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