Skip to content

workspaces: add Node.js 22 to engines field across all workspaces #3562

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

Merged
merged 3 commits into from
Apr 17, 2025

Conversation

BethGriggs
Copy link
Collaborator

@BethGriggs BethGriggs commented Apr 9, 2025

Hey, I just made a Pull Request!

Manually updates the "engines" field of all workspace package.json files
to include Node.js 22. This intentionally replaces part of the generated
rennovate PR which attempted to replace rather than add Node.js 22 to the
engines field.

Note that this is only updates the workspace package.json - therefore it
should not impact end users installing plugins.

Refs: #2403

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • All your commits have a Signed-off-by line in the message. (more info)

@BethGriggs
Copy link
Collaborator Author

Most of the failures look to be related to failed canvas builds.

@schultzp2020
Copy link
Contributor

schultzp2020 commented Apr 9, 2025

Should we remove node 18 from the "engines" field because its end of life is on April 30th? Personally I'm in favor of it.

@BethGriggs
Copy link
Collaborator Author

BethGriggs commented Apr 9, 2025

@schultzp2020, see our discussion on https://github.com/backstage/community-plugins/pull/2403/files#r2034107459.

IMO the engines fields should be communication from the workspace/plugin owner about compatibility rather than a blanket change applied across the repository.

I strongly think we should leave it to workspace/plugin owners to decide. Dropping a version from engines can be breaking change if anyone is installing with enginesStrict:true. This was the rationale for this additive approach.

@schultzp2020
Copy link
Contributor

@schultzp2020, see our discussion on https://github.com/backstage/community-plugins/pull/2403/files#r2034107459.

IMO the engines fields should be communication from the workspace/plugin owner about compatibility rather than a blanket change applied across the repository.

I strongly think we should leave it to workspace/plugin owners to decide. Dropping a version from engines can be breaking change if anyone is installing with enginesStrict:true. This was the rationale for this additive approach.

@BethGriggs Adopters are likely to face issues regardless, since backstage/backstage enforces stricter versioning with 20 | 22. In my opinion, it's best to follow the core repository’s lead, straying from it will only make long-term maintenance more difficult. We’re going to encounter the same challenges when React 17 and React Router 6 are deprecated. In fact, we’re already seeing this with React 16, as most workspaces haven’t deprecated it yet, even though the core repository dropped support two releases ago. At some point the community plugin maintainers need to step in and overrule when it comes to deprecated/end of life features.

@BethGriggs
Copy link
Collaborator Author

Plugin consumers may still be using earlier versions of Backstage, though.

At the very least I think we should hold off on forced removal of Node.js 18 from within the workspaces until it is officially EOL at the end of the month. Simultaneously we can open an issue to socialise so workspace owners have time to consider impact on their consumers and migrate anything if necessary.

@BethGriggs
Copy link
Collaborator Author

Adopting canvas@v3 should fix the failures across all those workspaces. The only breaking change in v3 appears to be dropping support for Node.js 16 so it should be safe to adopt in all workspaces.

I tried triggering the update via #392 but it hasn't been generated yet.

@BethGriggs
Copy link
Collaborator Author

Requires #3563 for CI to pass on workspaces failing with canvas build issues.

@awanlin
Copy link
Contributor

awanlin commented Apr 9, 2025

Hi @BethGriggs, do we need Canvas anymore? backstage/backstage#27287. This was released in 1.33.0. Sorry, have not looked at the exact code in this repo yet.

@BethGriggs
Copy link
Collaborator Author

@awanlin I'd be quite happy if that's the case, but I think I saw some direct usage. I'll take a closer look and see.

@BethGriggs
Copy link
Collaborator Author

It does looks like only one or two plugins actually use it, I'll work on a PR to remove it where we can as it's also already listed in some of the knip reports.

Copy link
Contributor

@awanlin awanlin left a comment

Choose a reason for hiding this comment

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

Thanks for running with this @BethGriggs, was the next on my pile once we got all the backend-common usages removed. Left a few comments.

Once thing I had been thinking about this is that it would be great to have a codemod for this as we'll need to do this each year.

- Update GitHub Actions CI matrix to test against Node.js 20 and 22 to
match the versions supported by Backstage.
- Update package.json "engines" field to reflect support Node.js 20 and 22.
Note that this only updates the repository root package.json as a way of
communicating the supported Node.js versions.

Signed-off-by: Beth Griggs <bethanyngriggs@gmail.com>
@BethGriggs BethGriggs force-pushed the node-22-with-workspace-updates branch from 3fc8cf1 to 7dcb0ea Compare April 15, 2025 17:24
Copy link
Contributor

@awanlin awanlin left a comment

Choose a reason for hiding this comment

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

Awesome, thanks @BethGriggs 🚀

@awanlin
Copy link
Contributor

awanlin commented Apr 15, 2025

Shoot, I really need to remember to check the CI before approving. This CI error looks like it will be a fun one 🤔

@BethGriggs BethGriggs force-pushed the node-22-with-workspace-updates branch from 7dcb0ea to 6415a8f Compare April 15, 2025 18:28
@BethGriggs
Copy link
Collaborator Author

I reverted the Kiali change as it was already set to 22 in the engines. CI on this PR is passing now.

Copy link
Member

@04kash 04kash left a comment

Choose a reason for hiding this comment

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

I think we should also update the package.json template in repo-tools so that newly created workspaces have Node.js 22 in their engine fields

Manually updates the "engines" field of all workspace package.json files
to include Node.js 22. This intentionally replaces part of the generated
rennovate PR which attempted to globally replace rather than add Node.js
22 to the engines field.

For both community-plugins-maintainers and sda-se-reviewers owned
workspaces Node.js 18 is removed.

Note that this is only updates the workspace package.json - therefore it
should not impact end users installing plugins.

Refs: backstage#2403
Signed-off-by: Beth Griggs <bethanyngriggs@gmail.com>
Signed-off-by: Beth Griggs <bethanyngriggs@gmail.com>
@BethGriggs BethGriggs force-pushed the node-22-with-workspace-updates branch from 15b052a to 57e9a1a Compare April 16, 2025 20:21
@backstage-goalie
Copy link
Contributor

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage-community/cli workspaces/repo-tools/packages/cli none v0.0.3

Copy link
Member

@04kash 04kash left a comment

Choose a reason for hiding this comment

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

lgtm!

@BethGriggs BethGriggs merged commit 4de253f into backstage:main Apr 17, 2025
281 checks passed
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.

7 participants