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

chore: remove semver dependency #534

Closed
wants to merge 1 commit into from

Conversation

rtritto
Copy link
Contributor

@rtritto rtritto commented Sep 19, 2024

Simplify logic to check Node version and remove the use of semver dependency.

Fix #516

@rtritto rtritto requested a review from a team as a code owner September 19, 2024 22:57
Copy link
Member

@erickzhao erickzhao left a comment

Choose a reason for hiding this comment

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

Hi @rtritto, thanks for the PR. I think we should instead just add semver as a dep here instead of manually parsing the version string.

We already have semver in our lockfile a couple times, so I think this would be the correct invocation:

yarn add semver
npx uuaw semver

@rtritto
Copy link
Contributor Author

rtritto commented Sep 20, 2024

It's better to have less dependencies to reduce version checks and to improve performance, bundle and readability.
In the future, semver could be removed from other dependencies and, with this change, we won't change nothing.

@erickzhao
Copy link
Member

It's better to have less dependencies to reduce version checks and to improve performance, bundle and readability.

I disagree here. SemVer logic isn't always trivial and having to write individual string parsing functions for each case doesn't make a lot of sense.

It's also a first-party npm package that's used across the ecosystem (for example, we already have a few other instances of semver in this project's lockfile via tooling such as typescript-eslint).

@MarshallOfSound
Copy link
Member

Agree with Erick above, also worth noting that this code as it stands is wrong. Difference checks between numbers and strings do not work as you'd expect.

Keep the semver dependency

@rtritto
Copy link
Contributor Author

rtritto commented Sep 20, 2024

Agree with Erick above, also worth noting that this code as it stands is wrong. Difference checks between numbers and strings do not work as you'd expect.

You're right, I forgot the compare as numbers with parseInt.

Opened #535

@rtritto rtritto closed this Sep 20, 2024
@rtritto rtritto deleted the remove-semver-dep branch September 20, 2024 22:22
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.

Missing semver dependency
3 participants