Skip to content

4.0.0

Compare
Choose a tag to compare
@SGrondin SGrondin released this 30 Jul 19:29

Welcome to SZXX 4.0.0!

There are too many changes to list them individually. Here are the highlights:

  • v4 is more than 3x faster than v3
  • All 3 modules are now considerably easier to use and less error prone
  • v4 offers stronger memory usage guarantees and lets the user control any and all buffering, precisely

But the most important change is the switch from Lwt to Eio. As such, v3 will continue to receive bug fixes until the majority of the OCaml world has moved from Lwt/Async to Eio.

Every use case can be converted from v3 to v4.

Xlsx

All uses of stream_rows, stream_rows_buffer and stream_rows_unparsed can be expressed in terms of Xlsx.stream_rows_single_pass.
However, if your data is in the form of a file (as opposed to an HTTP stream for example), then the new Xlsx.stream_rows_double_pass is even easier.
Take a look at the README and the mli and you should be able to upgrade fairly painlessly!

Xml

The old low-level functions are still there, albeit moved into nested modules.
The new Xml.parse_document and Xml.stream_matching_elements should suffice for 99.5% of use cases and they are both infinitely friendlier interfaces.
Consider switching over to those two new functions, it will greatly simplify your code. Otherwise just find the new location of the functions you're currently using, by looking in the mli.

Zip

This module is the least changed of the 3. New Zip.Action choices are available, but Zip.stream_files remains essentially the same (except that it's much faster now!)
The new Zip.index_entries and Zip.extract_from_index are often easier, faster and less error prone, but come with the restriction that the Zip file must be a file stored on the disk (not an HTTP stream for example).