Skip to content

Releases: DZakh/rescript-schema

v2.0.0

18 Sep 22:11
Compare
Choose a tag to compare

Release to fix limitations I faced developing rescript-envsafe. Shouldn't be breaking for most users.

  • Add S.Int.port built-in refinement
  • Rename action type to migration. Still don't like the name though 😅
  • Add advanced preprocessing functionality, might be useful when you build sometimes on top of rescript-struct
  • Remove [ReScript Struct] prefix from error message created by S.Error.toString
  • Remove custom error RescriptStructError for panic and throw normal Errors with [rescript-struct] prefix in message
  • Fix matching of Literal in the tagged type. I mentioned the problem in the form post
  • Fix Defaulted and Json structs with parseAsyncInStepsWith. They will synchronously return error that happened before asynchronous operation
  • The Json struct factory is more performant and creates structs with Json name instead of String
  • Creating structs became 20% faster. Now to create a struct and parse is just a little slower than only parsing for zod
  • Add rescript-envsafe to the ecosystem of rescript-struct
  • Update LICENSE copyright

v1.0.0

05 Sep 15:53
Compare
Choose a tag to compare

Final API changes:

  • Rename Record struct to Object
  • Rename S.default to S.defaulted
  • Redesign undocumented Metadata module
  • Rename tagged_t to tagged
  • Move Defaulted, Deprecated and unknownKeys from S.tagged to their own modules
  • Add highlights to the documentation

v0.27.0

29 Aug 18:13
Compare
Choose a tag to compare
  • Remove type: module from package.json

v0.26.0

29 Aug 15:31
Compare
Choose a tag to compare
  • Add exception-based parseOrRaiseWith and serializeOrRaiseWith
  • Remove undocumented isAsyncSerialize
  • Update advancedTransform API
  • Improve library tree-shaking
  • Use ESM
  • Remove beta banner from the README

v0.25.0

26 Aug 20:28
Compare
Choose a tag to compare
  • Start using [email protected]
  • Update API of the Deprecated struct factory to make it similar to built-in refinements
  • Change Date struct tagged_t from Instance(unknown) to Date
  • Add helper S.name to get a struct name. Useful for custom error messages

v0.24.0

21 Aug 10:38
Compare
Choose a tag to compare
  • Add name property to the custom struct factory for better error messages.
  • Remove GADT from the tagged_t type.

v0.23.0

20 Aug 16:02
Compare
Choose a tag to compare

Breaking changes:

  • Remove different parsing modes. The reason is that the Safe mode became comparably fast to the Migration mode.
  • Use S.Record.strip as default instead of S.Record.strict.
  • Remove S.superTransform and S.Error.make.
  • Change S.transform and S.custom API from result based to exception based. Use the new S.Error.raise to exit with failure.

New features:

  • Finalize and document S.refine function.
  • Add async refinements with S.asyncRefine.
  • Add async transforms with S.advancedTransform.
  • Add S.parseAsyncWith and S.parseAsyncInStepsWith to parse structs with asynchronous refinements or transforms.
  • Add the UnexpectedAsync error when trying to synchronously parse structs with asynchronous refinements or transforms.
  • Increase parsing performance by 20%.
  • Update roadmap

v0.22.0

28 Jul 08:13
Compare
Choose a tag to compare
  • Rename mode type to parsingMode
  • Rename Unsafe parsing mode to Migration, fix its description
  • Make serializing performance for common use-cases 30% faster

v0.21.0

22 Jul 18:55
Compare
Choose a tag to compare
  • Remove different modes for serializing
  • [dev] Update rescript-ava package

v0.20.1

03 Jul 11:00
Compare
Choose a tag to compare
  • Don't test for an excess key when parsing failed with another error
  • Add sub-error location to the InvalidUnion error string