Skip to content

v2.2.0

Compare
Choose a tag to compare
@edemaine edemaine released this 12 May 00:59
· 200 commits to main since this release
  • .js and .coffee mapping files are now loaded as NodeJS modules. (Previously, they were run as special functions.)
    • Makes these files more interoperable when using them as mappings vs. via require or import.
    • Reveals additional Node features (e.g. module global)
    • Enables a lot of other exciting features:
  • New support for import syntax as an alternative to require.
  • New ways to specify the mapping from a mapping file: export default mapping or exports.default = mapping. You can still just write the mapping at the end of the file.
  • required and imported modules can use JSX syntax, so you can share JSX code between mapping files. (#65)
  • Source maps are now fully supported, which means errors from your CoffeeScript mapping files will now have correct line numbers. (#56)
  • Command-line interface has new options for setting the output directory, helping you keep organized. (#58)
    • -o/--output sets an overall default output directory
    • -os/--output-svg, -op/--output-pdf, -oP/--output-png, -ot/--output-tex control output directory by file type
  • API changes to support a settings object instead of overriding class static attributes. (#47)
    • All settings can now be overridden in renderDOM via data-* attributes.
    • New defaultSettings exported object to modify defaults.
    • Replaces old undocumented renderDOMDefaults object.
    • Replaces old undocumented overrides: Drawing.inlineImages, Drawing.keepMargins, Drawing.useHref, Drawings.keepHidden, Symbol.svgEncoding, Symbol.forceWidth, Symbol.forceHeight, Symbol.texText, Symbol.overflowDefault
  • xmldom upgrade means that > is now escaped as >. This can affect CSS output, but should make the resulting SVG easier to parse.

Full Changelog: v2.1.1...v2.2.0