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

Releases: hhvm/hack-router-codegen

Support (and require) HHVM 3.23+

14 Nov 23:47
Compare
Choose a tag to compare
Pre-release
v0.10

test against nightlies instead of 3.22

Support hack-router v0.9

23 Oct 22:20
Compare
Choose a tag to compare
Pre-release

Changes

This release:

Using the Hack Standard Library means that HHVM 3.21 or later and hhvm-autoload are required.

Roadmap

This release supersedes v1.0.0rc5; it is not a release candidate as substantial changes are expected before v1.0:

  • v0.10: support hack-router v0.10 and HHVM 3.23+, and update other dependencies
  • v0.11: migrate from Hack Collections to Hack Arrays (vec/dict/keyset)
  • v0.12+: broader API review and feature improvements, likely to include more usage of shapes over objects

Support for HHVM 3.22

28 Sep 18:10
Compare
Choose a tag to compare
Support for HHVM 3.22 Pre-release
Pre-release

Shapes::idx() no longer takes nullable shapes. No other meaningful changes.

Support HHVM 3.20.1

08 Jun 17:19
6c3a494
Compare
Choose a tag to compare
Support HHVM 3.20.1 Pre-release
Pre-release

HHVM has some problems with lambdas calling static methods on classname<T> variables; hack-router-codegen triggers these on 3.20.

See facebook/hhvm#7875

Use hack-codegen v2.1, use shapes for URIBuilders and request parameters

19 Feb 20:38
d377b47
Compare
Choose a tag to compare

Documentation is still the blocker on moving out of RC state.

Hack-Codegen

facebook/hack-codegen v2.1 or above is now required; the 2.x series is a major break from 1.x; please see:

Shapes for URIBuilders

Old:

$uri = (new FooControllerUriBuilder())->setHerp('herp')->setDerp('derp')->getPath();
// or, if using trait:
$uri = FooController::getUriBuilder()->setHerp('herp')->setDerp('derp')->getPath();

New:

$uri = FooControllerUriBuilder::getPath(shape('herp' => 'herp', 'derp' => 'derp'));
// or, if using trait:
$uri = FooController::getPath(shape('herp' => 'herp', 'derp' => 'derp'));

The primary benefit is that instead of depending on runtime enforcement, the typechecker will now tell you if you are missing a required parameter.

Shapes for request parameters

Old:

$foo = $this->getParameters()->getFoo();

New:

$foo = $this->getParameters()['foo'];

The benefits are:

  • consistency with URI builders
  • able to easily get a link to the current page by passing the request parameters shape directly to the URI builder
  • If you use the trait, you only need to specify how to get the underlying non-codegen parameters object, not provide the full method implementation.

Misc

  • added <<Codegen>> attribute to generated classes and tests
  • added discardChanges bool option to configuration shape; this will ignore signatures, and remove any changes outside of manual sections.

Hopefully-final prerelease

15 Feb 01:50
e243040
Compare
Choose a tag to compare
Pre-release

I'm expecting v1.0.0 to be this + documentation changes.

  • Sort generated urisubmaps for readability
  • bump hack-router dependency to 1.0.0rc7
    • better error message when a controller is not marked as supporting any HTTP methods