Skip to content

v1.1.0

Compare
Choose a tag to compare
@github-actions github-actions released this 10 Nov 17:58
· 299 commits to main since this release

Added

  • feat: implement renderAsync() function. By @Brooooooklyn

    We have made a major upgrade to napi-rs, from v1 to 2.x alpha. This allows better support for asynchronous binding and automatic generation of TypeScript definitions. Now you can enjoy async/await.

    The allocator is also enabled, which gives a small performanceh boost.

    const { renderAsync } = require('@resvg/resvg-js')
    
    async function main() {
      const pngData = await renderAsync(/* SVG string or buffer */)
    }
  • feat: The input to the render() and renderAsync() functions supports buffer.

  • feat: improved webpack support, no more need @node-rs/helper dependency.

    The @node-rs/helper is convenient to load native binary cross platform and cpu arch. But it's not friendly to webpack, vercel/nft and vercel/ncc because the logic is too dynamic.

  • feat: add example/compare.js.

Changed

  • fix: the default font no longer throws an error if it is not found, it changes to a warning.
  • chore: benchmark adds tests for svg icons and other improvements.
  • chore: upgrade Rust Edition to 2021.