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 elementss,bdi,search,data,slotandtrack, the event handler attributes that were missing (the pointer family, clipboard,ontoggle,onscrollendand friends), and content models brought in line with the standard. - SVG:
maskwas declared inSvg_typesbut the element itself was missing,feMergecould be given no child becausefeMergeNodedid 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,preserveAspectRatioand 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:
areahad nohrefand its tag was in no content model, so amapcontaining areas fitted nowhere;symbolaccepted no core attributes, hence noidand no way to reference it; thelichildren ofmenucould 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:hiddenandcontenteditabletake an enumerated argument, the URL-valued attributes go throughXml.uri, SVG documents are printed without the SVG 1.1 doctype,Wrapped_functionshas 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
- Blog post with the details: TyXML 5.0.0: the HTML living standard and SVG 2 — Ocsigen
- Changelog: tyxml/CHANGES.md at master · ocsigen/tyxml · GitHub
- Manual and API: TyXML documentation
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.