Skip to content

v2.0.0

Choose a tag to compare

@almasumdev almasumdev released this 29 Aug 20:14
· 151 commits to main since this release

Breaking

  • Typed exception hierarchy. Failures now throw a sealed ExcelException
    instead of the generic error types used before:

    • ExcelArchiveException: the bytes are not a readable .xlsx container.
      Replaces the old UnsupportedError and ArgumentError for unreadable
      files.
    • ExcelFormatException: a valid archive with malformed or inconsistent
      XML. Replaces the old ArgumentError.
    • ExcelEncodeException: the workbook could not be encoded on save.
    • FormulaParseException: raised inside the formula parser; it implements
      FormatException, so existing handlers keep working. Through the public
      API a bad formula still surfaces as an #ERROR! cell value.

    Each carries a message, an optional part, and an optional cause.
    Corrupt input was previously signalled with Error subtypes, which Dart
    reserves for programming bugs; bad input is an expected runtime condition,
    so it now throws an Exception you are meant to catch. Genuine argument
    validation still throws ArgumentError. To migrate, replace
    on ArgumentError, on UnsupportedError, or on Error around decode
    calls with on ExcelException or a specific subtype.

Fixed

  • Pivot <pivotCaches> workbook ordering. It was written in an invalid
    position that made Excel offer to repair files containing certain optional
    elements; it is now ordered correctly.
  • Formula serialization round-trip. Re-serialized shared formulas now
    re-double embedded quotes and single-quote non-identifier sheet names, so
    they parse back correctly.
  • Criteria wildcards. COUNTIF, SUMIF, and their multi-criteria
    variants honor * and ? wildcards, with ~ as the literal escape.
  • WEEKDAY supports return types 11 to 17 and returns #NUM! for an
    unsupported type.
  • INDEX with a zero row or column returns the whole column or row as an
    array instead of #REF!.
  • Approximate VLOOKUP, HLOOKUP, MATCH, and LOOKUP compare within a
    value type, so a number is never matched against a text key.
  • Unary operators broadcast over arrays, matching the binary operators.
  • TEXT scaling commas. A comma after the last digit placeholder scales
    the value by 1000 per comma, distinct from a grouping comma.
  • Input validation and cleanup. addPivotTable rejects field indices
    outside the source range instead of crashing on save, addChart rejects a
    chart with no series, and removeTable deletes the orphaned table part and
    its content-type entry.

Internal

  • Replaced literal NUL bytes used as map-key delimiters with Unicode escapes
    so the affected source files are plain text again; added *.xlsx to
    .pubignore.