Skip to content

v0.7.0

Choose a tag to compare

@dkulyk dkulyk released this 03 Sep 21:10
· 45 commits to main since this release
6892756

Added

  • getPart() returns relationship parts, so /_rels/.rels and part relationship files can be read through PartInterface as well as the raw part access methods.
  • Relationships can be added before their source part exists. validate() and saving report relationship parts whose source part never arrived.
  • Benchmark coverage for stream opening, small part reads, part registration, and bulk relationship additions.

Changed

  • Breaking: raw part-writing methods and PartInterface::setContents*() reject relationship parts. Change relationships through getRelationships(), addRelationship(), and removeRelationship() so the in-memory collection and its XML stay synchronized.
  • Breaking: getRelationships() and addRelationship() no longer throw PartNotFoundException for an unknown source part; a mistyped source now surfaces at validate() or save time as a missing source part.
  • Breaking: Relationships and Relationship hold their package weakly. Operations that need it, such as getTargetPart(), create(), and retarget(), throw once the package has been released instead of keeping it alive.
  • Relationship parts are serialized once when read or saved instead of after every change, changed collections stay live between calls, and generated ids no longer rescan from rId1 on every addition. Adding 800 package relationships dropped from about 570 ms to about 2 ms.
  • Part-name availability checks use an indexed exact, ancestor, and descendant lookup instead of scanning every package entry for each added part.
  • Successful saves reuse the verified temporary package fingerprint after atomic replacement instead of hashing the same output a second time.

Fixed

  • New packages write [Content_Types].xml as the first ZIP entry, as OPC expects for streaming readers, instead of appending it after every part.
  • hasPart() returns false for package metadata and invalid OPC part names instead of throwing while performing an existence check.

See the full changelog.