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

feat(firebase): use nodejs 18 as default runtime #925

Merged
merged 3 commits into from
Feb 8, 2023
Merged

feat(firebase): use nodejs 18 as default runtime #925

merged 3 commits into from
Feb 8, 2023

Conversation

luc122c
Copy link
Contributor

@luc122c luc122c commented Feb 7, 2023

πŸ”— Linked issue

Fixes #924

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Node 18 is the current LTS version. It is the recommended cloud function runtime and is a prerequisite for Nuxt 3. This PR changes the default runtime from 14 to 18, and falls back to an older version if it is specified in the engines field in package.json.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

let nodeVersion = "14";
let nodeVersion = "18";
const supportedNodeVersions = ["18", "16", "14", "12", "10"];
// ^ See https://cloud.google.com/functions/docs/concepts/nodejs-runtime
try {
const currentNodeVersion = JSON.parse(
await readFile(join(nitro.options.rootDir, "package.json"), "utf8")
).engines.node;
Copy link
Member

Choose a reason for hiding this comment

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

Related: engines.node could be like 18 || 14 too. We might parse it as array and choose first matching version.

Copy link
Member

Choose a reason for hiding this comment

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

Could be in later PR..

@pi0 pi0 changed the title fix(preset:firebase): Use nodejs18 as default runtime. Fallback to other supported versions. feat(firebase): use nodejs 18 as default runtime Feb 8, 2023
@pi0 pi0 merged commit 4f08e5d into unjs:main Feb 8, 2023
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.

Firebase preset defaults to Node 14
2 participants