Releases: hhvm/hack-router-codegen
Support (and require) HHVM 3.23+
v0.10 test against nightlies instead of 3.22
Support hack-router v0.9
Changes
This release:
- supports hack-router v0.9
- uses the Hack Standard Library
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
Shapes::idx() no longer takes nullable shapes. No other meaningful changes.
Support HHVM 3.20.1
HHVM has some problems with lambdas calling static methods on classname<T>
variables; hack-router-codegen triggers these on 3.20.
Use hack-codegen v2.1, use shapes for URIBuilders and request parameters
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
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