Today we're excited to announce Expressive 2.0!
What has changed since 1.0 was released last year?
The short version: we've been providing changes that standardize, simplify, and streamline application development in Expressive.
PSR-11 (ContainerInterface) support. Expressive is now a PSR-11 consumer, and will work with any container compatible with that specification. As container-interop 1.2.0 now extends the PSR-11 interfaces, any container-interop-compatible containers are now automatically PSR-11 compatible as well, and thus work with Expressive!
http-interop/http-middleware support. http-middleware is the working group for the proposed PSR-15 specification, covering server-side middleware. We feel the specification is solidifying sufficiently to adopt and support it. In fact, while we continue to accept existing "double-pass" middleware, our engine internally only supports http-middleware!
Programmatic pipelines. Matthew blogged about programmatic pipelines last year, and the response to that was very positive; many developers indicated they found the technique far more approachable, particularly when first learning Expressive. As such, the new skeleton application now creates programmatic pipelines, and we provide a tool to allow you to convert existing, configuration-driven applications to the programmatic approach.
Simplified, improved error handling. Error handling was unintuitive previously, due in part to architectural decisions in the underlying zendframework/zend-stratigility package. We have fixed those issues, allowing a simpler, more flexible approach via standard middleware.
Modular applications. Mateusz Tymek created functionality last year for modularizing Expressive applications that we even documented in our cookbook. We have since expanded on those efforts to create a new component, zendframework/zend-config-aggregator, which is responsible for aggregating configuration from a variety of sources, and optionally caching the merged configuration for you. This functionality is now incorporated in our skeleton application by default, allowing you to consume or create re-usable middleware modules.
Extensible routing and dispatch middleware. In version 1, the routing and
dispatch middleware was incorporated directly within the
Zend\Expressive\Application class. Each has now been extracted to its own
class, allowing developers to extend them, or provide their own.
More development tooling. We now incorporate zfcampus/zf-development-mode in the skeleton, allowing you to toggle development-specific configuration. Additionally, we have created zendframework/zend-expressive-tooling, which provides a variety of tools for helping you migrate from Expressive 1 to Expressive 2, as well as for creating and managing middleware modules.
The above are the high-level features of the release; a lot of other changes have gone into the release, which we cover thoroughly in our migration document.
If you are already using Expressive, you can update to the new version by issuing the following statement:
$ composer require "zendframework/zend-expressive:^2.0"
Depending on other requirements you have in place, you may need to update the following dependencies at the same time to the listed constraints; you may do so by appending the necessary requirements to the above statement, within double qoutes:
Once you have upgraded, be sure to read the migration document to see what other changes you may need to make to your application.
(In our tests, and those of our contributors, we found that the majority of upgrades "just worked"; if you have difficulties, please open an issue detailing your specific problems.)
New users can get started using our skeleton application:
$ composer create-project zendframework/zend-expressive-skeleton
This will prompt you for a number of requirements; use the defaults if you are unsure. Once done, enter the newly created project directory, and get started developing!
This release was largely a community-driven project. At this time, we extend our deepest appreciation to the following contributors, who made huge contributions in order to make the release happen (in alphabetical order, by surname):
Many thanks to everyone who has contributed to the release, be it via feedback, reporting issues, providing patches, or improving the documentation!
We'll be following up in the coming days with more in-depth posts covering new features and workflows, so keep an eye on this space.
In the meantime, here are some resources you can use immediately:
Save the date!
Want to learn more about Expressive and Zend Framework? What better location than ZendCon 2017! ZendCon will be hosted 23-26 October 2017 in Las Vegas, Nevada, USA. Visit the ZendCon website for more information.
Subscribe to this blog via RSS.