New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http-interop/http-middleware 0.5 #513

Closed
danizord opened this Issue Sep 19, 2017 · 18 comments

Comments

Projects
None yet
9 participants
@danizord
Contributor

danizord commented Sep 19, 2017

Hey! Any plans to upgrade Zend Expressive to http-interop/http-middleware 0.5? :)

@weierophinney

This comment has been minimized.

Show comment
Hide comment
@weierophinney

weierophinney Sep 19, 2017

Member

Yes, though likely as a 3.0.0alpha. Not sure what our time frame is for addressing it; we have a number of other things we need to accomplish first.

Member

weierophinney commented Sep 19, 2017

Yes, though likely as a 3.0.0alpha. Not sure what our time frame is for addressing it; we have a number of other things we need to accomplish first.

@firefred

This comment has been minimized.

Show comment
Hide comment
@firefred

firefred Oct 12, 2017

expressive composer dependencies:
"http-interop/http-middleware": "^0.4.1",

automatically installs 0.5, and this broke expressive

firefred commented Oct 12, 2017

expressive composer dependencies:
"http-interop/http-middleware": "^0.4.1",

automatically installs 0.5, and this broke expressive

@froschdesign

This comment has been minimized.

Show comment
Hide comment
@froschdesign

froschdesign Oct 12, 2017

Member

@webimpress
Can you add a comment here? Thanks!

Member

froschdesign commented Oct 12, 2017

@webimpress
Can you add a comment here? Thanks!

@webimpress

This comment has been minimized.

Show comment
Hide comment
@webimpress

webimpress Oct 12, 2017

Contributor

@firefred Can you provide more information please?
In expressive 2.0.5 we requires http-interop/http-middleware in version 0.4.1. What version of Expressive you are using? What is your test case which cause the issue?

We are preparing Expressive 2.1.0 which allows you to update your application to http-interop/http-middleware 0.5.0.

Contributor

webimpress commented Oct 12, 2017

@firefred Can you provide more information please?
In expressive 2.0.5 we requires http-interop/http-middleware in version 0.4.1. What version of Expressive you are using? What is your test case which cause the issue?

We are preparing Expressive 2.1.0 which allows you to update your application to http-interop/http-middleware 0.5.0.

@weierophinney

This comment has been minimized.

Show comment
Hide comment
@weierophinney

weierophinney Oct 12, 2017

Member

@firefred Pinning to ^0.4.1 should never install 0.5.0, for two reasons:

  • ^ used with a bugfix version will only get versions in that minor series, and never upgrade to the next minor release.
  • ^ in 0.X releases will never grab the next minor release, as new minor releases in 0.X series are allowed to have BC breaks.

I've just verified the above in two ways:

  • I created a new project that pinned http-interop/http-middleware to ^0.4.1, installed, and then ran composer update. No updates were made.
  • I created a new project that pinned webimpress/http-middleware-compatibility to ^0.1.3, ran composer install and specified ^0.4.1 for the http-interop/http-middleware version. Afterwards, I ran composer update. No updates were made.

So: can you provide information on how we might reproduce the issue, please? Were you creating a new project? or updating an existing one? Did you have http-interop/http-middleware required within your project? If so, at what version? If not, what version was installed prior to update? What prompts, if any, did you receive?

We know that versions of webimpress/http-middleware-compatibility prior to 0.1.3 could easily lead to installing http-interop/http-middleware 0.5.0, and thus its 0.1.3 release ensures that the currently installed version is added to your composer.json, instead of prompting you for a version. Expressive itself pins to a specific http-middleware version as of 2.0.5, which should trigger this properly.

Any information you can provide us will help us know if we missed an edge case, or if our recent (as in last 24 hours) approaches will resolve these problems.

Member

weierophinney commented Oct 12, 2017

@firefred Pinning to ^0.4.1 should never install 0.5.0, for two reasons:

  • ^ used with a bugfix version will only get versions in that minor series, and never upgrade to the next minor release.
  • ^ in 0.X releases will never grab the next minor release, as new minor releases in 0.X series are allowed to have BC breaks.

I've just verified the above in two ways:

  • I created a new project that pinned http-interop/http-middleware to ^0.4.1, installed, and then ran composer update. No updates were made.
  • I created a new project that pinned webimpress/http-middleware-compatibility to ^0.1.3, ran composer install and specified ^0.4.1 for the http-interop/http-middleware version. Afterwards, I ran composer update. No updates were made.

So: can you provide information on how we might reproduce the issue, please? Were you creating a new project? or updating an existing one? Did you have http-interop/http-middleware required within your project? If so, at what version? If not, what version was installed prior to update? What prompts, if any, did you receive?

We know that versions of webimpress/http-middleware-compatibility prior to 0.1.3 could easily lead to installing http-interop/http-middleware 0.5.0, and thus its 0.1.3 release ensures that the currently installed version is added to your composer.json, instead of prompting you for a version. Expressive itself pins to a specific http-middleware version as of 2.0.5, which should trigger this properly.

Any information you can provide us will help us know if we missed an edge case, or if our recent (as in last 24 hours) approaches will resolve these problems.

@firefred

This comment has been minimized.

Show comment
Hide comment
@firefred

firefred Oct 12, 2017

@weierophinney
Thanks for the full answer.

the first and the main problem was, that i lost my composer.lock file
the second was, webimpress/http-middleware-compatibility

- Installing webimpress/http-middleware-compatibility (0.1.3): Loading from cache
Enter the version of http-interop/http-middleware to require (or leave blank to use the latest version):
Using version ^0.5.0 for http-interop/http-middleware

Any way, thanks for such powerful instrument like Expressive! )

firefred commented Oct 12, 2017

@weierophinney
Thanks for the full answer.

the first and the main problem was, that i lost my composer.lock file
the second was, webimpress/http-middleware-compatibility

- Installing webimpress/http-middleware-compatibility (0.1.3): Loading from cache
Enter the version of http-interop/http-middleware to require (or leave blank to use the latest version):
Using version ^0.5.0 for http-interop/http-middleware

Any way, thanks for such powerful instrument like Expressive! )

@weierophinney

This comment has been minimized.

Show comment
Hide comment
@weierophinney

weierophinney Oct 12, 2017

Member

@firefred I think this is all resolved currently with the 2.0.5 release of zend-expressive, and the 2.0.4 release of the skeleton. Please open a new issue if you still encounter problems. If you do, please include the following information:

  • Were you creating a new project, or updating an existing application?
  • If it was a new project:
    • What version of the skeleton did it try to install?
    • What were the choices you made when the installer prompted you?
  • If it was an existing project:
    • What was your composer.json prior to update?
    • What is the output of composer show prior to update?
    • Were you prompted to add http-interop/http-middleware to your application? If so, what version did you specify?

Thanks!

Member

weierophinney commented Oct 12, 2017

@firefred I think this is all resolved currently with the 2.0.5 release of zend-expressive, and the 2.0.4 release of the skeleton. Please open a new issue if you still encounter problems. If you do, please include the following information:

  • Were you creating a new project, or updating an existing application?
  • If it was a new project:
    • What version of the skeleton did it try to install?
    • What were the choices you made when the installer prompted you?
  • If it was an existing project:
    • What was your composer.json prior to update?
    • What is the output of composer show prior to update?
    • Were you prompted to add http-interop/http-middleware to your application? If so, what version did you specify?

Thanks!

@batumibiz

This comment has been minimized.

Show comment
Hide comment
@batumibiz

batumibiz Oct 22, 2017

I want to complain of the applied webimpress/http-middleware-compatibility package
The matter is that he pulls for himself dependence of webimpress/composer-extra-dependency which forcibly changes the list of dependences in root composer.json even in spite of the fact that the necessary dependence is already registered in that package where I use zend-expressive
I think that such behavior is unacceptable, Without my permission, there should be no change in the root composer. json

batumibiz commented Oct 22, 2017

I want to complain of the applied webimpress/http-middleware-compatibility package
The matter is that he pulls for himself dependence of webimpress/composer-extra-dependency which forcibly changes the list of dependences in root composer.json even in spite of the fact that the necessary dependence is already registered in that package where I use zend-expressive
I think that such behavior is unacceptable, Without my permission, there should be no change in the root composer. json

@weierophinney

This comment has been minimized.

Show comment
Hide comment
@weierophinney

weierophinney Oct 22, 2017

Member
Member

weierophinney commented Oct 22, 2017

@belgattitude

This comment has been minimized.

Show comment
Hide comment
@belgattitude

belgattitude Nov 14, 2017

Contributor

http-middleware is now abandonned (on packagist) and have been splitted into

https://github.com/http-interop/http-server-middleware
https://github.com/http-interop/http-server-handler

I think this issue can be closed.

@weierophinney I guess you're aware of this change, do you have any update about the news of PSR-15 ?

Contributor

belgattitude commented Nov 14, 2017

http-middleware is now abandonned (on packagist) and have been splitted into

https://github.com/http-interop/http-server-middleware
https://github.com/http-interop/http-server-handler

I think this issue can be closed.

@weierophinney I guess you're aware of this change, do you have any update about the news of PSR-15 ?

@weierophinney

This comment has been minimized.

Show comment
Hide comment
@weierophinney

weierophinney Nov 14, 2017

Member

@belgattitude We're finalizing the packages this week so we can do a vote to enter the review period. If there are no further changes or feedback indicating changes are needed once review is over, we can put it up to an acceptance vote by the core committee.

The review period lasts for 4 weeks, the CC vote for 2 weeks, so, realistically, we're looking at early January at the earliest for it to be final.

We'll likely be providing a way to test against this latest version of the spec and its packages soon, but likely as a v3.0.0-beta or -alpha version.

Member

weierophinney commented Nov 14, 2017

@belgattitude We're finalizing the packages this week so we can do a vote to enter the review period. If there are no further changes or feedback indicating changes are needed once review is over, we can put it up to an acceptance vote by the core committee.

The review period lasts for 4 weeks, the CC vote for 2 weeks, so, realistically, we're looking at early January at the earliest for it to be final.

We'll likely be providing a way to test against this latest version of the spec and its packages soon, but likely as a v3.0.0-beta or -alpha version.

@belgattitude

This comment has been minimized.

Show comment
Hide comment
@belgattitude

belgattitude Nov 15, 2017

Contributor

@weierophinney Just wanted to thank you all you efforts and especially the good vibe you give to the project... Don't feel you need to rush for the 3.0.0-alpha version, I'm very confident you'll make everything best as it can. Keep up the good work.

Contributor

belgattitude commented Nov 15, 2017

@weierophinney Just wanted to thank you all you efforts and especially the good vibe you give to the project... Don't feel you need to rush for the 3.0.0-alpha version, I'm very confident you'll make everything best as it can. Keep up the good work.

@gilbertoalbino

This comment has been minimized.

Show comment
Hide comment
@gilbertoalbino

gilbertoalbino Dec 1, 2017

I used to be an extensive user of Zend Framework 1, and got quite disappointed with ZF2 being so slow - which made me switch to Laravel for long 3 years... and today I just tried to play with ZF3 installing Expressive and just came around to the same problem of http-interop/http-middleware not being compatible with that!

Well, it's a very common problem of software dependencies... but what scared me was the fact that it is a "PSR" Implementation breaking change!!! What were PSR's supposed to do other than breaking changes? Interoperate? Inter-what?

Can someone effectively guide how to install Zend Expressive alongside this obscure implementation of PS'atan'R's dependency?

@weierophinney I just followed the Getting Started from the docs and run accross this question from composer:

Enter the version of http-interop/http-middleware to require (or leave blank to use the latest version):

If I leave as is PHP says that:

Fatal error: Interface 'Interop\Http\ServerMiddleware\MiddlewareInterface' not found in C:\Users\Zyne\htdocs\zend-expressive\vendor\zendframework\zend-expressive\src\Middleware\RouteMiddleware.php on line 33

How to proceed with the above question - because leaving it blank keeps triggering this error.

What "version" should I use? Don't make me go back to Laravel!!!!

[Edited] I tried ^0.4.1 but it says I should avoid it! Is that the way to go?

gilbertoalbino commented Dec 1, 2017

I used to be an extensive user of Zend Framework 1, and got quite disappointed with ZF2 being so slow - which made me switch to Laravel for long 3 years... and today I just tried to play with ZF3 installing Expressive and just came around to the same problem of http-interop/http-middleware not being compatible with that!

Well, it's a very common problem of software dependencies... but what scared me was the fact that it is a "PSR" Implementation breaking change!!! What were PSR's supposed to do other than breaking changes? Interoperate? Inter-what?

Can someone effectively guide how to install Zend Expressive alongside this obscure implementation of PS'atan'R's dependency?

@weierophinney I just followed the Getting Started from the docs and run accross this question from composer:

Enter the version of http-interop/http-middleware to require (or leave blank to use the latest version):

If I leave as is PHP says that:

Fatal error: Interface 'Interop\Http\ServerMiddleware\MiddlewareInterface' not found in C:\Users\Zyne\htdocs\zend-expressive\vendor\zendframework\zend-expressive\src\Middleware\RouteMiddleware.php on line 33

How to proceed with the above question - because leaving it blank keeps triggering this error.

What "version" should I use? Don't make me go back to Laravel!!!!

[Edited] I tried ^0.4.1 but it says I should avoid it! Is that the way to go?

@webimpress

This comment has been minimized.

Show comment
Hide comment
@webimpress

webimpress Dec 1, 2017

Contributor

@gilbertoalbino Sorry to hear about your issues.
PSR-15 it is not yet accepted and it has been changed recently very dynamically. Expressive 2.0 was supporting http-interop/http-middleware in version 0.4.1, then version 0.5.0 has been release.
I've prepared compatibility layer (webimpress/http-middleware-compatibility) which allows choose the version of http-interop middleware to use - this is why you've got the question.
We released some components whit support of 0.5.0 version, but unfortunately not expressive. It was already merged to develop and almost ready to go live, but in the last moment new version of PSR-15 base has been released - they decided to split the repository into two libraries, and support only PHP 7.0 - and now we have http-interop/http-server-middleware and http-interop/http-server-handler. Since then http-interop/http-middleware is abandoned. Because of that we decided to work on Expressive 3.0 which will support only final PSR-15.
For more information about it you can have a look on forum:
https://discourse.zendframework.com/t/psr-15-compatibility-issues-and-proposal/378
We can't provide easly support of every version of http-interop middleware because these requires different version of PHP and are in different libraries. I believe PSR-15 will be accepted in January 2018, before that we should have Expressive 3.0 alpha, and as soon as PSR-15 is accepted Expressive 3.0 beta/RC :)

The way to go right now is to use expressive with http-interop/http-middleware 0.4.1, because it is the only supported version by zend-expressive module. All other modules also support this version, and some of them support version 0.5.0 through compatibility layer mentioned above.
I recommend to use expressive-skeleton:
https://github.com/zendframework/zend-expressive-skeleton
and command:

$ composer create-project zendframework/zend-expressive-skeleton <project-path>

(I've just checked this on my machine and all seems to be right).

Please tell us what exactly you did - did you try to install only expressive, without the skeleton?
I hope it was helpful for you and let us know if you have any further issues. Thanks!

Contributor

webimpress commented Dec 1, 2017

@gilbertoalbino Sorry to hear about your issues.
PSR-15 it is not yet accepted and it has been changed recently very dynamically. Expressive 2.0 was supporting http-interop/http-middleware in version 0.4.1, then version 0.5.0 has been release.
I've prepared compatibility layer (webimpress/http-middleware-compatibility) which allows choose the version of http-interop middleware to use - this is why you've got the question.
We released some components whit support of 0.5.0 version, but unfortunately not expressive. It was already merged to develop and almost ready to go live, but in the last moment new version of PSR-15 base has been released - they decided to split the repository into two libraries, and support only PHP 7.0 - and now we have http-interop/http-server-middleware and http-interop/http-server-handler. Since then http-interop/http-middleware is abandoned. Because of that we decided to work on Expressive 3.0 which will support only final PSR-15.
For more information about it you can have a look on forum:
https://discourse.zendframework.com/t/psr-15-compatibility-issues-and-proposal/378
We can't provide easly support of every version of http-interop middleware because these requires different version of PHP and are in different libraries. I believe PSR-15 will be accepted in January 2018, before that we should have Expressive 3.0 alpha, and as soon as PSR-15 is accepted Expressive 3.0 beta/RC :)

The way to go right now is to use expressive with http-interop/http-middleware 0.4.1, because it is the only supported version by zend-expressive module. All other modules also support this version, and some of them support version 0.5.0 through compatibility layer mentioned above.
I recommend to use expressive-skeleton:
https://github.com/zendframework/zend-expressive-skeleton
and command:

$ composer create-project zendframework/zend-expressive-skeleton <project-path>

(I've just checked this on my machine and all seems to be right).

Please tell us what exactly you did - did you try to install only expressive, without the skeleton?
I hope it was helpful for you and let us know if you have any further issues. Thanks!

@gilbertoalbino

This comment has been minimized.

Show comment
Hide comment
@gilbertoalbino

gilbertoalbino Dec 1, 2017

@webimpress Thanks for so fast reply!

To make the switch from Laravel to Zend Expressive I have recently bought the Matthew Setter's book.
He proposes to start by creating the bootstrap process manually in order to get acquainted of how Expressive works. I really enjoy this approach. As soon as I experienced this issue I visited the official docs and in fact the overall process was quite the same.

Lastly, I might have got stuck in this approach.

I am Ok to use the Skeleton Project, but will Expressive 3.0 cause to be different from what it is now?

Also, I am not in the mood to refactor my code in the next few months.

I built two huge projects with ZF2 and got quite frustrated making the move to the modern ZF3 approach.

Will take a try with the Skeleton, anyways!

Thanks!

gilbertoalbino commented Dec 1, 2017

@webimpress Thanks for so fast reply!

To make the switch from Laravel to Zend Expressive I have recently bought the Matthew Setter's book.
He proposes to start by creating the bootstrap process manually in order to get acquainted of how Expressive works. I really enjoy this approach. As soon as I experienced this issue I visited the official docs and in fact the overall process was quite the same.

Lastly, I might have got stuck in this approach.

I am Ok to use the Skeleton Project, but will Expressive 3.0 cause to be different from what it is now?

Also, I am not in the mood to refactor my code in the next few months.

I built two huge projects with ZF2 and got quite frustrated making the move to the modern ZF3 approach.

Will take a try with the Skeleton, anyways!

Thanks!

@webimpress

This comment has been minimized.

Show comment
Hide comment
@webimpress

webimpress Dec 1, 2017

Contributor

@gilbertoalbino

@weierophinney Thanks for so fast reply!

I'm @webimpress, not @weierophinney :)

Also, I am not in the mood to refactor my code in the next few months.

If you start now on Expressive 2.0 then you will have update to Expressive 3.0 but I think this update shouldn't be difficult. Of course I'm not sure how far we are gonna go with version 3.0 but definitely everything will be documented and we will be always happy to help you with migration (see our forum and slack).

I migrated couple applications from Expressive 1.0 to 2.0 and it was quite easy.

We try to make migration as easiest as possible. We working also on some tools which helps with migration - see https://github.com/zendframework/zend-expressive-tooling and here is my PR with new tool for expressive 3.0.0-alpha1: zendframework/zend-expressive-tooling#39
As you can see it's a bit different than between ZF2->ZF3.
I believe that in final version of expressive we will have even more tools and the update path will be clear and painless. I wouldn't be worried about this right now 😄

Contributor

webimpress commented Dec 1, 2017

@gilbertoalbino

@weierophinney Thanks for so fast reply!

I'm @webimpress, not @weierophinney :)

Also, I am not in the mood to refactor my code in the next few months.

If you start now on Expressive 2.0 then you will have update to Expressive 3.0 but I think this update shouldn't be difficult. Of course I'm not sure how far we are gonna go with version 3.0 but definitely everything will be documented and we will be always happy to help you with migration (see our forum and slack).

I migrated couple applications from Expressive 1.0 to 2.0 and it was quite easy.

We try to make migration as easiest as possible. We working also on some tools which helps with migration - see https://github.com/zendframework/zend-expressive-tooling and here is my PR with new tool for expressive 3.0.0-alpha1: zendframework/zend-expressive-tooling#39
As you can see it's a bit different than between ZF2->ZF3.
I believe that in final version of expressive we will have even more tools and the update path will be clear and painless. I wouldn't be worried about this right now 😄

@belgattitude

This comment has been minimized.

Show comment
Hide comment
@belgattitude

belgattitude Dec 1, 2017

Contributor

@gilbertoalbino

I tried ^0.4.1 but it says I should avoid it! Is that the way to go?

I guess you explicitly added the requirement to your project composer.json ? Like this:

  "require": {
        "http-interop/http-middleware": "^0.4.1",

This should resolve your issue, IMHO don't worry about the message 'http-interop-http-middleware is abandoned...',

Also, I am not in the mood to refactor my code in the next few months.

it's gonna be easy to upgrade when (if) PSR15 is final (for now in voting phase). I agree with @webimpress, upgrading from 1.0 to 2.0 was really easy (both with the provided tooling, or by-hand refactoring: it's gonna be changing an interface name and a method in your middlewares. Logic will be the same, no worry).

A good tip, subscribe to the slack channel and the discourse forums. The community is really helpful.

Contributor

belgattitude commented Dec 1, 2017

@gilbertoalbino

I tried ^0.4.1 but it says I should avoid it! Is that the way to go?

I guess you explicitly added the requirement to your project composer.json ? Like this:

  "require": {
        "http-interop/http-middleware": "^0.4.1",

This should resolve your issue, IMHO don't worry about the message 'http-interop-http-middleware is abandoned...',

Also, I am not in the mood to refactor my code in the next few months.

it's gonna be easy to upgrade when (if) PSR15 is final (for now in voting phase). I agree with @webimpress, upgrading from 1.0 to 2.0 was really easy (both with the provided tooling, or by-hand refactoring: it's gonna be changing an interface name and a method in your middlewares. Logic will be the same, no worry).

A good tip, subscribe to the slack channel and the discourse forums. The community is really helpful.

@Ocramius

This comment has been minimized.

Show comment
Hide comment
@Ocramius

Ocramius Jan 28, 2018

Member

FWIW, PSR-15 is final, so I wouldn't pursue this any further. Upgrading to PSR-15 is the way to go here.

Member

Ocramius commented Jan 28, 2018

FWIW, PSR-15 is final, so I wouldn't pursue this any further. Upgrading to PSR-15 is the way to go here.

@Ocramius Ocramius closed this Jan 28, 2018

@Ocramius Ocramius self-assigned this Jan 28, 2018

@Ocramius Ocramius added the wontfix label Jan 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment