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

Releases: hhvm/xhp-lib

Support HHVM 3.28

27 Aug 20:19
Compare
Choose a tag to compare

This release:

  • supports HHVM 3.28
  • adds <script integrity> attribute to support the Subresource Integrity spec
  • adds support for XHPUnsafeRenderable in HTML attributes

Relicense to MIT, support the attribute spread operator

10 May 18:15
Compare
Choose a tag to compare

This release:

  • is available under the MIT license
  • adds support for the XHP spread operator (available in HHVM 3.24+)

The XHP Spread Operator

This is intended to be a safer replacement for the implicit attribute copying available via XHPHelpers; we expect to remove XHPHelpers from XHP 3.0.

class :inner extends :x:element {
  attribute string color, int age;
}

class :outer-old extends :x:element {
  use XHPHelpers;

  attribute string color, int age;

  public function render(): :xhp {
    // `age` attribute is implicitly copied
    return <inner color="red" />;
  }
}

class :outer-new extends :x:element {
  attribute string color, int age;

  public function render(): :xhp {
    // Explicitly copy all attributes from `$this` - however, the override of color takes precedence
    return <inner {...$this} color="red" />;
  }
}

The typechecker is able to validate types - for example:

class :outer-invalid extends :x:element {
  attribute string color, float age;

  public function render(): :xhp {
    // Type error:
    // Invalid xhp value for attribute :age in :inner
    //   This is an int
    //   It is incompatible with a float
    return <inner {...$this} />;
  }
}

Support additional typechecker restrictions

09 Feb 20:35
Compare
Choose a tag to compare

This release supports:

  • safe_array=true and safe_vector_array=true
  • enable_experimental_tc_features=no_fallback_in_namespaces (nightlies, expected in 3.25)

Support HHVM 3.24, require HHVM 3.23+

08 Jan 22:37
Compare
Choose a tag to compare
v2.5.0

Add string cast for 3.24 in tests

Support for TypeAssert v3, disable attribute validation by default

28 Sep 18:58
Compare
Choose a tag to compare
  • this release uses TypeAssert v3 instead of v2, allowing it to be used in new projects
  • this release splits the API for enabling/disabling validation into separate options for child validation and attribute validation. :xhp::$ENABLE_VALIDATION no longer exists.
  • attribute validation is off by default; we aim to remove it completely from a future release

Validation changes

Enabling attribute validation

:xhp::enableAttributeValidation();

Disabling child validation

:xhp::disableChildValidation();

Motivation

  • This will allow removing the dependency on TypeAssert in the future
  • The runtime validation isn't as useful now given that the typechecker validates attributes specified when instantiating XHP objects
  • The runtime validation is bad for performance
  • Keeping the runtime validation in sync with the typechecker has been a frequent source of issues

Caveat

As setAttribute() is not special-cased in the typechecker, so is now completely unchecked unless validation is enabled.

Support using stable release of fredemmott/type-assert

04 Dec 21:39
4d2e264
Compare
Choose a tag to compare

This library is used to implement support for shapes, and has just released v1.0 - support either v0.2 or v1.x

Support for Shapes, JsonSerializable, Nightlies, E_STRICT

07 Nov 23:41
71aa751
Compare
Choose a tag to compare

BC break: contenteditable and draggable attribute types

28 Mar 21:12
Compare
Choose a tag to compare

These are now enum { 'true', 'false' } attributes instead of bool, to match the HTML specification. attr=false is not valid for boolean attributes (either in XHP or the specification), but is valid for these.

Support for HHVM 3.12

12 Feb 18:28
Compare
Choose a tag to compare

Removed a bogus assert - 3.12 makes asserts enabled by default.

Support assume_php=false

21 Dec 17:45
Compare
Choose a tag to compare
  • callable is undefined in Hack: 60a4141
  • Update 91carriage/phpunit-hhi to versions that support assume_php-false (only affects --dev): 6788a34
  • Exclude tests/ from release tarballs, including packagist installs of release versions: 7e9599a