π π β€οΈ SnapDOM v2 is out π π β€οΈ β new capture engine, plugins, and lazy exporters #320
tinchox5
announced in
Announcements
Replies: 2 comments 2 replies
-
|
Slower than v1, don't know why |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Hello, may I ask when the official PDF plugin is expected to be launched? I'm really looking forward to this feature. I use pagd.js pagination and snapdom to take screenshots. The pagination has never been handled well. There are a lot of mathematical formulas on my page. Please |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
SnapDOM v2 is now live.
This is not a minor bump over 1.x. The core has been rewritten into a DOM capture engine with a cleaner architecture, better performance, and a proper plugin system, while keeping the API familiar for existing users.
Whatβs new in v2
1. New capture pipeline
<use>and external<defs>,url(#id)references, masks, filters, and pseudo-elements.2. Plugins and custom exporters
SnapDOM is now a platform, not just a collection of helpers.
Hooks:
beforeExport,afterExport,afterSnap,defineExports.Plugins can:
Global plugins and per-capture plugins are both supported, so you can keep defaults for your app and override behavior for specific snapshots.
3. Context-driven API
All options flow through a single
createContext()internally.4. Lazy exporters
All exporters are lazy-loaded:
toPng,toJpg,toWebp,toSvg,toCanvas,toBlob,toImg,downloadare only imported when you actually call them.Public API (unchanged where it matters)
The high-level API stays familiar:
You can still use the convenience wrappers:
And plugins:
Plugins can define new exports via
defineExports, which then show up as extratoPdf()helpers on the result object.Bundling and distribution changes
This is important if you use CDN or rely on specific filenames.
npm and CDN builds are now minified by default.
There is no separate
snapdom.min.jsvssnapdom.js/snapdom.mjsdistinction anymore.The main entry points are:
@zumer/snapdomdist/snapdom.js(already minified)If you previously hardcoded
snapdom.min.js, update to the unified artifact path.Example (CDN):
Installation
Or via CDN as shown above.
Short roadmap
Some things planned right after v2:
Documentation refresh focused on v2 concepts (context, plugins, exporters).
SnapDOM Labs: interactive demos for real-world UIs (dashboards, editors, math, icon fonts, etc.).
Official plugins:
Beta Was this translation helpful? Give feedback.
All reactions