22 KiB
22 KiB
Changelog
Tags:
- [New Feature]
- [Bug Fix]
- [Breaking Change]
- [Documentation]
- [Internal]
- [Polish]
- [Experimental]
- [Deprecation]
Note: Gaps between patch versions are faulty/broken releases. Note: A feature tagged as Experimental is in a high state of flux, you're at risk of it changing without notice.
2.2.20
- undeprecate
FunctionType,FunctionC,Function - undeprecate
NeverType,NeverC,never - undeprecate
AnyType,AnyC,any - undeprecate
RefinementC,refinement,Integer - add refinement overload to allow custom branding, closes #373
2.2.19
- Bug Fix
- allow
Errorto be decoded withUnknownRecord, #664 (@mlegenhausen)
- allow
2.2.18
- Bug Fix
- fix
typescript@4.8errors, closes #656, closes #647 (@gcanti)
- fix
2.2.17
- Bug Fix
- Don't throw a TypeError when trying to decode a sum value that contains a dangerous string, #650 (@thewilkybarkid)
2.2.16
Experimental modules require fp-ts@^2.5.0.
- Experimental
Codec- add
readonlycombinator (@gcanti)
- add
Encoder- add
readonlycombinator (@gcanti)
- add
2.2.15
- Experimental
Schemable- (*) add
readonlycombinator (@gcanti) - (*) add
structcombinator (@gcanti)
- (*) add
- deprecate
typein favour ofstruct(@gcanti) - deprecate
fromTypein favour offromStruct(@gcanti)
(*) breaking change
2.2.14
- Experimental
Guard- relax
UnknownRecordcheck, closes #559 (@waynevanson)
- relax
2.2.13
- Bug Fix
- improve internal
mergeAllfunction, closes #532 (@gcanti)
- improve internal
2.2.12
- Experimental
- (*) make
sumsafer, closes #523 (@gcanti)
- (*) make
(*) breaking change
In case of non-string tag values, the respective key must be enclosed in brackets
export const MySum: D.Decoder<
unknown,
| {
type: 1 // non-`string` tag value
a: string
}
| {
type: 2 // non-`string` tag value
b: number
}
> = D.sum('type')({
[1]: D.type({ type: D.literal(1), a: D.string }),
[2]: D.type({ type: D.literal(2), b: D.number })
})
2.2.11
- Experimental
Decoder- make
toForeststack-safe, #520 (@safareli)
- make
2.2.10
- Polish
- expose modules without lib/es6 prefix, #507 (@osdiab)
2.2.9
- Polish
- remove
Object.freezecalls, closes #497 (@gcanti)
- remove
- Experimental
DecodeError- add
Wrapmember (@gcanti)
- add
Decoder- add
withMessagecombinator (@gcanti)
- add
TaskDecoder- add
withMessagecombinator (@gcanti)
- add
2.2.8
- Experimental
- (*) remove
KleisliDecodermodule (@gcanti) - (*) remove
KleisliTaskDecodermodule (@gcanti) - (*) remove
JsonCodecmodule (@gcanti) - (*) remove
JsonEncodermodule (@gcanti) Codec- (*) make
Codecmore general by adding aItype parameter (@gcanti) - add
fromTypefunction (@gcanti) - add
fromPartialfunction (@gcanti) - add
fromArrayfunction (@gcanti) - add
fromRecordfunction (@gcanti) - add
fromTuplefunction (@gcanti) - add
fromSumfunction (@gcanti) - add
composefunction (@gcanti)
- (*) make
Decoder- (*) make
Decodermore general by adding aItype parameter (@gcanti) - add
fromRefinementfunction (@gcanti) - change
fromGuardsignature (@gcanti) - add
fromTypefunction (@gcanti) - add
fromPartialfunction (@gcanti) - add
fromArrayfunction (@gcanti) - add
fromRecordfunction (@gcanti) - add
fromTuplefunction (@gcanti) - add
fromSumfunction (@gcanti) - add
composefunction (@gcanti) - add
idfunction (@gcanti) - (*) rename
functorDecoderinstance toFunctor(@gcanti) - (*) rename
altDecoderinstance toAlt(@gcanti) - (*) rename and split
schemableDecoder(@gcanti) - add
Categoryinstance (@gcanti) - add
InputOftype (@gcanti)
- (*) make
TaskDecoder- (*) make
TaskDecodermore general by adding aItype parameter (@gcanti) - add
fromRefinementfunction (@gcanti) - change
fromDecodersignature (@gcanti) - add
fromTypefunction (@gcanti) - add
fromPartialfunction (@gcanti) - add
fromArrayfunction (@gcanti) - add
fromRecordfunction (@gcanti) - add
fromTuplefunction (@gcanti) - add
fromSumfunction (@gcanti) - add
composefunction (@gcanti) - add
idfunction (@gcanti) - (*) rename
functorTaskDecoderinstance toFunctor(@gcanti) - (*) rename
altTaskDecoderinstance toAlt(@gcanti) - (*) rename and split
schemableTaskDecoder(@gcanti) - add
Categoryinstance (@gcanti) - add
InputOftype (@gcanti)
- (*) make
Guard- (*) make
Guardmore general by adding aItype parameter (@gcanti) - (*) rename
schemableGuard(@gcanti) - add
InputOftype (@gcanti) - add
altfunction (@gcanti) - add
zerofunction (@gcanti) - add
composefunction (@gcanti) - add
idfunction (@gcanti)
- (*) make
Codec- (*) rename
invariantCodectoInvariant(@gcanti)
- (*) rename
Encoder- (*) rename
contravariantEncodertoContravariant(@gcanti) - (*) rename
categoryEncodertoCategory(@gcanti)
- (*) rename
Eq- (*) rename and split
schemableEq(@gcanti)
- (*) rename and split
Kleisli- add
id(@gcanti) - rename
typetofromType(@gcanti) - rename
partialtofromPartial(@gcanti) - rename
arraytofromArray(@gcanti) - rename
recordtofromRecord(@gcanti) - rename
tupletofromTuple(@gcanti) - rename
sumtofromSum(@gcanti)
- add
Schemable- add
Schemable2C,WithUnknownContainers2C,WithUnion2C,WithRefine2C(@gcanti)
- add
Type- (*) rename and split
schemableType(@gcanti)
- (*) rename and split
- (*) remove
(*) breaking change
2.2.7
- Experimental
- add
DecodeErrormodule (@gcanti) - add
FreeSemigroupmodule (@gcanti) - add
TaskDecodermodule (@gcanti) - add
Kleislimodule (@gcanti) - add
KleisliDecodermodule (@gcanti) - add
KleisliTaskDecodermodule (@gcanti) - (*) remove
NaNfromnumberinstances (@gcanti) - (*) remove
Treemodule (@gcanti) - (*) make
Jsontype immutable (@gcanti) Decoder- (*) remove
never(@gcanti) - (*) make
parsepipeable and change itsparserargument (@gcanti) - (*) change
DecoderError(@gcanti) - (*) remove
withExpectedin favour ofmapLeftWithInput(@gcanti)
- (*) remove
Guard- (*) remove
never(@gcanti)
- (*) remove
Schemable- (*) better
literalsignature (@gcanti) - (*) better
unionsignature (@gcanti) - (*) make intersections pipeables (@gcanti)
- (*) make refinements pipeables (@gcanti)
- (*) better
- add
(*) breaking change
2.2.6
- Experimental
Decoder- add support for non-
stringtag values tosum, closes #481 (@gcanti) intersectionshould accumulate all errors (@gcanti)
- add support for non-
2.2.5
- Experimental
- fix type information lost from nested decoder types, #479 (@gcanti)
JsonEncoder- change
idsignature (@gcanti)
- change
2.2.4
- Polish
- remove the dependency on the
eitherinstance as a mean of improving tree shaking (@gcanti)
- remove the dependency on the
2.2.3
- Polish
- use the built-in
Readonlytype inreadonlycombinator, closes #472 (@gcanti)
- use the built-in
- Experimental
- split instances (@gcanti)
- add
Typeexperimental module, #464 (@gcanti) - restore the
Otype parameter toEncoder, #469 (@gcanti) - add the
Otype parameter toCodec(@gcanti) - add
JsonCodecexperimental module (@gcanti) - add
JsonEncoderexperimental module (@gcanti) Schemable- rename
Schemableinterface toSchemable1(@gcanti) - rename
WithUnioninterface toWithUnion1(@gcanti) - add
Schemableinterface (@gcanti) - add
WithUnioninterface (@gcanti) - add
WithRefinement/WithRefinement1interfaces (@gcanti) - add
WithUnknownContainers/WithUnknownContainers1interfaces (@gcanti)- move
UnknownArrayandUnknownRecordtoWithUnknownContainers(@gcanti)
- move
- rename
Schema- refactoring with the new
Schemableinterface (@gcanti) - add
interpreterfunction (@gcanti)
- refactoring with the new
- Internal
- upgrade to
typescript@3.9.3(@gcanti)
- upgrade to
2.2.2
- Experimental
- add
Eqmodule (@gcanti) Codec- add
TypeOfoperator (@gcanti)
- add
Decoder- add
DecodeErrorinterface (@gcanti)
- add
Encoder- add
TypeOfoperator (@gcanti)
- add
Guard- add
TypeOfoperator (@gcanti)
- add
- add
2.2.1
- Experimental
Decoder- collect all errors while decoding, closes #449 (@gcanti)
2.2.0
- Experimental
- add
Codec,Decoder,Encoder,Guard,Schema,Schemable,Treemodules (@gcanti)
- add
2.1.3
- Polish
- remove useless
hasOwnPropertycalls, closes #423 (@gcanti)
- remove useless
2.1.1
- Bug Fix
- fix
recorddomain handling, closes #391 (@gcanti)
- fix
2.1.0
- New Feature
- add
bigintcodec (@mixedCase)
- add
2.0.6
- Bug Fix
- whitelist
windowinUnknownRecord, fix #413 (@gcanti)
- whitelist
2.0.5
- Bug Fix
partialshouldn't allow arrays, fix #407 (@gcanti)
2.0.4
- Bug Fix
- remove getters, fix #404 (@gcanti)
2.0.3
- Bug Fix
- rewrite es6 imports (@gcanti)
2.0.2
- Bug Fix
- fix #397 (@gcanti)
2.0.1
- Bug Fix
- fix
getTagsalgorithm for mutually recursive codecs, closes #354 (@gcanti)
- fix
2.0.0
- Breaking Change
- upgrade to
fp-ts@2.x(@gcanti) - move
fp-tstopeerDependencies(@gcanti)
- upgrade to
1.10.4
- Polish
- remove unneeded internal code (@gcanti)
1.10.3
- Bug Fix
- revert
1.10.0compatibility, fix #344 (@gcanti)
- revert
1.10.2
- Bug Fix
- move
fp-tsback to dependencies (@gcanti)
- move
1.10.1
- Bug Fix
- handle
strict,exactandrefinementcodecs when optimizing tagged unions, fix #339 (@gcanti)
- handle
1.10.0
- New Feature
- make
io-tscompatible with bothfp-ts@1.x,fp-ts@2.x(@gcanti)
- make
1.9.0
- New Feature
unionis now able to detect and optimize tagged unions (@gcanti)
- Deprecation
- deprecate
taggedUnionin favour ofunion(@gcanti)
- deprecate
1.8.6
output ES modules to better support tree-shaking, closes #326 (@gcanti)
1.8.5
- Bug Fix
- change how types and output types are retrieved in
IntersectionCandTupleC, fix #315 (@gcanti)
- change how types and output types are retrieved in
1.8.4
- Polish
- autobind
decodemethod (@gcanti)
- autobind
1.8.3
- Polish
- add
stripInternalflag totsconfig.json(@gcanti) - handle
NaNinPathReporter(@gcanti) - throw if union encoding doesn't find a usable codec (@leemhenson)
- add
- Deprecation
- deprecate
NeverType(@gcanti) - deprecate
FunctionType(@gcanti)
- deprecate
1.8.2
- Bug Fix
- align the runtime behavior of
Exact.iswith the type system, fix #288 (@gcanti)
- align the runtime behavior of
1.8.1
- New Feature
- add
brandcombinator (@gcanti, @lostintime) - add
Intcodec (@gcanti) exactstrips additional properties while decoding / encoding (@gcanti)- un-deprecate
strictcombinator, is now an alias ofexact(type(...))(@gcanti)
- add
- Bug Fix
- fix wrong context keys for tagged unions (@gcanti)
- Deprecation
- deprecate
refinementcombinator in favour ofbrand(@gcanti) - deprecate
Integercodec in favour ofInt(@gcanti) - deprecate
StrictTypeclass (@gcanti) - deprecate
StrictCinterface (@gcanti)
- deprecate
- Polish
- modify the implementation of
intersectionin order to support combinators that strip additional properties (@gcanti) - do not validate the codomain of a key of a record if its domain in invalid (@gcanti)
- normalize missing
messagefield inValidationError(@gcanti) - fix name of recursive codec definitions (@gcanti)
- remove unexpected validation path from partial type, closes #195 (@gcanti)
- do not leak taggedUnion implementation when tag validation fails (@gcanti)
- add
actualvalue to all context entries (@gcanti) exactnow bails out when the value is not anUnknownRecord(@gcanti)tupleshould not leak the implementation (neverusage) (@gcanti)exactshould not leak the implementation (neverusage) (@gcanti)- use
Number.isIntegerinIntegerimplementation (@gcanti) - use the Flow convention to name
exactcodecs (@gcanti)
- modify the implementation of
1.7.1
- Deprecation
- deprecate
any(@gcanti) - deprecate
object(@gcanti) - deprecate
Dictionaryin favour ofUnknownRecord(@gcanti) - deprecate
Arrayin favour ofUnknownArray(@gcanti) - deprecate
dictionaryin favour ofrecord(@gcanti)
- deprecate
1.7.0
- New Feature
- better support for custom messages, closes #148 (@gcanti)
- add optional message field to
ValidationError - add
messageargument tofailure PathReportershould account for the new field
- add optional message field to
- add
actualoptional field toContextEntry, closes #194 (@gcanti)
- better support for custom messages, closes #148 (@gcanti)
- Deprecation
- deprecate
getValidationError(@gcanti) - deprecate
getDefaultContext(@gcanti)
- deprecate
1.6.4
- Bug Fix
getIndexRecord: getIndexRecord: handle conflicting tags in different positions, ref #263 (@gcanti)
- Experimental
- added a warning to the console if a tagged union cannot be created (@gcanti)
- revert
unionoptimization, needs more work to make it happen (@gcanti)
1.6.3
- Bug Fix
- prevent maximum call stack size exceeded when indexing recursive codecs, closes #259 (@gcanti)
1.6.2
- Polish
- make
isIndexableCodecmore strict (@gcanti)
- make
1.6.1
- Bug Fix
taggedUnionshould handle sub unions / tagged unions correctly, closes #257 (@gcanti)
- Experimental
- optimize
unionwith the same algorithm used intaggedUnion(@gcanti)
- optimize
1.6.0
Important. This version requires typescript@3.2.2+
- New Feature
- leverage
typescript@3.2.2(@gcanti)TypeCPartialCRecordCUnionCReadonlyCStrictCTaggedUnionC
- leverage
1.5.3
- Bug Fix
- missing context info while decoding an intersection, fix #246 (@gcanti)
- Experimental
- add intermediary interfaces, closes #165 (@gcanti)
NullCUndefinedCVoidCAnyCUnknownCNeverCStringCNumberCBooleanCUnknownArrayCUnknownRecordCObjectCFunctionCRefinementCLiteralCKeyofCArrayCTypeCPartialCRecordCUnionCIntersectionCTupleCReadonlyCReadonlyArrayCStrictCTaggedUnionCExactC
- add intermediary interfaces, closes #165 (@gcanti)
- Polishs
- use rest elements in tuple types (
typescript@3.0.1feature) (@gcanti) unionshould handle zero types (@gcanti)intersectionshould handle zero / one types (@gcanti)
- use rest elements in tuple types (
- Deprecation
- deprecate
clean(@gcanti) - deprecate
alias(@gcanti) - deprecate
PropsOftype (@gcanti) - deprecate
Exacttype (@gcanti)
- deprecate
1.5.2
- Deprecation
- deprecate
Compacttype (@gcanti)
- deprecate
1.5.1
- Polish
- remove useless module augmentation of
Array(@gcanti)
- remove useless module augmentation of
1.5.0
- New Feature
- add
UnknownType, closes #238 (@gcanti)
- add
- Deprecation
ThrowReporteris now deprecated (@gcanti)
1.4.2
use Compact in intersection signatures as a workaround for #234 (@sledorze)
1.4.1
- Polish
Type.prototype.pipenow allows more types as input, #231 #232 (@sledorze)
1.4.0
- New Feature
- use
unknownasmixed(@gcanti)
- use
1.3.4
- Bug Fix
- should emit expected keys while decoding, fix #214 (@gcanti)
1.3.3
- Bug Fix
- align
TaggedExactdefinition with siblings, fix #223 (@gcanti)
- align
1.3.2
- Bug Fix
- dictionary type should not allow arrays, fix #218 (@gcanti)
1.3.1
- Polish
- use interface instead of type alias (@gcanti)
ContextErrorsAnyMixed
- use interface instead of type alias (@gcanti)
1.3.0
- New Feature
- add
TaggedUnionType(@gcanti)
- add
1.2.1
- Polish
- allow recursive types in tagged unions (@gcanti)
1.2.0
- New Feature
- add
voidruntime type (@gcanti)
- add
1.1.5
- Bug Fix
- partial combinator should preserve additional properties while encoding, fixes #179 (@gcanti)
- Polish
- use
useIdentitywhen possible (@gcanti)
- use
1.1.4
- Internal
- fix broken build with
typescript@2.9.1, closes #174 (@gcanti)
- fix broken build with
1.1.3
- Internal
- upgrade to
typings-checker@2.0.0(@gcanti)
- upgrade to
1.1.2
- Bug Fix
- fix
aliasimplementation (@gcanti) - handle exact types in
isTagged(@gcanti)
- fix
1.1.1
- Experimental
- add
clean/aliasfunctions, closes #149 (@gcanti) - add
exactcombinator (@gcanti)- the
strictcombinator is deprecated
- the
- remove
optionalcombinator (@gcanti)- it doesn't play well with advanced combinators, see here for a discussion
- add
1.0.6
- Bug Fix
taggedUnionfails to decode when tag values are not string literals, fix #161 (@gcanti)
1.0.5
- Bug Fix
- workaround for upstream TypeScript bug 14041 (wrong generated declarations) (@gcanti)
- Internal
- optimize InterfaceType.encode (@gcanti)
- use definite assignment assertion for phantom fields (@gcanti)
1.0.4
- Bug Fix
- make
Contextreadonly (@gcanti)
- make
- Internal
- optimizations, #137 (@gcanti, @sledorze)
1.0.3
- Internal
- optimizations, #134 (@gcanti, @sledorze)
1.0.2
- Bug Fix
- fix
OutputOfPartialPropsname (@gcanti)
- fix
1.0.1
- Bug Fix
- fix
AnyTypeby extendingType<any>(@gcanti)
- fix
1.0.0
- Breaking Change
- upgrade to
fp-ts@1.0.0 - see https://github.com/gcanti/io-ts/pull/112 (@gcanti)
- upgrade to
0.9.8
- New Feature
- add decode and deprecate top level validate (@gcanti)
- Internal
- when checking validations use methods instead of top level functions (@gcanti)
0.9.7
- New Feature
- add
taggedUnioncombinator (@gcanti, @sledorze)
- add
0.9.6
- New Feature
recursivecombinator- add support for mutually recursive types, closes #114 (@gcanti)
- make it safer:
RTnow must extendType<mixed, A>(@gcanti)
0.9.5
- New Feature
- add
mixedtype (@gcanti) - replace
anywithmixedin all input type parameters (@gcanti)-export class StringType extends Type<any, string> { +export class StringType extends Type<mixed, string> { }
- add
0.9.4
- Bug Fix
- strict: should succeed validating an undefined field, closes #106 (@gcanti)
0.9.3
- Bug Fix
- revert 37c74a5e2038de063a950f9ba8d18b1f132ef450, closes #8 (@gcanti)
0.9.2
- New Feature
- add
Decoder/Encoderinterfaces (@sledorze, @gcanti)
- add
- Internal
- perf optimizations (@sledorze, @gcanti)
0.9.1
- Bug Fix
- make all classes "dumb", fix #95 (@gcanti)
0.9.0
- Breaking Change
- remove
t.mapandt.mapWithName(in general doesn't look serializable, needs more investigation) - remove
t.prism(in general doesn't look serializable, needs more investigation) - change
Typefrom interface to class and addStype parameter- remove
t._A
- remove
- add
Type#serialize - add
Type#is(in order to serialize unions and while we're at it, looks useful anyway) - remove
t.is(now that there'sType#isis misleading)
- remove
- Experimental
- add Flowtype support (@gcanti)
0.8.2
- New Feature
- add
objecttype, closes #86 (@gcanti)
- add
0.8.1
- New Feature
- add
strictcombinator, closes #84 (@phiresky, @gcanti)
- add
0.8.0
- Breaking Change
- upgrade
fp-tsdependency (@gcanti)
- upgrade
0.7.2
- Bug Fix
- tag recursive types, fix #80 (@gcanti)
0.7.1
- Bug Fix
- incorrect compile time type for dictionary, fix #75 (@gcanti)
0.7.0
- Breaking Change
- upgrade to latest fp-ts (0.5.1) (@gcanti)
0.6.2
- New Feature
- add aliases for
nullandinterface, closes #63 (@gcanti)
- add aliases for
0.6.1
- Internal
- handle latest fp-ts (0.4.3) (@gcanti)
0.6.0
- Breaking Change
- upgrade to latest fp-ts (0.4.0) (@gcanti)
- Internal
- allow for infinite unions (@gcanti)
0.5.1
- Bug Fix
- export and rename
interfaceTypeto_interface, fix #57 (@gcanti)
- export and rename
0.5.0
- Breaking Change
Typeis now an interface- types no more own a
ismethod, uset.isinstead - unions no more own a
foldmethod Reporter,PathReporter,ThrowReporterare now top level modules
0.4.0
- Breaking Change
- upgrade to latest
fp-ts(io-tsAPIs are not changed though) (@gcanti) - drop
lib-jsnextfolder
- upgrade to latest
0.3.2
- Bug Fix
- remove excess overloadings, fix #43 (@gcanti)
0.3.1
- New Feature
- add mapWithName and Functor instance, fix #37 (@gcanti)
- add prism combinator, fix #41 (@gcanti)
0.3.0
This is a breaking change only if you are using fp-ts APIs
- Breaking Change
- upgrade to latest fp-ts v0.2 (@gcanti)
0.2.3
- Internal
- upgrade to fp-ts v0.1 (@gcanti)
0.2.2
- New Feature
- add
partialcombinator (makes optional props possible) - add
readonlycombinator (values are not frozen in production) - add
readonlyArraycombinator (values are not frozen in production) - add
nevertype
- add
- Breaking Changes
- remove
maybecombinator, can be defined in userland asexport function maybe<RT extends t.Any>( type: RT, name?: string ): t.UnionType<[RT, typeof t.null], t.TypeOf<RT> | null> { return t.union([type, t.null], name) }
- remove
- Polish
- export
pathReporterFailurefunction from default reporters
- export
- Bug Fix
- revert pruning excess properties (see https://github.com/gcanti/io-ts/pull/27 for context)
- revert
intersectioncombinator accepting onlyInterfaceTypes
- Experimental
- Pattern matching / catamorphism for unions
0.1.0
-
New Feature
- add support for jsnext
- add
Integertype
-
Breaking Changes
t.Objecttype. Renamed tot.Dictionary, now accepts arrays so is fully equivalent to{ [key: string]: any }.t.instanceOfcombinator. Removed.t.objectcombinator. Renamed tot.interface.ObjectTypetoInterfaceType. Excess properties are now pruned.mappingcombinator. Renamed todictionary.MappingTypetoDictionaryType.intersectioncombinator. Due to the new excess property pruning int.interfacenow only acceptInterfaceTypes.- API
isSuccessremoved, useeither.isRightinstead - API
isFailureremoved, useeither.isLeftinstead - API
fromValidationremoved
0.0.2
- Bug Fix
- reverse overloading definitions for unions, intersections and tuples, fix inference bug
0.0.1
Initial release