r/javascript • u/LovishMahajan7 • 18d ago
AskJS [AskJS] How much do you actually trust the version number on an npm update?
I'm working through how a team decides whether an automated dependency update is safe to merge, and one of the baselines I'm testing is the obvious one: trust semver. Auto-merge patch and minor, hold majors for review.
My assumption is that this baseline is weak — that in practice a meaningful share of breaking changes ship in patch and minor releases, and that a major bump is often just a dropped Node version or a TypeScript signature change that doesn't affect anyone.
If that's right, the version number is close to noise and the semver rule is mostly giving teams a false sense of having a policy.
But I've only got my own experience to go on, and I'd rather be corrected before I build on it.
- Have you been broken by a patch or minor bump? What was it?
- Have you held a major that turned out to be a no-op for your code?
- If semver isn't the signal, what is — changelog quality, maintainer, download count, how long the release has been out?
Interested in specific packages and versions if you remember them, more than general opinions on semver as a concept.
2
u/Ok_Woodpecker_9104 17d ago
from the publishing side the number gets decided by a human at tag time, and semver has no word for the thing that actually breaks you.
i maintain a linter. if i tighten one existing rule so it catches a case it used to miss, thats a patch by the letter of semver. no api change, nothing renamed, no export moved. but every consumer running that rule with ci set to fail now has a red build on code they never touched. same outcome as your date lib story except nobody was being sloppy.
so the thing i actually check is whether a release changes what the tool says about unchanged input. semver has no way to express that, which is why the number is weak for anything with rules or defaults in it. it works fine for plain libraries where the api is the whole surface.
the filter that has held up for me on other peoples packages: does the changelog name behaviour or does it name code. "improved performance" and "refactor internals" are unreviewable, you have to read the diff. "now also flags X" or "default for Y changed from a to b" i can judge in ten seconds. a one line changelog is usually the maintainer telling you they didnt think about who it lands on.
1
u/create-third-places 18d ago
I assume any version update is not safe to merge until a full round of testing has been done with it.
1
u/brian_sword 17d ago
I will be honest that I don't think the version number is enough to decide whether an update is safe. I've had minor updates break things
For automated updates, semver would be a good choice as a starting point, but I still check the changelog and let the tests have the final say. It would be better if you check how the package is maintained and whether other people are reporting issues with the new version.
8
u/Spiritual_Bee6614 18d ago
Semver is a polite fiction at this point honestly more of a vibe than a contract. Had a minor bump on a date formatting lib completely rewrite the API because the maintainer felt like it, changelog just said "improved performance". Took half a day to unpick.
If the changelog is one line or just links to a commit list I treat it the same as a major, doesn't matter what the number says.