@fredemmott fredemmott released this Oct 19, 2018

Assets 2
v2.8.0

support 3.29

@kmeht kmeht released this Aug 27, 2018 · 4 commits to master since this release

Assets 2

This release:

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

@fredemmott fredemmott released this May 10, 2018 · 11 commits to master since this release

Assets 2

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} />;
  }
}

@fredemmott fredemmott released this Feb 9, 2018 · 14 commits to master since this release

Assets 2

This release supports:

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

@fredemmott fredemmott released this Jan 8, 2018 · 18 commits to master since this release

Assets 2
v2.5.0

Add string cast for 3.24 in tests

@fredemmott fredemmott released this Sep 28, 2017 · 29 commits to master since this release

Assets 2
  • 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.

@fredemmott fredemmott released this Dec 4, 2016 · 45 commits to master since this release

Assets 2

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

@fredemmott fredemmott released this Nov 7, 2016 · 46 commits to master since this release

Assets 2

Thanks to @simonwelsh for JsonSerializable.

Assets 2

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.

@fredemmott fredemmott released this Feb 12, 2016 · 54 commits to master since this release

Assets 2

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