You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 and DOMParser to achieve the same result.
BREAKING: Remove Viz.prototype.renderImageElement. You can use renderString and Canvas to achieve the same result.
BREAKING: Remove Module and render from Viz constructor's options
(you must now specify either worker or workerURL).
BREAKING: Remove lite version, Viz.js now comes in only one variant.
BREAKING: The full.render.js script is replaced by the render.node.mjs
and render.browser.js modules.
BREAKING: The render.node.js module (that replaces full.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 support package.json#exports.
BREAKING: The render.browser.js module (that replaces full.render.js)
exports a function which takes a Module object as parameter. You should use it
to give the path to render.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.