Skip to content

Releases: reactnativecn/node-hdiffpatch

v2.2.1

Choose a tag to compare

@sunnylqm sunnylqm released this 08 Jul 07:55
9b77951

Fixes

  • Compatibility: single-format (HDIFFSF20) diffs that store the payload raw (compression would expand it) no longer carry a stale lzma2 compressType label. Old decoders (HDiffPatch ~4.x, including react-native-update clients in the field) decide whether to decompress from the label alone and failed with hpatch error -4 on such diffs — typically tiny diffs between near-identical bundles. Output is now byte-compatible with 1.x for this case. Applies to diff(), diffWindow(), and diffSingleStream(); diffStream (HDIFF13) was never affected.

Upgrade urgency: high if you generate update diffs with 2.0.3–2.2.0 — a small enough diff generated by those versions fails to apply on all deployed clients that predate the reader-side guard.

v2.2.0

Choose a tag to compare

@sunnylqm sunnylqm released this 08 Jul 07:15
4f42a80

Added

  • diffWindow(oldPath, newPath, outDiffPath[, windowSize][, cb]): optional windowSize (bytes, default 2MB) controls the sliding window over old data. Larger windows catch longer-distance content moves at roughly linear additional memory — useful when a bundle's sections move further than 2MB between versions.

v2.1.0

Choose a tag to compare

@sunnylqm sunnylqm released this 08 Jul 06:42
ad1dc1c

Added

  • diffWindow(oldPath, newPath, outDiffPath[, cb]): window/fast-match single-format generation — big covers from streaming block matching + suffix-string refinement inside a 2MB sliding window over old data. Match quality is close to in-memory diff() while memory stays at the streaming tier.
  • Output is standard HDIFFSF20: applies via patch(), patchSingleStream(), and all existing single-format apply sides (verified byte-exact against the legacy v3.1.1 client patch core). No consumer changes needed.

Benchmarks (vs diffSingleStream, block=64)

pair diffSingleStream diffWindow in-memory diff
218KB Hermes HBC 19,034 B 4,920 B 4,929 B
100MB similar 2,258 B 455 B

Peak RSS on the 100MB pair: ~27MB for both streaming modes.

v2.0.3

Choose a tag to compare

@sunnylqm sunnylqm released this 08 Jul 03:58
b6178fd

修复 Windows x64 prebuild 链接:编入 lzma CpuArch.c。功能同 v2.0.0(见其 release notes)。

v2.0.2

Choose a tag to compare

@sunnylqm sunnylqm released this 08 Jul 03:55
4d0f42f

修复 Windows prebuild 链接:补齐 v5 的 window_diff 与 HPatchLite 源文件。功能同 v2.0.0(见其 release notes)。

v2.0.1

Choose a tag to compare

@sunnylqm sunnylqm released this 08 Jul 03:50
5a0ee02

修复 Windows prebuild:HDiffPatch v5 中 divsufsort 源文件为 .cpp。其余同 v2.0.0(见其 release notes)。

v2.0.0

Choose a tag to compare

@sunnylqm sunnylqm released this 08 Jul 03:45
80f2d9c

Breaking Changes

  • Removed diffWithCovers. 该实验性 API 无消费方;移除后 HDiffPatch 子模块可直接跟踪纯上游(v5.0.1),不再携带自有补丁。

What's Changed

  • Vendored HDiffPatch v3.1.1 → v5.0.1,lzma SDK → v26.02。同输入产物逐字节同级、diff 速度持平;patch 双向兼容已验证(老库产物 ↔ 新库应用)。
  • 新增 diffSingleStream(oldPath, newPath, outDiffPath[, cb]):流式块匹配生成 single 格式(与 diff() 同格式)——生成端内存 O(匹配块),实测 100MB 输入仅 ~27MB RSS 增量;产物经旧版(v3.1.1)客户端 patch 内核逐字节验证可直接应用,存量客户端零升级即可受益
  • 关闭 v5 默认的 diff 进度打印,保持服务端 worker 日志干净。

Full Changelog: v1.3.0...v2.0.0

v1.3.1

Choose a tag to compare

@sunnylqm sunnylqm released this 08 Jul 03:26
3c6ca8c

Fixes

  • Restore glibc ≥ 2.33 compatibility for the linux-x64/arm64 prebuilds. v1.3.0's prebuilds required GLIBC_2.38 (via __isoc23_strtoull) and failed to load on Ubuntu 22.04, Debian 12, and all bookworm-based official Node Docker images. The uint64 string parser no longer uses strtoull; accepted input grammar is unchanged (canonical decimal only, overflow rejected).

If you saw ERR_DLOPEN_FAILED: version GLIBC_2.38 not found after upgrading to 1.3.0, this release fixes it.

v1.3.0

Choose a tag to compare

@sunnylqm sunnylqm released this 05 Jul 14:06
4fa14e3

New APIs

  • diffWithCovers(old, new, covers, options) — create standard hdiffpatch payloads from caller-provided cover lines, with replace / merge / native-coalesce modes and optional debugCovers introspection
  • patchSingleStream(oldPath, diffPath, outNewPath[, cb]) — file-level apply for single-compressed diffs produced by diff() / diffWithCovers()

CLI

  • hdp patch now auto-detects the diff format by header magic (HDIFF13 / HDIFFSF20), so it can apply both hdp diff output and diff() / diffWithCovers() output

Platforms & packaging

  • New prebuilds: darwin-x64 and win32-x64 (in addition to darwin-arm64, linux-x64, linux-arm64)
  • Robust native module loading: local dev build → per-platform prebuild → node-gyp-build fallback with a clear error on unsupported platforms
  • Prebuilds-only install: the install script was removed (the published package ships no sources); engines.node >= 14.17 declared
  • npm publish now includes provenance attestation

Hardening & tests

  • Diff-declared sizes are validated before allocation (size_t truncation guard)
  • Cover fields reject negative numeric strings ("-1" no longer wraps to UINT64_MAX)
  • CI test matrix across 5 platforms under both Node and Bun runtimes; async callback paths, corrupt-diff error propagation, and CLI formats are now covered

🤖 Generated with Claude Code

v1.2.2

Choose a tag to compare

@sunnylqm sunnylqm released this 01 Feb 14:46
6ee6c4c

Full Changelog: v1.2.1...v1.2.2