-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Labels
Description
Currently some packages has drop support to Node.js prior to v18, seems like we didn't upgrade the engines field in the package.json
discordantly.
So, I will like to discuss if this a policy that we should follow as an organization to all the packages (so in that case we can also document it).
Ref:
- Missing engines Field Update for Node.js Version Support in v2.0.0 pillarjs/finalhandler#64
- fix(package.json) Explicit drop support for node<18 pillarjs/finalhandler#59 (great context on why not update by @wesleytodd )
cc: @expressjs/express-tc @Phillip9587
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
UlisesGascon commentedon Oct 16, 2024
IMO, we should align the engines to the CI versions we test for each release branch. Otherwise, we risk introducing breaking changes without realizing it.
If the package happens to work in older versions of Node.js that we haven't explicitly defined as supported, it should be considered an "unsupported feature." We should encourage end users to use at least the minimum supported version for that release branch. Otherwise, we'll end up "supporting" unintended scenarios based on environments we don't explicitly endorse, leading to issues like unexpected bug reports and slower development due to legacy version compatibility problems.
Additionally, npm is clear in its documentation: unless the user has set the
engine-strict
config flag, theengines
field is advisory only and will simply produce warnings when your package is installed as a dependency. This reinforces the need to clearly define supported versions, ensuring that users are aware of the minimum requirements. (documentation)ctcpip commentedon Oct 16, 2024
agree, engines should be added where missing, and should match our CI matrix
Phillip9587 commentedon Oct 16, 2024
I completely agree with the proposed solution to establish a consistent policy for updating the engines field across all packages. Ensuring that the Node.js version support is clearly defined and aligned accross the packages makes sense from a maintenance and user experience perspective.
I’m happy to contribute and help move this forward by submitting the necessary PRs to update the relevant packages. Let me know how best to coordinate on this!
ljharb commentedon Oct 16, 2024
100% that CI should match whatever engines says.
(Changing engines in a way that reduces support is a breaking change, even if the software didn't work on the removed envs, ftr)
inigomarquinez commentedon Oct 21, 2024
I completely agree with the proposal!
bjohansebas commentedon Oct 21, 2024
I totally agree on keeping the CI in line with what the engines say
UlisesGascon commentedon Oct 22, 2024
Proposal for adr created #289
20 remaining items
ctcpip commentedon Jan 16, 2025
responding to another issue here to keep the conversation centraliized
per what the TC agreed via consensus, "there should not be a major version rev JUST for an engines change".
However, we did not specifically decide anything with regard to this situation which is that we DID drop support, we just forgot to update the engines field. Though there haven't been a lot of cases of it, in practice, we've just updated the engines field without revving major.
I am sympathetic to the view that dropping engines when it would otherwise work with strict engine configurations may be a breaking change. Not one that I consider to be completely unacceptable, but alas...
Ultimately, due to how much of a minor/non-issue it is to leave the engines field alone in these cases, this seems like an easy decision:
ljharb commentedon Jan 16, 2025
I agree with that rubric, although because things can fail to install successfully with an engines change, there might be nonzero breakage that way.
ctcpip commentedon Jan 16, 2025
Do you mean like, in the case where it's e.g. an unused transitive dependency? So that the fact the library doesn't work at all doesn't matter, thus the breakage via engines is the sole breakage?
ljharb commentedon Jan 16, 2025
no, i mean that even if it breaks at runtime in, say, node 16, if it's used inside a try/catch, then a package can still support node 16 with it - but if it adds an engines field that requires 18+, then that's a breaking change for that package and its users.
In other words, you can't ever assume that the engines field is "free" to bump, there's always risk of breakage. which is why it's critically important to always declare it, and when dropping support in a major, always bump it with the major.
ctcpip commentedon Jan 16, 2025
sure I agree -- but I think the consideration is unchanged. it hinges on the definition of what makes a package "completely broken". I am thinking like, new node module resolution fails, so you can't even run the thing. if I can still pull in a lib as transitive, then it's not "completely broken"
Regardless, I think, in practice, we will just default to not changing in a minor in any case, because it's really low/no value to try to work out whether the change will be breaking or not given these nuances. and like.. who benefits from doing it anyway?
ljharb commentedon Jan 16, 2025
Exactly, I agree.
wesleytodd commentedon Jan 23, 2025
We need to make a decision on this: pillarjs/finalhandler#59
Do we merge and release as a minor? Close it? Release a major?
I am preparing the list of releases we need to do for the next express version and this one has changes to publish.
ctcpip commentedon Jan 23, 2025
Based on what we agreed, it goes in the next major, but we don't release a major only for an engines field update. So if something else is going out, then sure, but if not, it waits until the next major with actual lib changes.
wesleytodd commentedon Jan 23, 2025
Ok, cool I should have specified in my options two for "release major now" vs "release major later". In this case we have removed a bunch of old compat things in accordance with our stated support for v18 which makes the current engines invalid. So I think this means we are good to release a new major now and call the 2.x line an administrative bump in the road right?
ctcpip commentedon Jan 23, 2025
hmm.. looking at the changes, this appears to be a no-op for end users. seems odd to do a major rev at this point, but whatever works!
wesleytodd commentedon Jan 23, 2025
Yes, this is why I thought it was worth a bit more consideration, but we did drop deps for compat which is a meaningful change.