Releases: joanllenas/ts.data.json
Releases · joanllenas/ts.data.json
v3.1.0
Features
- Added the new
allOf()
decoder (docs).
Note: AnallOf
decoder existed in v2+, but it did not behave as expected. This new version merges all provided decoders and infers the merged type.
Enhancements
- Improved the
literal()
decoder type safety, which now infers the literal type instead of a broad type.
Example:
v3.0.0
JsonDecoder.literal('hello') // Decoder<string>
v3.1.0
JsonDecoder.literal('hello') // Decoder<'hello'>
v3.0.0
Release v3 of ts.data.json
Tree Shaking, New Decoders, and DX Improvements
This PR introduces version 3 of ts.data.json, bringing several enhancements:
- Added tree-shaking support to reduce bundle size.
- Introduces new decoders.
- Enhancements to the DX.
- Improved performance and usability while maintaining backward compatibility as much as possible.
All changes are documented in the migration guide.
v2.3.1
This release contains only TSDoc documentation enhancements to improve IntelliSense and documentation website generation.
v2.3.0
Features
- Add Standard Schema v1 support.
( Check this stackblitz example )
Chores
-
Modernize project: remove TSLint, add ESLint, vite, esbuild and configure Vitest for testing.
-
Improve json-decoder documentation and intellisense.
-
Update README.md to improve clarity in examples and usage instructions for JSON decoders.
-
Add CI/CD pipeline configuration for automated testing and NPM publishing
v2.2.0
v2.1.1
This release contains a bug fix contributed by @mlocati 🎉
v2.1.0
Feature
- Added
FromDecoder<D>
to infer types from decoder declarations. (docs)
Without FromDecoder
type User = {
firstname: string;
lastname: string;
};
const userDecoder = JsonDecoder.object<User>(
{
firstname: JsonDecoder.string,
lastname: JsonDecoder.string
},
'User'
);
With FromDecoder
const userDecoder = JsonDecoder.object(
{
firstname: JsonDecoder.string,
lastname: JsonDecoder.string
},
'User'
);
type User = FromDecoder<typeof userDecoder>;
v2.0.0
In this release
- Removed deprecated APIs:
Before | After |
---|---|
onDecode() | fold() |
decodePromise() | decodeToPromise() |
then() | chain() |
BREAKING CHANGES
onDecode()
is nowfold()
.decodePromise()
is nowdecodeToPromise()
.then()
is nowchain()
.- Upgraded to TypeScript v4
v1.7.0
In this release
- Readme: Added a Table of Contents
- Readme: Added Decoder API documentation
- Added deprecation warnings for some APIs that will be renamed in the next major version:
Before | After |
---|---|
onDecode() | fold() |
decodePromise() | decodeToPromise() |
then() | chain() |
v1.6.1
Added CJS and ESM builds.