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

Releases: hhvm/hhast

4.14.3: configuration file compatibility

17 Jul 16:06
Compare
Choose a tag to compare

With the removal of the Linters\ sub-namespace in 4.14, configuration files referencing specific linters became invalid; with this release, Facebook\HHAST\Linters\FooLinter and Facebook\HHAST\FooLinter are considered equivalent in the configuration file.

This is a temporary feature to aid migrations and supporting multiple versions; we expect to remove this compatibility in a future release, and recommend removing Linters\ from your configuration files if you do not need to maintain compatibility with earlier versions of HHAST.

4.14.2: better XHP handling, nightly support

16 Jul 17:52
Compare
Choose a tag to compare
  • XHPCategoryNameToken now implements INameishNode, fixing parse failures on some XHP child declarations
  • current nightly builds of HHVM (4.15-dev) are supported

4.13.2: improved support for XHP, bugfix in GroupUseStatementAlphabetizationLinter

16 Jul 17:51
Compare
Choose a tag to compare
  • XHPClassNameToken and XHPCategoryNameToken now implement INameishNode
  • MemberSelectionExpression::getName() now returns an IExpression instead of Node; nameish nodes are now returned wrapped in a NameExpression
  • Backported changes to GroupUseStatementAlphabetizationLinter from 4.14 to fix incorrect alphabetization in some cases

v4.14.1: handle more XHP children expressions

15 Jul 20:50
Compare
Choose a tag to compare

4.13.0 and 4.14.0 raise errors for children (pcdata)*; and similar expressions.

4.14.0: removal of `Missing`, much stricter typing

15 Jul 19:38
Compare
Choose a tag to compare

This release contains several major breaking changes:

  • the Facebook\HHAST\Linters\ and Facebook\HHAST\Migrations\ namespaces have been removed - the contents are now directly in the Facebook\HHAST\ namespace. This may require changes to blacklist/whitelist rules in hhast-lint.json
  • the Missing node type has been removed; fileds that contain SomeSpecifcNode or Missing are now typed as returning ?SomeSpecificNode instead of just Node
  • fields are now consistently typed, including in constructors; for example, it is no longer possible to create an ElseifClause with a keyword that is anything other than an ElseifToken, and Leading/Trailing trivia on tokens is always a NodeList<Trivia>
  • HHAST is now less willing to handle invalid Hack code
  • UnparsedReplacementCodeNode has been removed.
  • Node::insertAfter(), ::insertBefore(), and ::without() have been removed, as they can not be implemented in such a root class with the changes to typing.

These breaking changes seem to have more impact on unit tests than on real code; for example, tests for methods have often included code like class Foo { function bar(): void {} with a missing closing brace for the class, leading to expected nonnull errors; missing semicolons are also common in test cases. These kind of errors do not often occur in real code, as they lead to immediate errors in both the typechecker and runtime.

Non-breaking improvements include:

  • NodeList::insertBefore(), ::insertAfter(), ::withoutChild() and ::withoutItemWithChild() have been added
  • NodeList::isEmpty() and NodeList::getCount() have been added
  • empty namespace bodies are now correctly processed when resolving namespace uses
  • error messages for invalid trees now include code snippets

4.13.1: handle more XHP child expressions

15 Jul 20:49
Compare
Choose a tag to compare

4.13.0 and 4.14.0 raise errors for children (pcdata)*; and similar expressions.

4.13.0: add `instanceof` -> `is` migration, support current nightlies (4.14-dev)

12 Jul 23:29
Compare
Choose a tag to compare

This release:

  • no longer uses instanceof expressions, supporting the disable_instanceof_refinement=true .hhconfig option and current nightly builds (4.14-dev) of HHVM
  • requires HHVM 4.13 or above
  • stops hhast-migrate looking at non-hack files and git/hg data files if --include-vendor is passed
  • fixes hhast-migrate ignoring .hack files if migrating an entire directory
  • adds bin/hhast-migrate --instanceof-is

--instanceof-is replaces expressions of the form $foo instanceof Bar with $foo is Bar, $foo is Bar<_>, $foo is Bar<_, _> etc, depending on how many generics Bar has.

This can lead to additional type errors for code that was already unsafe; for example:

class SomeClass<T> {}

function foo(SomeClass<string> $a): void {}

function bar(mixed $a): void {
  if ($a instanceof SomeClass) {
     foo($a); // this is unsafe, but does not raise a type error
  }
  if ($a is SomeClass<_>) {
    foo($a); // also unsafe, but does raise a type error
  }
}

If HHAST is unable to find the definition of the class, it will assume that it takes no generics.

It does not migrate expressions of the form $foo instanceof $bar, as there is no consistent 'best' replacement; these need manually fixing.

v4.12: Support and require HHVM v4.12, add dollar-brace interpolation migration

01 Jul 17:14
Compare
Choose a tag to compare

This release:

  • adapts to parser changes in HHVM 4.12
  • adds bin/hhast-migrate --dollar-brace-variable which replaces "${var}" with "{$var}"

v4.11.0: bugfixes and new linters

25 Jun 16:45
Compare
Choose a tag to compare

This release:

  • supports HHVM 4.8-4.11
  • adds a linter for grouping use statements
  • adds a linter for replacing PHP array literals with vecs or dicts
  • adds a linter for sorting group use statements in alphabetical order
  • stability improvements for LSP (IDE) mode
  • fixes wrapping of nodes in generics; for example, a NameToken in a List<ListItem<IExpression>> is now wrapped in a NameExpression, instead of the raw NameToken being returned (which is not a valid IExpression)
  • supports wrapping noreturn as a SimpleTypeSpecifier to implement ITypeSpecifier
  • removes the CallTimePassByReference migration for HHVM 3.24

v4.8.1: Support nightly builds and 4.9

10 Jun 17:15
Compare
Choose a tag to compare

This release supports additional versions of HHVM; it contains no other significant changes.