Skip to content

v2.2.0

Compare
Choose a tag to compare
@nvie nvie released this 02 Jan 12:35
· 85 commits to main since this release

Breaking change: Dropped Flow support1.

Breaking change: Projects that are not yet using strict: true in their tsconfig.json files files are no longer supported. Previously, decoders went to great lenghts to support both configurations, but the internal typing magic was getting too complex to maintain without much benefit.

Breaking change: A small breaking change is introduced that removes the need for some packaging workarounds to support projects using old TypeScript/Node versions. It’s now simpler to use, and simpler to maintain:

-import { formatInline, formatShort } from 'decoders/format'; // ❌
+import { formatInline, formatShort } from 'decoders'; // ✅
-import { Result, ok, err } from 'decoders/result'; // ❌
+import { Result, ok, err } from 'decoders'; // ✅

Other, smaller changes, mostly internal:

  • Rewritten source code in TypeScript (previously Flow)
  • Rewritten test suite in Vitest (previously Jest)
  • Modern ESM and CJS dual exports (fully tree-shakable when using ESM)
  • Further reduced bundle size
  • Related, greatly simplified complex internal typing magic to make it work in projects with and without strict mode.
  1. I'm still open to bundling Flow types within this package, but only if that can be supported in a maintenance-free way, for example by using a script that will generate *.flow files from TypeScript source files. If someone can add support for that, I'm open to pull requests! 🙏 )