zendframework / zend-expressive

PSR-15 middleware in minutes!
BSD 3-Clause "New" or "Revised" License
711 stars 197 forks source link

1.1 Programmatic middleware pipelines #437

Closed michalbundyra closed 7 years ago

michalbundyra commented 7 years ago

In the 1.1 docs we have:

Starting with 1.1, we recommend programmatic creation of pipelines and routing. https://github.com/zendframework/zend-expressive/blob/master/doc/book/reference/migration/to-v1-1.md#programmatic-middleware-pipelines but the main PR (https://github.com/zendframework/zend-expressive/pull/396) has changed milestone from 1.1.0 to 2.0.0 and zend-expressive-tooling are not included in 1.1-dev (I mean script: https://github.com/zendframework/zend-expressive/blob/develop/bin/expressive-tooling).

Documentation says we can use tooling also with 1.1 but it will be included in 2.0. Is that right? Why not just add this script also to expressive 1.1 as programmatic approach is here recommended?

weierophinney commented 7 years ago

The script currently assumes that several factories and middleware are available, but these are only available on the develop (2.0.0) branch. I've got a todo item to see if I can provide an alternate script (or allow a flag to the script) to allow it to be used with the 1.1 release.

One problem with doing this, however, is that it would likely require additional scripts to migrate a 1.1-compatible programmatic pipeline to 2.0, due to differences in available middleware and/or features. As such, it's still to be determined.

Marking this as a question, and will close once I've made a decision.

weierophinney commented 7 years ago

I've decided against doing a 1.1 version of the script. The reason is that, while we've released version 1.1, we haven't done a ton to publicize it; it primarily exists to provide a few forwards-compatibility features, and bring in support for Stratigility 2.0. While we document using the programmatic pipeline, we expect developers to upgrade to version 2.0 to fully take advantage of that workflow.