Skip to content

Latest commit

 

History

History
48 lines (44 loc) · 2.12 KB

CHANGELOG_V7.md

File metadata and controls

48 lines (44 loc) · 2.12 KB
  • Redesigned Literal module to make it more effecient

    • The Literal.t type was renamed to literal, became private and changed structure. Use S.Literal.parse to create instances of the type.
    • Literal.classify -> Literal.parse
    • Literal.toText -> Literal.toString. Also, started using .toString for Function literalls and removed spaces for Dict and Array literals to make them look the same as the JSON.stringify output.
  • Updated ctx type names to s for better autoComplete

    • effectCtx -> s
    • Object.ctx -> Object.s
    • Tuple.ctx -> Tuple.s
    • schemaCtx -> Schema.s
    • catchCtx -> Catch.s
  • Added serializeToJsonStringOrRaiseWith

  • Allow to create S.union with single item

  • PPX: Removed @schema for type expressions. Use @s.matches instead.

  • Added unsafe mode for S.json:

    • S.json -> S.json(~validate: bool)
    • More flexible
    • Improved tree-shaking
    • Can get the info from the tagged type: JSON -> JSON({validated: bool})
  • Removed s.failWithError. Use S.Error.raise instead

  • Removed async support for S.union. Please create an issue if you used the feature

  • Improved parsing performance of S.array and S.dict ~3 times

  • Automatic serializing stopped working for tuples/objects/unions of literals. Use S.literal instead.

  • Removed InvalidTupleSize error code in favor of InvalidType

  • Changed payload of Object and Tuple variants in the tagged type

  • Don't recreate object on serialize when it's not transformed (TODO: Measure performance improvement for array of objects)

  • Moved built-in refinements from nested modules to improve tree-shaking:

    • Int.min->intMin

    • Int.max->intMax

    • Int.port->port

    • Float.min->floatMin

    • Float.max->floatMax

    • Array.min->arrayMin

    • Array.max->arrayMax

    • Array.length->arrayLength

    • String.min->stringMin

    • String.max->stringMax

    • String.length->stringLength

    • String.email->email

    • String.uuid->uuid

    • String.cuid->cuid

    • String.url->url

    • String.pattern->pattern

    • String.datetime->datetime

    • String.trim->trim