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

Releases: hhvm/xhp-lib

4.0.0: namespace support, syntax changes

03 Sep 19:51
Compare
Choose a tag to compare

This release contains many substantial changes, and should be used in coordination with HHVM 4.73 or later; for details, see the announcement blog post

v4.0.0rc2: compatibility updates, bugfixes, and deprecations

28 Aug 20:55
Compare
Choose a tag to compare
  • This release is compatible with HHVM 4.72
  • It is intended to ban mutations after render; v4.0.0rc1 unintentionally also banned mutations during render
  • made use-after-render exceptions clearer
  • removed HasXHPAttributeClobbering_DEPRECATED; use attribute splat instead
  • corrected HTML attribute categories; this is a breaking change as some have been removed
  • renamed UnsafeAttributeValue to UnsafeAttributeValue_DEPRECATED and forceAttribute to forceAttribute_DEPRECATED, as the are - by design - holes in the type system. They will be removed in a future release

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

23 Jul 20:12
Compare
Choose a tag to compare

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

3.2.1: support HHVM 4.44+

15 Jul 00:35
Compare
Choose a tag to compare

Does not break backwards compatibility, HHVM 4.32+ is still supported.

v3.2.0: support type-assert v4, require HHVM 4.32

21 May 16:37
Compare
Choose a tag to compare

This release:

  • permits either type-assert v3 or v4
  • requires HHVM 4.32 or above; older versions of HHVM are themselves unsupported.

3.1.1: support new children declaration traits in any subclass of :x:composable-element

19 Feb 20:08
c5ecd73
Compare
Choose a tag to compare

This allows subclasses of :x:primitive to also migrate their child declarations

v3.1: experimental alternative interface for child validation

12 Feb 21:53
83e81a3
Compare
Choose a tag to compare

We are hoping to remove child validation as a language-level feature, replacing it with a new implementation
built on top of more general-purpose language features. This release adds such an alternative, though we do not yet consider it a stable part of the XHP-Lib API.

The current syntax is rarely used, and inconsistent with the rest of the language - both in terms of syntax and in terms of typechecker behavior. We believe removing it will make the language easier to use.

We hope this release will enable experimentation and for work on automated migration; if successful, we aim to stabilize the API and remove the language feature.

This release adds two traits:

  • XHPChildDeclarationConsistencyValidation: requires that the element have consistent old- and new- style child declarations
  • XHPChildValidation: uses new-style validation, and requires that the element does not have an old-style declaration

Both of these traits define abstract protected static function getChildrenDeclaration(): Facebook\XHP\ChildValidation\Constraint {} - this static method must be implemented by any concrete classes using the traits.

Constraints are designed to be a full-featured replacement for the existing language feature, and created through factory functions

The unit tests contain many examples; this class is representative:

class :test:nested-rule extends :x:element {
  use XHPChildDeclarationConsistencyValidation;

  children (:div | (:code+));

  // this is equivalent to the previous declaration
  protected static function getChildrenDeclaration(): XHPChild\Constraint {
    return XHPChild\anyOf(
      XHPChild\ofType<:div>(),
      XHPChild\atLeastOneOf(XHPChild\ofType<:code>()),
    );
  }

v3.0.2: allow hhvm-autoload 3.0

12 Feb 21:44
Compare
Choose a tag to compare
allow hhvm-autoload 3.0

3.0.1: compatibility update

21 Nov 22:19
Compare
Choose a tag to compare

This release adds an additional FIXME required for compatibility with current nightly builds.

Replace `Stringish` with `string` in HTML tag definitions

18 Nov 20:06
Compare
Choose a tag to compare

Stringish is no longer a special type in Hack, so shouldn't be used for attribute definitions that allow strings.