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.
- Bug Fix
- Test for readonly type when optimizing tagged unions, #719
- Bug Fix
- Handle
record
keys outsidedomain
, #705 (@tgfisher4)
- Handle
- 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
- Bug Fix
- allow
Error
to be decoded withUnknownRecord
, #664 (@mlegenhausen)
- allow
- Bug Fix
- fix
[email protected]
errors, closes #656, closes #647 (@gcanti)
- fix
- Bug Fix
- Don't throw a TypeError when trying to decode a sum value that contains a dangerous string, #650 (@thewilkybarkid)
Experimental modules require fp-ts@^2.5.0
.
- Experimental
Codec
- add
readonly
combinator (@gcanti)
- add
Encoder
- add
readonly
combinator (@gcanti)
- add
- Experimental
Schemable
- (*) add
readonly
combinator (@gcanti) - (*) add
struct
combinator (@gcanti)
- (*) add
- deprecate
type
in favour ofstruct
(@gcanti) - deprecate
fromType
in favour offromStruct
(@gcanti)
(*) breaking change
- Experimental
Guard
- relax
UnknownRecord
check, closes #559 (@waynevanson)
- relax
- Bug Fix
- improve internal
mergeAll
function, closes #532 (@gcanti)
- improve internal
- Experimental
- (*) make
sum
safer, 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 })
})
- Experimental
Decoder
- make
toForest
stack-safe, #520 (@safareli)
- make
- Polish
- expose modules without lib/es6 prefix, #507 (@osdiab)
- Polish
- remove
Object.freeze
calls, closes #497 (@gcanti)
- remove
- Experimental
DecodeError
- add
Wrap
member (@gcanti)
- add
Decoder
- add
withMessage
combinator (@gcanti)
- add
TaskDecoder
- add
withMessage
combinator (@gcanti)
- add
- Experimental
- (*) remove
KleisliDecoder
module (@gcanti) - (*) remove
KleisliTaskDecoder
module (@gcanti) - (*) remove
JsonCodec
module (@gcanti) - (*) remove
JsonEncoder
module (@gcanti) Codec
- (*) make
Codec
more general by adding aI
type parameter (@gcanti) - add
fromType
function (@gcanti) - add
fromPartial
function (@gcanti) - add
fromArray
function (@gcanti) - add
fromRecord
function (@gcanti) - add
fromTuple
function (@gcanti) - add
fromSum
function (@gcanti) - add
compose
function (@gcanti)
- (*) make
Decoder
- (*) make
Decoder
more general by adding aI
type parameter (@gcanti) - add
fromRefinement
function (@gcanti) - change
fromGuard
signature (@gcanti) - add
fromType
function (@gcanti) - add
fromPartial
function (@gcanti) - add
fromArray
function (@gcanti) - add
fromRecord
function (@gcanti) - add
fromTuple
function (@gcanti) - add
fromSum
function (@gcanti) - add
compose
function (@gcanti) - add
id
function (@gcanti) - (*) rename
functorDecoder
instance toFunctor
(@gcanti) - (*) rename
altDecoder
instance toAlt
(@gcanti) - (*) rename and split
schemableDecoder
(@gcanti) - add
Category
instance (@gcanti) - add
InputOf
type (@gcanti)
- (*) make
TaskDecoder
- (*) make
TaskDecoder
more general by adding aI
type parameter (@gcanti) - add
fromRefinement
function (@gcanti) - change
fromDecoder
signature (@gcanti) - add
fromType
function (@gcanti) - add
fromPartial
function (@gcanti) - add
fromArray
function (@gcanti) - add
fromRecord
function (@gcanti) - add
fromTuple
function (@gcanti) - add
fromSum
function (@gcanti) - add
compose
function (@gcanti) - add
id
function (@gcanti) - (*) rename
functorTaskDecoder
instance toFunctor
(@gcanti) - (*) rename
altTaskDecoder
instance toAlt
(@gcanti) - (*) rename and split
schemableTaskDecoder
(@gcanti) - add
Category
instance (@gcanti) - add
InputOf
type (@gcanti)
- (*) make
Guard
- (*) make
Guard
more general by adding aI
type parameter (@gcanti) - (*) rename
schemableGuard
(@gcanti) - add
InputOf
type (@gcanti) - add
alt
function (@gcanti) - add
zero
function (@gcanti) - add
compose
function (@gcanti) - add
id
function (@gcanti)
- (*) make
Codec
- (*) rename
invariantCodec
toInvariant
(@gcanti)
- (*) rename
Encoder
- (*) rename
contravariantEncoder
toContravariant
(@gcanti) - (*) rename
categoryEncoder
toCategory
(@gcanti)
- (*) rename
Eq
- (*) rename and split
schemableEq
(@gcanti)
- (*) rename and split
Kleisli
- add
id
(@gcanti) - rename
type
tofromType
(@gcanti) - rename
partial
tofromPartial
(@gcanti) - rename
array
tofromArray
(@gcanti) - rename
record
tofromRecord
(@gcanti) - rename
tuple
tofromTuple
(@gcanti) - rename
sum
tofromSum
(@gcanti)
- add
Schemable
- add
Schemable2C
,WithUnknownContainers2C
,WithUnion2C
,WithRefine2C
(@gcanti)
- add
Type
- (*) rename and split
schemableType
(@gcanti)
- (*) rename and split
- (*) remove
(*) breaking change
- Experimental
- add
DecodeError
module (@gcanti) - add
FreeSemigroup
module (@gcanti) - add
TaskDecoder
module (@gcanti) - add
Kleisli
module (@gcanti) - add
KleisliDecoder
module (@gcanti) - add
KleisliTaskDecoder
module (@gcanti) - (*) remove
NaN
fromnumber
instances (@gcanti) - (*) remove
Tree
module (@gcanti) - (*) make
Json
type immutable (@gcanti) Decoder
- (*) remove
never
(@gcanti) - (*) make
parse
pipeable and change itsparser
argument (@gcanti) - (*) change
DecoderError
(@gcanti) - (*) remove
withExpected
in favour ofmapLeftWithInput
(@gcanti)
- (*) remove
Guard
- (*) remove
never
(@gcanti)
- (*) remove
Schemable
- (*) better
literal
signature (@gcanti) - (*) better
union
signature (@gcanti) - (*) make intersections pipeables (@gcanti)
- (*) make refinements pipeables (@gcanti)
- (*) better
- add
(*) breaking change
- Experimental
Decoder
- add support for non-
string
tag values tosum
, closes #481 (@gcanti) intersection
should accumulate all errors (@gcanti)
- add support for non-
- Experimental
- fix type information lost from nested decoder types, #479 (@gcanti)
JsonEncoder
- change
id
signature (@gcanti)
- change
- Polish
- remove the dependency on the
either
instance as a mean of improving tree shaking (@gcanti)
- remove the dependency on the
- Polish
- use the built-in
Readonly
type inreadonly
combinator, closes #472 (@gcanti)
- use the built-in
- Experimental
- split instances (@gcanti)
- add
Type
experimental module, #464 (@gcanti) - restore the
O
type parameter toEncoder
, #469 (@gcanti) - add the
O
type parameter toCodec
(@gcanti) - add
JsonCodec
experimental module (@gcanti) - add
JsonEncoder
experimental module (@gcanti) Schemable
- rename
Schemable
interface toSchemable1
(@gcanti) - rename
WithUnion
interface toWithUnion1
(@gcanti) - add
Schemable
interface (@gcanti) - add
WithUnion
interface (@gcanti) - add
WithRefinement
/WithRefinement1
interfaces (@gcanti) - add
WithUnknownContainers
/WithUnknownContainers1
interfaces (@gcanti)- move
UnknownArray
andUnknownRecord
toWithUnknownContainers
(@gcanti)
- move
- rename
Schema
- refactoring with the new
Schemable
interface (@gcanti) - add
interpreter
function (@gcanti)
- refactoring with the new
- Internal
- upgrade to
[email protected]
(@gcanti)
- upgrade to
- Experimental
- add
Eq
module (@gcanti) Codec
- add
TypeOf
operator (@gcanti)
- add
Decoder
- add
DecodeError
interface (@gcanti)
- add
Encoder
- add
TypeOf
operator (@gcanti)
- add
Guard
- add
TypeOf
operator (@gcanti)
- add
- add
- Experimental
Decoder
- collect all errors while decoding, closes #449 (@gcanti)
- Experimental
- add
Codec
,Decoder
,Encoder
,Guard
,Schema
,Schemable
,Tree
modules (@gcanti)
- add
- Polish
- remove useless
hasOwnProperty
calls, closes #423 (@gcanti)
- remove useless
- Bug Fix
- fix
record
domain handling, closes #391 (@gcanti)
- fix
- New Feature
- add
bigint
codec (@mixedCase)
- add
- Bug Fix
- whitelist
window
inUnknownRecord
, fix #413 (@gcanti)
- whitelist
- Bug Fix
partial
shouldn't allow arrays, fix #407 (@gcanti)
- Bug Fix
- remove getters, fix #404 (@gcanti)
- Bug Fix
- rewrite es6 imports (@gcanti)
- Bug Fix
- fix #397 (@gcanti)
- Bug Fix
- fix
getTags
algorithm for mutually recursive codecs, closes #354 (@gcanti)
- fix
- Breaking Change
- upgrade to
[email protected]
(@gcanti) - move
fp-ts
topeerDependencies
(@gcanti)
- upgrade to
- Polish
- remove unneeded internal code (@gcanti)
- Bug Fix
- revert
1.10.0
compatibility, fix #344 (@gcanti)
- revert
- Bug Fix
- move
fp-ts
back to dependencies (@gcanti)
- move
- Bug Fix
- handle
strict
,exact
andrefinement
codecs when optimizing tagged unions, fix #339 (@gcanti)
- handle
- New Feature
- make
io-ts
compatible with both[email protected]
,[email protected]
(@gcanti)
- make
- New Feature
union
is now able to detect and optimize tagged unions (@gcanti)
- Deprecation
- deprecate
taggedUnion
in favour ofunion
(@gcanti)
- deprecate
output ES modules to better support tree-shaking, closes #326 (@gcanti)
- Bug Fix
- change how types and output types are retrieved in
IntersectionC
andTupleC
, fix #315 (@gcanti)
- change how types and output types are retrieved in
- Polish
- autobind
decode
method (@gcanti)
- autobind
- Polish
- add
stripInternal
flag totsconfig.json
(@gcanti) - handle
NaN
inPathReporter
(@gcanti) - throw if union encoding doesn't find a usable codec (@leemhenson)
- add
- Deprecation
- deprecate
NeverType
(@gcanti) - deprecate
FunctionType
(@gcanti)
- deprecate
- Bug Fix
- align the runtime behavior of
Exact.is
with the type system, fix #288 (@gcanti)
- align the runtime behavior of
- New Feature
- add
brand
combinator (@gcanti, @lostintime) - add
Int
codec (@gcanti) exact
strips additional properties while decoding / encoding (@gcanti)- un-deprecate
strict
combinator, is now an alias ofexact(type(...))
(@gcanti)
- add
- Bug Fix
- fix wrong context keys for tagged unions (@gcanti)
- Deprecation
- deprecate
refinement
combinator in favour ofbrand
(@gcanti) - deprecate
Integer
codec in favour ofInt
(@gcanti) - deprecate
StrictType
class (@gcanti) - deprecate
StrictC
interface (@gcanti)
- deprecate
- Polish
- modify the implementation of
intersection
in 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
message
field 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
actual
value to all context entries (@gcanti) exact
now bails out when the value is not anUnknownRecord
(@gcanti)tuple
should not leak the implementation (never
usage) (@gcanti)exact
should not leak the implementation (never
usage) (@gcanti)- use
Number.isInteger
inInteger
implementation (@gcanti) - use the Flow convention to name
exact
codecs (@gcanti)
- modify the implementation of
- Deprecation
- deprecate
any
(@gcanti) - deprecate
object
(@gcanti) - deprecate
Dictionary
in favour ofUnknownRecord
(@gcanti) - deprecate
Array
in favour ofUnknownArray
(@gcanti) - deprecate
dictionary
in favour ofrecord
(@gcanti)
- deprecate
- New Feature
- better support for custom messages, closes #148 (@gcanti)
- add optional message field to
ValidationError
- add
message
argument tofailure
PathReporter
should account for the new field
- add optional message field to
- add
actual
optional field toContextEntry
, closes #194 (@gcanti)
- better support for custom messages, closes #148 (@gcanti)
- Deprecation
- deprecate
getValidationError
(@gcanti) - deprecate
getDefaultContext
(@gcanti)
- deprecate
- 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
union
optimization, needs more work to make it happen (@gcanti)
- Bug Fix
- prevent maximum call stack size exceeded when indexing recursive codecs, closes #259 (@gcanti)
- Polish
- make
isIndexableCodec
more strict (@gcanti)
- make
- Bug Fix
taggedUnion
should handle sub unions / tagged unions correctly, closes #257 (@gcanti)
- Experimental
- optimize
union
with the same algorithm used intaggedUnion
(@gcanti)
- optimize
Important. This version requires [email protected]+
- New Feature
- leverage
[email protected]
(@gcanti)TypeC
PartialC
RecordC
UnionC
ReadonlyC
StrictC
TaggedUnionC
- leverage
- Bug Fix
- missing context info while decoding an intersection, fix #246 (@gcanti)
- Experimental
- add intermediary interfaces, closes #165 (@gcanti)
NullC
UndefinedC
VoidC
AnyC
UnknownC
NeverC
StringC
NumberC
BooleanC
UnknownArrayC
UnknownRecordC
ObjectC
FunctionC
RefinementC
LiteralC
KeyofC
ArrayC
TypeC
PartialC
RecordC
UnionC
IntersectionC
TupleC
ReadonlyC
ReadonlyArrayC
StrictC
TaggedUnionC
ExactC
- add intermediary interfaces, closes #165 (@gcanti)
- Polishs
- use rest elements in tuple types (
[email protected]
feature) (@gcanti) union
should handle zero types (@gcanti)intersection
should handle zero / one types (@gcanti)
- use rest elements in tuple types (
- Deprecation
- deprecate
clean
(@gcanti) - deprecate
alias
(@gcanti) - deprecate
PropsOf
type (@gcanti) - deprecate
Exact
type (@gcanti)
- deprecate
- Deprecation
- deprecate
Compact
type (@gcanti)
- deprecate
- Polish
- remove useless module augmentation of
Array
(@gcanti)
- remove useless module augmentation of
- New Feature
- add
UnknownType
, closes #238 (@gcanti)
- add
- Deprecation
ThrowReporter
is now deprecated (@gcanti)
use Compact
in intersection
signatures as a workaround for #234 (@sledorze)
- Polish
Type.prototype.pipe
now allows more types as input, #231 #232 (@sledorze)
- New Feature
- use
unknown
asmixed
(@gcanti)
- use
- Bug Fix
- should emit expected keys while decoding, fix #214 (@gcanti)
- Bug Fix
- align
TaggedExact
definition with siblings, fix #223 (@gcanti)
- align
- Bug Fix
- dictionary type should not allow arrays, fix #218 (@gcanti)
- Polish
- use interface instead of type alias (@gcanti)
Context
Errors
Any
Mixed
- use interface instead of type alias (@gcanti)
- New Feature
- add
TaggedUnionType
(@gcanti)
- add
- Polish
- allow recursive types in tagged unions (@gcanti)
- New Feature
- add
void
runtime type (@gcanti)
- add
- Bug Fix
- partial combinator should preserve additional properties while encoding, fixes #179 (@gcanti)
- Polish
- use
useIdentity
when possible (@gcanti)
- use
- Internal
- fix broken build with
[email protected]
, closes #174 (@gcanti)
- fix broken build with
- Internal
- upgrade to
[email protected]
(@gcanti)
- upgrade to
- Bug Fix
- fix
alias
implementation (@gcanti) - handle exact types in
isTagged
(@gcanti)
- fix
- Experimental
- add
clean
/alias
functions, closes #149 (@gcanti) - add
exact
combinator (@gcanti)- the
strict
combinator is deprecated
- the
- remove
optional
combinator (@gcanti)- it doesn't play well with advanced combinators, see here for a discussion
- add
- Bug Fix
taggedUnion
fails to decode when tag values are not string literals, fix #161 (@gcanti)
- 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)
- Bug Fix
- make
Context
readonly (@gcanti)
- make
- Internal
- optimizations, #137 (@gcanti, @sledorze)
- Internal
- optimizations, #134 (@gcanti, @sledorze)
- Bug Fix
- fix
OutputOfPartialProps
name (@gcanti)
- fix
- Bug Fix
- fix
AnyType
by extendingType<any>
(@gcanti)
- fix
- Breaking Change
- upgrade to
[email protected]
- see #112 (@gcanti)
- upgrade to
- New Feature
- add decode and deprecate top level validate (@gcanti)
- Internal
- when checking validations use methods instead of top level functions (@gcanti)
- New Feature
- add
taggedUnion
combinator (@gcanti, @sledorze)
- add
- New Feature
recursive
combinator- add support for mutually recursive types, closes #114 (@gcanti)
- make it safer:
RT
now must extendType<mixed, A>
(@gcanti)
- New Feature
- add
mixed
type (@gcanti) - replace
any
withmixed
in all input type parameters (@gcanti)-export class StringType extends Type<any, string> { +export class StringType extends Type<mixed, string> { }
- add
- Bug Fix
- strict: should succeed validating an undefined field, closes #106 (@gcanti)
- Bug Fix
- revert 37c74a5e2038de063a950f9ba8d18b1f132ef450, closes #8 (@gcanti)
- New Feature
- add
Decoder
/Encoder
interfaces (@sledorze, @gcanti)
- add
- Internal
- perf optimizations (@sledorze, @gcanti)
- Bug Fix
- make all classes "dumb", fix #95 (@gcanti)
- Breaking Change
- remove
t.map
andt.mapWithName
(in general doesn't look serializable, needs more investigation) - remove
t.prism
(in general doesn't look serializable, needs more investigation) - change
Type
from interface to class and addS
type 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#is
is misleading)
- remove
- Experimental
- add Flowtype support (@gcanti)
- New Feature
- add
object
type, closes #86 (@gcanti)
- add
- New Feature
- add
strict
combinator, closes #84 (@phiresky, @gcanti)
- add
- Breaking Change
- upgrade
fp-ts
dependency (@gcanti)
- upgrade
- Bug Fix
- tag recursive types, fix #80 (@gcanti)
- Bug Fix
- incorrect compile time type for dictionary, fix #75 (@gcanti)
- Breaking Change
- upgrade to latest fp-ts (0.5.1) (@gcanti)
- New Feature
- add aliases for
null
andinterface
, closes #63 (@gcanti)
- add aliases for
- Internal
- handle latest fp-ts (0.4.3) (@gcanti)
- Breaking Change
- upgrade to latest fp-ts (0.4.0) (@gcanti)
- Internal
- allow for infinite unions (@gcanti)
- Bug Fix
- export and rename
interfaceType
to_interface
, fix #57 (@gcanti)
- export and rename
- Breaking Change
Type
is now an interface- types no more own a
is
method, uset.is
instead - unions no more own a
fold
method Reporter
,PathReporter
,ThrowReporter
are now top level modules
- Breaking Change
- upgrade to latest
fp-ts
(io-ts
APIs are not changed though) (@gcanti) - drop
lib-jsnext
folder
- upgrade to latest
- Bug Fix
- remove excess overloadings, fix #43 (@gcanti)
- New Feature
- add mapWithName and Functor instance, fix #37 (@gcanti)
- add prism combinator, fix #41 (@gcanti)
This is a breaking change only if you are using fp-ts APIs
- Breaking Change
- upgrade to latest fp-ts v0.2 (@gcanti)
- Internal
- upgrade to fp-ts v0.1 (@gcanti)
- New Feature
- add
partial
combinator (makes optional props possible) - add
readonly
combinator (values are not frozen in production) - add
readonlyArray
combinator (values are not frozen in production) - add
never
type
- add
- Breaking Changes
- remove
maybe
combinator, 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
pathReporterFailure
function from default reporters
- export
- Bug Fix
- revert pruning excess properties (see #27 for context)
- revert
intersection
combinator accepting onlyInterfaceType
s
- Experimental
- Pattern matching / catamorphism for unions
-
New Feature
- add support for jsnext
- add
Integer
type
-
Breaking Changes
t.Object
type. Renamed tot.Dictionary
, now accepts arrays so is fully equivalent to{ [key: string]: any }
.t.instanceOf
combinator. Removed.t.object
combinator. Renamed tot.interface
.ObjectType
toInterfaceType
. Excess properties are now pruned.mapping
combinator. Renamed todictionary
.MappingType
toDictionaryType
.intersection
combinator. Due to the new excess property pruning int.interface
now only acceptInterfaceType
s.- API
isSuccess
removed, useeither.isRight
instead - API
isFailure
removed, useeither.isLeft
instead - API
fromValidation
removed
- Bug Fix
- reverse overloading definitions for unions, intersections and tuples, fix inference bug
Initial release