[ANN] TyXML 5.0.0

We are happy to announce TyXML 5.0.0, a major release. TyXML builds HTML and SVG documents whose validity is checked by the OCaml type system: an element the specification does not allow in a given position does not typecheck. The library now follows the current specifications, the WHATWG living standard for HTML and SVG 2 with the Filter Effects module, where SVG support had not moved since SVG 1.1.

Highlights:

  • HTML: popover, invoker commands, microdata, declarative shadow DOM and CSS shadow parts, loading/decoding/fetchpriority, blocking, the new elements s, bdi, search, data, slot and track, the event handler attributes that were missing (the pointer family, clipboard, ontoggle, onscrollend and friends), and content models brought in line with the standard.
  • SVG: mask was declared in Svg_types but the element itself was missing, feMerge could be given no child because feMergeNode did not exist, and about thirty presentation attributes had a type tag but no function to produce them. All of those are in, together with the SVG 2 additions, ARIA support, the SVG 2 link attributes, and content models widened to SVG 2.
  • The PPX and JSX syntaxes: no camel case SVG attribute was recognised, so viewBox, stdDeviation, preserveAspectRatio and most others were rejected, which means most real SVG could not be written with the PPX at all. Whitespace between SVG tags is also ignored now where the content model does not accept text, so indented SVG typechecks.
  • Constructs that no program could actually use are fixed: area had no href and its tag was in no content model, so a map containing areas fitted nowhere; symbol accepted no core attributes, hence no id and no way to reference it; the li children of menu could not be built. Several attribute names were also emitted misspelled, which is worse than a compile error since the output looks fine. Breaking changes worth knowing about: hidden and contenteditable take an enumerated argument, the URL-valued attributes go through Xml.uri, SVG documents are printed without the SVG 1.1 doctype, Wrapped_functions has four new functions for implementers of the functorial interface, and the build requires OCaml 4.08, dune 3.18 and ppxlib 0.36.
opam install tyxml

Thanks to everyone who contributed to this release, in particular Hugo Heuzard, Martin Bodin, toastal, Sylvain Boilard, rand00, Sora Morimoto, Patrick Ferris and Gabriel Radanne. Bug reports and pull requests are welcome on GitHub - ocsigen/tyxml: Build valid HTML and SVG documents · GitHub.

17 Likes