Skip to content

1.4.0

Compare
Choose a tag to compare
@cannorin cannorin released this 04 Mar 09:53
· 564 commits to main since this release
fb8c1ac
  • Upgrade js_of_ocaml to 4.0 and dune to 3.0.
  • Perform massive refactoring on the generated bindings (breaking changes).
    • Anonymous interface modules are now generated in the module where they are actually used.
    • Changed the representation of untagged union types and intersection types to make it easier to use.
      • ('a, 'b) and_ and ('a, 'b) or_ types are removed in this change.
    • Union types appearing as argument of function are now emitted in a simpler form: [`U1 of t1 | `U2 of t2 | .. ] [@js.union].
      • Now you don't have to do Union.inject_n on function arguments.
    • Union of primitive types are now represented as [...] Primitive.t.
      • Use Primitive.classify function to convert it to a polymorphic variant, on which you can match directly.
      • 'a or_XXX types are removed in this change.
  • Ts2ocaml now emits builder function [@js.builder] for POJO interfaces.
  • Add an option --readable-names to try to use more readable names instead of AnonymousInterfaceN.
  • Fix a bug which prevented ts2ocaml from generating class constructors if not defined explicitly.