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

Support for alternative resolvers; no longer use FastRoute by default

Pre-release
Pre-release
Compare
Choose a tag to compare
@fredemmott fredemmott released this 23 Oct 22:07

Changes

  • This release no longer uses FastRoute by default, and support for it will be removed from future releases; this is primarily because the included HHI will not be compatible with the changes to shapes in HHVM 3.23.
  • BaseRouter::getCacheFilePath() has been removed, as not all resolvers support it; if you need to specify this, overload BaseRouter::getResolver().
  • The new default resolver will automatically cache in APC if composer was ran with --no-dev
  • This release uses the Hack Standard Library, so hhvm-autoload is required; this means you need to include vendor/hh_autoload.php instead of vendor/autoload.php in your projects

Performance

Preliminary benchmarks also show substantial performance improvements with the new resolver when using a large random URI map (3718 entries) and example URI list (6639):

  • in development environments (uncached), from 2.5s per request to 42ms
  • in production environments (cached), from 26ms to 3ms

You can revert to FastRoute by overriding BaseRouter::getResolver(); please file an issue explaining your needs if you do this, as FastRoute support is going to be completely removed before HHVM 3.23 is released.

Roadmap

This release supersedes v1.0.0rc8; I've removed the 'RC' labelling as I'm now expecting more substantial changes before v1.0:

  • v0.10: remove support for FastRoute to support HHVM 3.23 and above.
  • v0.11: replace usage of Hack Collections (Vector, Set, Map, and their immutable variants) with vec/dict/keyset.
  • v0.12+: broader API review and feature improvements, including support for a Hack-specific alternative to PSR-7