FriendsOfSymfony / FOSJsRoutingBundle

A pretty nice way to expose your Symfony routing to client applications.
1.48k stars 261 forks source link

Attempting Symfony 4 support #300

Closed weaverryan closed 6 years ago

weaverryan commented 6 years ago

Hi guys!

This adds Symfony 4 support. I'm not sure if any changes to the code are needed, let's run the tests and find out!

Cheers!

tobias-93 commented 6 years ago

Hi @weaverryan,

It would certainly be nice if we can support SF4! Could you add Travis config to test this? I also see that some tests are failing due to some JS error, will have a look at that later on.

tobias-93 commented 6 years ago

@weaverryan I have fixed the tests for the current master, so you should be able to see what's going on if you add the required Travis config.

ElectricMaxxx commented 6 years ago

Anything going on here?

weaverryan commented 6 years ago

Haha, yep. I forgot about this for a few days! But I (probably) just finished it:

So, no behavior changes or BC breaks, and the bundle (assuming the tests do pass) is now Symfony 4 compat!

weaverryan commented 6 years ago

Tests pass! This should be ready for merge and a new release to make it available :)

weaverryan commented 6 years ago

Comments addressed!

weaverryan commented 6 years ago

@tobias-93 This should be ready. Someone at the hack day has been using/testing this bundle on Symfony 4 with no issues. So beyond the tests passing, I think it should be good :). I'm told this is blocking doctrine/phpcr-bundle Symfony 4 support - the merge+tag will fix that.

Thanks!

tobias-93 commented 6 years ago

Hi @weaverryan,

It looks good to me, thank you for your work! However, I do not agree with dropping support for SF 2.7. As you can see on http://symfony.com/roadmap?version=2.7#checker, it will still be supported for more than 1 year and I think we should do so too, especially because we're not running into any BC conflicts with it. Could you revert your latest commit?

Thanks!

alexchuin commented 6 years ago

Symfony 4.0 is here! Thanks guys :+1:

stof commented 6 years ago

and I agree with @tobias-93 about keeping support for the 2.7 LTS, giving that there is no cost for it at all (we don't have any BC layer for 2.7 support)

ElectricMaxxx commented 6 years ago

@weaverryan can we try to finish this one here?

weaverryan commented 6 years ago

Thanks for the feedback guys! And sorry for the delay - I lost track of this PR.

I've just made the updates... but my final update caused a conflict. I'll have to look later - the baby is awakening!

weaverryan commented 6 years ago

Ha! Nevermind, I finished just in time! Feedback warmly welcome - I'm taking care of everything I'm know of, but I don't know the internals of the bundle super well :).

lsmith77 commented 6 years ago

home stretch! DumpCommandTest::testExecuteFormatOption() still needs to be refactored to remove the container

weaverryan commented 6 years ago

I don't know how I missed that :). Let's try one more time

tobias-93 commented 6 years ago

@weaverryan good work! I see the tests fail because of a deprecation notice existing in PHP 7.2. The deprecated code seems to be in the source of PHPUnit itself (although I cannot test this myself because I have no machine with PHP 7.2 available) and was fixed in a later version. Could you update the version of PHPUnit in the phpunit-script from 6.0 to 6.5? That should include the non-deprecated code.

tobias-93 commented 6 years ago

@weaverryan I like skipping the local phpunit script and just using the Symfony PHPunit-bridge script (which was used anyway with some specific configuration). Could you adjust the docs and remove the phpunit script? Then I think this is ready to be merged!

lsmith77 commented 6 years ago

@stof I think your concerns have been addressed

tobias-93 commented 6 years ago

@weaverryan In the end I think the directory configuration was made for a reason, and it's nice that an error message is shown if someone didn't run composer update. I therefore reverted your last commit and fixed the phpunit script. I think this is ready to be merged now.

weaverryan commented 6 years ago

I'm fine with that - we can discuss it in another PR. simple-phpunit has a few advantages (like reporting deprecations), but it's certainly out of scope.

So, let's merge!!!

tobias-93 commented 6 years ago

simple-phpunit has a few advantages (like reporting deprecations)

If you look carefully, our own phpunit-script does nothing more than check if simple-phpunit is present and set the working directory, before starting simple-phpunit to do the 'real' work :wink:. So no change is needed, really.

weaverryan commented 6 years ago

Ping! Who can merge this and tag a release. Is it you @tobias-93? Any issues left?

tobias-93 commented 6 years ago

@weaverryan Thank you for your effort, I've merged the changes!

tobias-93 commented 6 years ago

I've tagged the 2.1.0 release for your convenience

weaverryan commented 6 years ago

That's perfect! Thanks so much! :D

lsmith77 commented 6 years ago

thank you @weaverryan !