Skip to content
This repository was archived by the owner on Apr 1, 2024. It is now read-only.

v4.0.0rc1: new syntax, namespace support, modernization

Choose a tag to compare

@fredemmott fredemmott released this 23 Jul 20:12

This is a major new release; the most significant changes include:

  • new xhp class foo syntax, replacing class :foo
  • XHP classes can be declared in namespaces
  • XHP classes can be used from namespaced code - the : character is treated as a namespace separator when instantiating classes
  • XHP class names are no longer mangled; xhp class foo actually declares a runtime class called foo, not xhp_foo
  • the children declaration is no longer supported; the approach introduced with 3.1 is now required
  • the category declaration is no longer supported; interfaces are used instead
  • all classes are now namespaced, including the HTML tags

This release currently requires:

  • disable_xhp_element_mangling=true and enable_xhp_class_modifier=true in .hhconfig
  • hhvm.hack.lang.enable_xhp_class_modifier=true and hhvm.hack.lang.disable_xhp_element_mangling=true in your HHVM configuration, including when generating the autoload map, running HHAST, etc.

Before the final release, expect:

  • through migration instructions
  • the defaults to change in HHVM so the above configuration is no longer required; this will effectively make XHP-Lib v4 the standard XHP-Lib for new HHVM releases