Skip to content

feat(functions): Support Nodejs 26 runtimes in beta - #11411

Closed
wandamora wants to merge 1 commit into
mainfrom
add_nodejs26_runtime
Closed

wandamora wants to merge 1 commit into
mainfrom
add_nodejs26_runtime

Conversation

@wandamora

Copy link
Copy Markdown
Contributor

This also makes sure to prioritize the latest GA runtime over beta (preview) or experimental ones, and adds a warning for when users are using non-GA runtimes.

This also makes sure to prioritize the latest GA runtime over beta
(preview) or experimental ones, and adds a warning for when users are
using non-GA runtimes.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for the nodejs26 (in preview) runtime for Cloud Functions. It updates the runtime selection logic to prefer GA runtimes over preview/experimental runtimes, and adds warnings when preview or experimental runtimes are used. Feedback was provided to improve the maintainability of the runtime status guard check by destructuring the friendly property and combining the beta and experimental status checks to reduce duplication.

Comment on lines +67 to +79
const { deprecationDate, decommissionDate, status } = RUNTIMES[runtime];

if (status === "beta") {
utils.logLabeledWarning(
"functions",
`Runtime ${RUNTIMES[runtime].friendly} is in Preview. Pre-release runtimes may not be suitable for production workloads.`,
);
} else if (status === "experimental") {
utils.logLabeledWarning(
"functions",
`Runtime ${RUNTIMES[runtime].friendly} is experimental. Pre-release runtimes may not be suitable for production workloads.`,
);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

We can improve the maintainability and readability of this guard check by destructuring the friendly property from RUNTIMES[runtime] alongside the other properties. Additionally, we can combine the beta and experimental status checks to reduce duplication of the warning message string.

  const { friendly, deprecationDate, decommissionDate, status } = RUNTIMES[runtime];

  if (status === "beta" || status === "experimental") {
    const label = status === "beta" ? "is in Preview" : "is experimental";
    utils.logLabeledWarning(
      "functions",
      `Runtime ${friendly} ${label}. Pre-release runtimes may not be suitable for production workloads.`,
    );
  }
References
  1. Reduce nesting and simplify branching where possible to keep code clean and maintainable. (link)

@wandamora wandamora closed this Nov 2, 2026
@wandamora
wandamora deleted the add_nodejs26_runtime branch November 2, 2026 20:30
@wandamora

Copy link
Copy Markdown
Contributor Author

Missed that invertase has a similar PR out: #11397

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