Releases: aduh95/viz.js
Releases · aduh95/viz.js
Release v3.2.0
Release v3.1.0
Release v3.0.2
Release v3.0.1
Fix issue with Webpack v4.
Release v3.0.0
Notable changes
- The library is now compiled to WASM, which shrinks the file size (Viz.js
(2.1.2 full version) brotlified: 409K; @aduh95/viz.js (3.0.0-beta.7 browser
version) brotlified: 337K; 18% decrease), should improve performances and
allows dynamic memory growth. - The JS code is now transpiled from TypeScript, and typings are packed within
the npm package. You can find the API documentation there! - The library is able to reset its internal error state, which makes the
v2 wiki caveat
unnecessary. - Rendering from main thread is no longer supported on the default async API,
you must use a worker (webworker or worker_thread). - There is a synchronous version available for legacy Node.js support.
Breaking changes and deprecations
- BREAKING: Bump required version of Node.js to v12.17.0+. Older Node.js
version may support the synchronous API. - BREAKING: Remove
Viz.prototype.renderSVGElement
. You can use
renderString
andDOMParser
to achieve the same result. - BREAKING: Remove
Viz.prototype.renderImageElement
. You can use
renderString
andCanvas
to achieve the same result. - BREAKING: Remove
Module
andrender
fromViz
constructor's options
(you must now specify eitherworker
orworkerURL
). - BREAKING: Remove lite version, Viz.js now comes in only one variant.
- BREAKING: The
full.render.js
script is replaced by therender.node.mjs
andrender.browser.js
modules. - BREAKING: The
render.node.js
module (that replacesfull.render.js
)
exports a worker_thread factory when imported from the main thread. It's
available through@aduh95/viz.js/worker
specifier on Node.js and bundle
tools that supportpackage.json
#exports
. - BREAKING: The
render.browser.js
module (that replacesfull.render.js
)
exports a function which takes a Module object as parameter. You should use it
to give the path torender.wasm
the Emscripten script. You should not import
this module from the main thread. On bundle tools that support
package.json
#exports
, you can use the specifier@aduh95/viz.js/worker
. - BREAKING: Compiles to WebAssembly, which cannot be bundled in the
render.js
file like asm.js used to. Depending on your bundling tool, you may
need some extra config to make everything work. You might also use the
synchronous API, which bundles the asm.js code, although its usage should be
strictly limited to Node.js or webworker use. - BREAKING: Remove ES5 dist files, all modern browsers now support ES2015
modules. If you want to support an older browser, you would need to transpile
it yourself or use an older version. - BREAKING: On Node.js,
require('@aduh95/viz.js')
returns now a
Promise<Viz>
. - DEPRECATED:
require('@aduh95/viz.js')
is deprecated, use
import('@aduh95/viz.js')
instead.
Added features
- Add support for Node.js
worker_threads
. - Refactor JS files to TypeScript.
- Refactor
viz.c
to C++ to use
Emscripten's Embind. - Use
ALLOW_MEMORY_GROW
compiler option to avoid failing on large graphs. - Improve error handling:
- Rejects with the full error string from Graphviz.
- Remove the need of creating new instances when render fails by resetting
internal error state.
- Switch to Mocha and Puppeteer for browser testing.
- Add synchronous API using asm.js (
@aduh95/viz.js/sync
). - Add a helper module for asynchronous API (
@aduh95/viz.js/async
). - Upgrade deps:
- Upgrade Emscripten to 1.39.16
- Upgrade Graphviz to 2.44.0
- Upgrade Expat to 2.2.9
- Upgrade Rollup to 2.x
- Change test chain:
- Upgrade Mocha to 7.x
- Use Puppeteer instead of Selenium