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 policy on using caret (^) or tilde (~) with dependencies #290

Merged
merged 12 commits into from
Mar 3, 2025

Conversation

UlisesGascon
Copy link
Member

@UlisesGascon UlisesGascon commented Oct 22, 2024

Policy on using caret (^) or tilde (~) with dependencies

  • Establishes policy for using caret (^) or tilde (~) for dependencies that we maintain while avoiding its use for third-party dependencies.
  • Explains the differences between caret (^) and tilde (~) version ranges.
  • Documents the rationale, alternatives considered, and implementation plan.

Context

Copy link
Member

@blakeembrey blakeembrey left a comment

Choose a reason for hiding this comment

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

TL;DR I think we should try to be high trust and good examples of OSS by treating all dependencies the same.

Copy link
Member

@wesleytodd wesleytodd left a comment

Choose a reason for hiding this comment

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

If @UlisesGascon is alright with the suggestions to use ^ for all, I tried to make change suggestions to everywhere I noticed where it was referenced. Personally I think the conservative approach used in earlier days is not necessary anymore and so am in favor of using it for all deps.

@UlisesGascon
Copy link
Member Author

UlisesGascon commented Oct 26, 2024

Worth mentioning that the caret (^) is not supported on [email protected], as noted in this comment. Therefore, this change might be considered semver-major in many scenarios unless we decide that dropping support for [email protected] is not a major change. 😄

@ljharb
Copy link
Contributor

ljharb commented Oct 27, 2024

@UlisesGascon it's not supported on the npm that comes with node 0.8, but if you use nvm install-latest-npm to get the latest one, then it works just fine :-)

either way, i think it can be fine if you need a newer node to install it as long as it works in old node (albeit, not ideal)

@bjohansebas
Copy link
Member

So we need to prepare the CI for the packages that still support [email protected] before making any changes to the dependencies

@ljharb
Copy link
Contributor

ljharb commented Oct 27, 2024

Yes, for any package that isn't already declaring engines, the first step should be testing (manual or automated) to determine on which versions it's already working - because those are the engines that it's non-breaking to declare.

@bjohansebas
Copy link
Member

@expressjs/express-tc, the way forward is to update the CI, or do we prefer to do this in a major version when support for Node.js 0.8 is removed?

@jonchurch jonchurch added the ADR label Nov 2, 2024
@bjohansebas bjohansebas added meeting top priority Issues which the TC deem our current highest priorities for the project tc agenda labels Jan 13, 2025
@wesleytodd
Copy link
Member

wesleytodd commented Jan 15, 2025

I think the suggestions are mostly agreed upon, @UlisesGascon if you want to make these I can change my review to approved and we can merge this right? (or if you want I can merge them and do it myself, just didn't want to step on your toes)

The rest of the questions/comments dont seem applicable now right?

@wesleytodd
Copy link
Member

he way forward is to update the CI, or do we prefer to do this in a major version when support for Node.js 0.8 is removed?

Ref: expressjs/compression#214 (comment)

I don't think we should make the CI more complicated by applying this change to packages we have not rev'd to drop node versions. I think it is better to do nothing to those until we have another reason to major rev them.

@jonchurch
Copy link
Member

Im in favor of caret being the default for all deps, external or not. AKA I want to accept the suggestions to change the proposal to state that.

@UlisesGascon
Copy link
Member Author

UlisesGascon commented Feb 13, 2025

ok... I think that this is ready for a final review, please feel free to suggest changes and create new discussions if something is not described as agreed previously.

image

@UlisesGascon UlisesGascon merged commit ba5642e into master Mar 3, 2025
1 check passed
@UlisesGascon UlisesGascon deleted the adr/dependecies branch March 3, 2025 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ADR meeting tc agenda top priority Issues which the TC deem our current highest priorities for the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Discussion: Using caret (^) with our own dependencies
8 participants