Skip to content

Increased consistency, support for vec/dict/keyset, support for HHVM 3.23

Compare
Choose a tag to compare
@fredemmott fredemmott released this 14 Nov 22:40
  • adds support for the upcoming HHVM 3.23 release
  • in general, methods that previously took collections will now take Traversable or KeyedTraversable instead, allowing them to be used with either Hack collections or Hack arrays
  • methods that returned collections now return Hack arrays
  • added support for running hackfmt-formatted output: add Facebook\HackCodegen\HackfmtFormatter as the formatter in your configuration object
  • <?hh // strict is now the default for generated files
  • added CLI script to verify signatures - this should be available as vendor/bin/hh-codegen-verify-signatures in projects that depend on hack-codegen
  • renamed addVar() (add a member variable) to addProperty(), and added addProperties()
  • replaced setGenericsDecl() with addGenerics() and addGeneric(), which take a string describing a generic
  • HackCodegenConfig no longer takes parameters - instead, call ->withRootDir($root) on the object to specify the root directory
  • consistency improvements:
    • addCase() now takes a value renderer as well as a value
    • endSwitch_() was renamed to endSwitch()
    • replaced setserAttribute() with addUserAttribute(), which takes a value renderer as well as a value, and addEmptyUserAttribute()
    • renamed setParameters() to addParameters()
    • split addComment() to addComment() and addCommentf()
    • split addIf() to addIf() and addIff()
    • split addLine() to addLine() and addLinef()