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

Add support for Node.js version 22 #1779

Merged
merged 1 commit into from
Jun 17, 2024
Merged

Add support for Node.js version 22 #1779

merged 1 commit into from
Jun 17, 2024

Conversation

corneliusroemer
Copy link
Member

@corneliusroemer corneliusroemer commented Jun 5, 2024

v22 is the current version, with scheduled end-of-life 2027-04-30¹.

The associated npm version (as of node v22.2.0) is npm v10 (v.10.7.0 for v22.2.0)².

¹ https://github.com/nodejs/release#release-schedule
² https://nodejs.org/dist/index.json

Commit adapted from #1673

Checklist

@nextstrain-bot nextstrain-bot temporarily deployed to auspice-node-22-ecw9o2xzm1fx9o June 5, 2024 14:21 Inactive
@nextstrain-bot nextstrain-bot temporarily deployed to auspice-node-22-ecw9o2xzm1fx9o June 5, 2024 14:24 Inactive
@nextstrain-bot nextstrain-bot temporarily deployed to auspice-node-22-ecw9o2xzm1fx9o June 5, 2024 14:26 Inactive
@jameshadfield
Copy link
Member

I don't use nvm but the team recently discussed (slack) and implemented such a file for nextstrain.org. Because I don't use it it'll invariably fall out of sync, but those who do use it will hopefully keep it updated. Are you using it, or was this added in an attempt to appease CI?

Node 22 isn't available on conda, so I haven't tested it, but have you tested it out locally and it's working for you?

@corneliusroemer
Copy link
Member Author

corneliusroemer commented Jun 6, 2024 via email

.nvmrc Outdated
Copy link
Member

@victorlin victorlin Jun 6, 2024

Choose a reason for hiding this comment

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

We can use the .nvmrc as single source of truth for CI versions of node as well

How would this work if CI needs to test a matrix but only one version is set in this file?

The single source of truth should be package.json, since that's what npm checks when running scripts.

"node": "^16 || ^18 || ^20 || ^22",

Ideally we use this to define the matrix in CI, but I don't think there's a way (at least not straightforward).

.nvmrc Outdated
@@ -0,0 +1 @@
20
Copy link
Member

@victorlin victorlin Jun 6, 2024

Choose a reason for hiding this comment

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

The addition of .nvmrc made sense for nextstrain.org since we only support a single version of Node.js there, and .nvmrc serves to define that single version for devs who use nvm. However, Auspice supports a range of Node.js versions so there's no reason to constrain to a single version. I would remove this file.

Comment on lines 135 to 137
- run: gh workflow run ci.yml --repo nextstrain/docker-base
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_NEXTSTRAIN_BOT_WORKFLOW_DISPATCH }}
- run: gh workflow run ci.yml --repo nextstrain/docker-base
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_NEXTSTRAIN_BOT_WORKFLOW_DISPATCH }}
Copy link
Member

Choose a reason for hiding this comment

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

These unrelated formatting changes should not be part of this commit.

v22 is the current version, with scheduled end-of-life 2027-04-30¹.

The associated npm version (as of node v22.2.0) is npm v10 (v.10.7.0 for v22.2.0)².

¹ https://github.com/nodejs/release#release-schedule
² https://nodejs.org/dist/index.json
@jameshadfield
Copy link
Member

I fixed up some unrelated changes introduced here and removed the .nvmrc (you're welcome to submit another PR with this change; while I don't use it I'm happy to have it in the codebase if it improves the developer experience for others).

Our CI is passing, including the build-docs step. Read the docs' automated build is failing, which is also seen on other PRs, but I don't think it's related to these changes. Merging.

@jameshadfield jameshadfield merged commit 124f875 into master Jun 17, 2024
25 of 26 checks passed
@jameshadfield jameshadfield deleted the node-22 branch June 17, 2024 03:09
Copy link
Member

@victorlin victorlin left a comment

Choose a reason for hiding this comment

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

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.

5 participants