Skip to content

Update Rust crate nodejs-semver to v8 - #229

Merged
iorate merged 4 commits into
mainfrom
renovate/nodejs-semver-8.x
Dec 3, 2026
Merged

iorate merged 4 commits into
mainfrom
renovate/nodejs-semver-8.x

Conversation

@iorate-bot

@iorate-bot iorate-bot Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Type Update Change
nodejs-semver dependencies major 7.0.0 → 8.0.0

Release Notes

cijiugechu/nodejs-semver (nodejs-semver)

v8.0.0

Compare Source

Breaking changes
  • Version::parse, FromStr, and Serde deserialization now require a complete version after trimming surrounding JavaScript whitespace. Inputs such as 1.2.3 junk, 1.2.3-rc!, and non-ASCII version identifiers return an error. Applications that stored annotated version strings should separate the version and annotation before parsing.
  • Wildcard majors in caret and tilde ranges match any stable release. A wildcard hyphen endpoint leaves that side unbounded. For example, 1.0.0 - x matches 1.9.7, and ~* || 1.2.3 can now select 2.0.0. Bare *, x, and X now display and serialize as *.
  • An unconstrained branch in a parsed || range takes precedence over the other branches, including explicit prereleases. For example, 3.0.0-beta || ^x simplifies to * and excludes 3.0.0-beta under default matching.
  • The public MAX_SAFE_INTEGER now matches JavaScript's 9_007_199_254_740_991. Version and range parsing accept larger numeric components, and the displayed upper bound for a range such as <=1.2 reflects the corrected limit.
Performance
  • Version parsing validates prerelease and build suffixes in one scan, stores short suffixes inline, and decodes individual identifiers only when needed. Common major, minor, and patch values fit together in one u64, so comparing their release tuples takes one integer comparison.
  • Range parsing shares the version-number scanner and handles exact prerelease ranges directly. Parsed ranges precompute integer bounds for common stable versions, reducing the work for each match and for repeated checks during version selection.

We compared 7.0.0 and 8.0.0 on an Apple M4 running macOS 15.7.5 and Rust 1.98.1, using the same benchmark code and dependency versions. Times are the median of three Criterion slope estimates per version, with a 1-second warm-up, a 1-second measurement window, and 30 samples per run. The last four rows measure a batch of 128 inputs. Benchmark source

Workload 7.0.0 8.0.0 Speedup (7.0.0 / 8.0.0)
Parse 1.2.3 6.78 ns 5.35 ns 1.27×
Parse 1.2.3-rc.4+build.7 96.0 ns 35.3 ns 2.72×
Parse the same version and call into_parts() 129.0 ns 157.2 ns 0.82×
Parse the exact range 19.0.0-rc.1 338.4 ns 98.6 ns 3.43×
Match a parsed stable version against an OR range 8.39 ns 3.10 ns 2.71×
Parse resolved versions 1.25 µs 0.96 µs 1.31×
Try dependency specifiers as versions 1.06 µs 0.67 µs 1.58×
Try dependency specifiers as ranges 6.53 µs 5.16 µs 1.27×
Try each specifier as a version, then as a range on failure 3.73 µs 3.21 µs 1.16×

Calling into_parts() immediately after parsing forces the deferred identifier decoding. That workload took 22% longer in 8.0.0.


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate CLI.

iorate-bot Bot and others added 4 commits December 3, 2026 05:42
Classify a range as any by comparing it with `*` as a set, so that
`^x`, `~*` and `^1.0.0 || *`, which nodejs-semver 8 now parses the way
node-semver does, are rewritten like `*`.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`workspace:x`, `workspace:^x` and the like were narrowed to
`workspace:>=<new version>`, unlike the same ranges without the
protocol.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Describe in the changeset what the any-like ranges did before, limit
the workspace arm to the only specs that reach it, and drop the tests
that checked the semver library rather than this crate.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@iorate
iorate merged commit a257efa into main Dec 3, 2026
14 checks passed
@iorate
iorate deleted the renovate/nodejs-semver-8.x branch December 3, 2026 06:30
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.

1 participant