v1.0
Version 1.0 is here! Very little has changed since 0.11.2; mostly this release indicates the stability (or lack of maintenance, depending on how you look at it) over the last several years. The 1.x releases will be the last to support BuckleScript as we turn our attention to Melange.
There are no breaking changes in this release, but there are a handful of deprecations. We should end up with decent alternatives to all of the features that will eventually be removed, but if any of this concerns you, please let me know!
⚠️ Deprecated features
Decode.AsResult.OfStringNel
will be removed in an upcoming release. The errors are less useful thanOfParseError
, and there's a cost to maintaining multiple decoder typesDecode.AsOption
will also be removed. Again, there's a maintenance burden in keeping it, and if you really wantoption
, it's easy enough to convert theresult
return into anoption
.Decode.Make
(for making your own custom output types) will eventually be removed as we focus onParseError
variantFromJson
andvariantFromString
will be removed in favor of new, simpler, more consistent tools for decoding variants (see the newliteral
functions below)- The
Decode.Pipeline
module is now deprecated. See the docs for alternatives and a teaser about upcoming changes that will make this experience way better stringMap
will be removed as we try to limit how much we depend on Belt-specific features. You can use thedict
decoder instead and convert theJs.Dict
to aBelt.String.Map
.
✨ New features
- Functions have been added to decode literal values e.g.
literalString
,literalInt
, andliteralFloat
. These functions first decode to the expected type, then ensure the value exactly matches the provided value. This is useful for decoding unions of string literals (e.g."dev" | "prod"
) - Decoding sting unions is such a common need that we've provided a
stringUnion
function to make it even simpler
📝 Documentation
- The documentation site got a handful of updates to explain the deprecations
- The guide on decoding variants was almost completely rewritten and might be particularly helpful
🤖 Dependency updates
bs-bastet
was bumped to2.0
andrelude
was bumped to0.66.1
. As peer dependencies, this change is the most likely to impact your existing projects, but hopefully the update isn't too bad