npm / @thednp/dommatrix
@thednp/dommatrix
What changed in @thednp/dommatrix 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
2 breaking6 new APIs and options16 performance2 tooling5 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@thednp/dommatrix 331 changes
Breaking changes 2
Transform arguments that are not numbers are now rejected with an invalid transform string error instead of being silently parsed as 0.
Now mutates the matrix in place and returns this, matching native DOMMatrix.setMatrixValue(); previously it returned a new matrix and left the original untouched.
New APIs and options 6
A static property exposes the library version, inlined from package.json at build time without adding a runtime dependency or file read.
Now accepts an optional target instance, allowing array values to be written directly into an existing instance instead of allocating a new one.
Now accepts an optional target instance, allowing object values to be written directly into an existing instance instead of allocating a new one.
Added the mutable mutateSelf method.
Added the mutable rotateSelf method.
Added the mutable translateSelf method.
Performance 16
Construction fast-paths string, array, typed-array, and object initializers, improving construction performance without changing parity.
Validates and destructures input directly, avoiding an intermediate Array copy.
Parses transform lists with a single regex iteration while retaining strict validation of non-transform garbage.
Uses a shared multiplication kernel; measured performance is about 7x the 3.0.7 snapshot.
Uses a shared multiplication kernel and writes into the receiver instead of allocating and spreading a result object; measured performance is about 17–18x the 3.0.7 snapshot.
Measured performance is about 5–5.6x the 3.0.7 snapshot.
Measured performance is about 4.1–4.5x the 3.0.7 snapshot.
Uses specialized pre-multiply math instead of general matrix multiplication; measured performance is about 13x the 3.0.7 snapshot.
Uses specialized pre-multiply math instead of general matrix multiplication; measured performance is about 6–14x the 3.0.7 snapshot.
Delegates to skew(), which uses specialized pre-multiply math instead of general matrix multiplication.
Builds the typed array directly, skipping the intermediate toArray() allocation.
Builds the result object with explicit property writes instead of spreading the matrix; measured performance is about 9.7–10.1x the 3.0.7 snapshot.
Uses specialized pre-multiply math instead of general matrix multiplication; measured performance is about 6.5–13x the 3.0.7 snapshot.
Uses specialized pre-multiply math instead of general matrix multiplication.
Now uses mutable methods for better performance.
Non-mutable transform methods now use multiply, providing micro-optimizations.
Tooling 2
Runs the new parity and performance benchmark suite against a snapshot of the previous release.
Runs the new parity and performance benchmark suite comparing the implementation with the browser's native DOMMatrix.
Fixes and other changes 5
grad and turn units now convert correctly to degrees, and unit matching is case-insensitive.
Transform functions with zero-valued arguments are no longer rejected; the string constructor is fixed as well.
The no-op transforms scale(1, 1) and scale3d(1, 1, 1) now return the identity matrix instead of being rejected.
Negative lengths are rejected and the perspective length is clamped to a minimum of 1px to match native DOMMatrix behavior.
Falls back to [0, 0, 0, 0] when parameter values are not provided, and throws only if any value is not a number.