Releases: neefrehman/make-matrix
Releases · neefrehman/make-matrix
v2.3.0
v2.2.0
2.2.0 (2022-07-30)
Bug Fixes
- types: fixes regression that caused a dynamic
dimensionsarray (of typenumber[]) to throw a type error (6921cd4)
Features
- types: return types are no longer widened to their primitives, so more strict matrices can be created, e.g.
(0 | 1)[][](fe86ca4)
Improvements
- types: improve DX by using Branded types to not expose the complexity of internal types via intellisense (d703c2)
v2.1.5
2.1.5 (2022-07-26)
Performance Improvements
v2.1.4
v2.1.2
2.1.2 (2022-06-30)
Bug Fixes
types: avoid compiler error with dynamic dimensions (ec7a3b6)
When a Matrix is created without knowing its exact size or number of dimensions, such as when creating one dynamically, it's impossible recursively construct a type for it. Previously, the typescript compiler would have thrown a type instantiation is excessively deep... error, which the user would have had to use a // @ts-ignore comment for, and even then the return type would resolve to any.
Now, we short circuit the Matrix type to resolve to any[] in these cases, to stop the typescript compiler throwing the error and to provide some level of type safety:
// previously:
const createDynamicMatrix = (dimensions: number[]) => makeMatrix(dimensions); // 🚨 error: Type instantiation is excessively deep and possibly infinite
// now:
const createDynamicMatrix = (dimensions: number[]) => makeMatrix(dimensions); // any[]types: include internal types in build output (f0d33a9)
v2.1.0
v2.0.0
2.0.0 (2022-06-16)
Build System
- javascript output: changes javascript output from es5 to es6 (bb1262c)
BREAKING CHANGES
- javascript output: support for pre-es6 runtimes has been dropped. As a result, make-matrix will no longer work without es6 support or a build tool that will handle transpilation. This has led to a ~13% reduction in bundle size of the package.