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

What is the minimum Node version supported by GOV.UK Frontend v5? #4353

Closed
paulrobertlloyd opened this issue Oct 18, 2023 · 2 comments
Closed
Labels
awaiting triage Needs triaging by team 🐛 bug Something isn't working the way it should (including incorrect wording in documentation)

Comments

@paulrobertlloyd
Copy link
Contributor

The package.json for govuk-frontend suggests it is v4.2.0:

This seems unlikely at the best of times given the wondrous world of dependencies in Node, but my suspicion that this is incorrect was further heightened when I spotted that rollup v4.1.4 is listed as a dependency, and that only supports Node versions greater than 18.

Does the engines.node value in package.json need to be updated, and is v18 (moving to maintenance in the coming days) the correct minimum supported version?

@paulrobertlloyd paulrobertlloyd added awaiting triage Needs triaging by team 🐛 bug Something isn't working the way it should (including incorrect wording in documentation) labels Oct 18, 2023
@colinrotherham
Copy link
Contributor

Morning @paulrobertlloyd

This came up recently in 60174e1 as we're aware that some shipped features need:

  • Node.js v12.16.0 for conditional package exports
  • Node.js v12.17.0 for ES modules as *.mjs
  • Node.js v12.17.0 for subpath package exports
  • Node.js v12.20.0 for wildcard package exports

But during code review we discussed it further and decided a Node.js restriction wasn't necessary (yet)

Recommendations

That said, we've shipped package entry points since GOV.UK Frontend v4.1.0 and fixed "subpath export" snags for both Node.js and tools following Node.js package resolution rules—but these are optional features

Node.js v4.2.0 users could still use our Rollup UMD bundles (CommonJS compatible) so we currently recommend:

If you have not already installed version 4.2.0 or later of Node.js, install the latest Long Term Support (LTS) version.

But will soon recommend:

GOV.UK Frontend requires Node.js version 12.17.0 or later to support ECMAScript modules. Where possible, we recommend you install the latest Long Term Support (LTS) version.

Published code

For context, we don't npm publish any package.json dependencies so we're not tied to minimum versions:

  1. Node.js >=18.0.0 for rollup@^4.1.4
  2. Node.js >=6.9.0 for babel@^7.23.2
  3. Node.js >=14.0.0 for sass-embedded^1.69.2
  4. Node.js ^14 for cssnano@^6.0.1

i.e. Our published code is already compiled/transpiled/optimised so doesn't need these tools anymore

@paulrobertlloyd
Copy link
Contributor Author

Ah, of course, all things are not what they seem. Thanks so much for the detailed answer, @colinrotherham. Will close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting triage Needs triaging by team 🐛 bug Something isn't working the way it should (including incorrect wording in documentation)
Projects
Development

No branches or pull requests

2 participants