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

New article "How to upgrade your bundle to Symfony 3.0" #5879

Closed
javiereguiluz opened this Issue Nov 9, 2015 · 15 comments

Comments

Projects
None yet
8 participants
@javiereguiluz
Copy link
Member

javiereguiluz commented Nov 9, 2015

Problem

Symfony 3.0 is approaching fast. If you've tried to upgrade your apps to Symfony 3, you've probably failed because none of the popular bundles is compatible with Symfony 3 yet.

Solution

Let's create a short article explaining how to make third-party bundles compatible with Symfony 3.

What we need from you

Ideas, comments and proposals to outline the contents of that article. Once the outline is ready, I'll try to write the article so we can review it and publish it as soon as possible. Thanks!

@javiereguiluz

This comment has been minimized.

Copy link
Member

javiereguiluz commented Nov 9, 2015

Some ideas of things we should explain:

  • How to test your bundle in a Symfony 3.0 application (it's not that easy right now because things are very unstable ... for example I cannot make the Symfony Demo app work for 3.0)
  • How to look for deprecated features used in your bundle.
  • Reference documents explaining all the deprecated Symfony features (the UPGRADE.md files should be enough)
  • How to set up Travis to test your bundle for both Symfony 2 and 3.
@weaverryan

This comment has been minimized.

Copy link
Member

weaverryan commented Nov 9, 2015

Is there a model bundle (composer.json, .travis.yml, needing to do any weird things to keep compatibility with 3.0, but also older versions) that can be used as a model?

@javiereguiluz

This comment has been minimized.

Copy link
Member

javiereguiluz commented Nov 9, 2015

Our friend @wouterj has set up a public list with the current Symfony 3 support of the most popular bundles: https://docs.google.com/spreadsheets/d/1GOxJ2lNpLxN12YyZ87Bhsxb0iLAQ7e4UDZbJSly8Sy8/edit#gid=0

@theofidry

This comment has been minimized.

Copy link
Contributor

theofidry commented Nov 9, 2015

@javiereguiluz can we add any bundle to it or should we go through a process of some kind for that?

@javiereguiluz

This comment has been minimized.

Copy link
Member

javiereguiluz commented Nov 9, 2015

Wouter told me that it's OK if the community adds their own bundles. We just started with the Top 30.

@wouterj

This comment has been minimized.

Copy link
Member

wouterj commented Nov 9, 2015

I think we should not add any random bundle from KNPbundles on the list as, let's face it, there are many bundles that have a very limited user group and maintaince. I think it's important to have most of the popular/widely used bundles in the list.

@javiereguiluz

This comment has been minimized.

Copy link
Member

javiereguiluz commented Nov 9, 2015

Another thing we should mention:

  • Install this: composer require --dev "symfony/phpunit-bridge"
@wouterj

This comment has been minimized.

Copy link
Member

wouterj commented Nov 9, 2015

  • Don't use Kernel::VERSION_ID to check the API version, check the specific component. E.g. for the OptionsResolver API rewrite (2.6), use method_exists('Symfony\Component\OptionsResolver\OptionsResolver', 'setDefined') (most of the time, can be shortend as method_exists($resolver, 'setDefined'). For the Form component type name refactoring and everything related to that (2.8), use method_exists($this, 'getBlockPrefix') in form types or class_exists('Symfony\Component\Form\Util\StringUtil').

@piotrantosik piotrantosik referenced this issue Nov 9, 2015

Closed

Fix #67 #72

@linaori

This comment has been minimized.

Copy link
Contributor

linaori commented Nov 10, 2015

@javiereguiluz I was searching for some docs on it but all I could find was this: http://symfony.com/blog/new-in-symfony-2-7-phpunit-bridge

I simply ran the install and it worked though. The weird thing is, it's also in symfony/symfony thus I expected it to be working already, but it didn't. I had to manually add it to require-dev before it did anything. https://github.com/symfony/symfony/tree/2.8/src/Symfony/Bridge/PhpUnit

@linaori

This comment has been minimized.

Copy link
Contributor

linaori commented Nov 10, 2015

Okay small addition to my previous reply, it's kind of confusing how the bridge is integrated into the framework and phpunit. I found some docs on https://github.com/symfony/phpunit-bridge but I could find 0 documentation via google besides of that. I went to this repository and searched for phpunit-bridge to end up on this page: http://symfony.com/doc/current/cookbook/upgrade/major_version.html

Maybe something could be done to index this page a bit better?

@umpirsky

This comment has been minimized.

Copy link
Contributor

umpirsky commented Nov 10, 2015

@javiereguiluz I started a tool to help with the upgrade https://github.com/umpirsky/Symfony-Upgrade-Fixer.

I hope people will recognize the potential and contribute fixers. That will make tool more useful for everyone. If you mention it in the article, I think that will help. :)

@weaverryan

This comment has been minimized.

Copy link
Member

weaverryan commented Nov 16, 2015

Ok, now we actually need to write and post about this. Takers? I can't promise I'll be able to do it as quickly as it needs to be done. But if someone can quickly throw together all these details, we'd be in great shape for a quick merge.

@javiereguiluz

This comment has been minimized.

Copy link
Member

javiereguiluz commented Nov 16, 2015

I can work on this tomorrow morning ... or at least I can try to bootstrap the article.

@wouterj

This comment has been minimized.

Copy link
Member

wouterj commented Nov 16, 2015

I just added it to my list for tomorrow evening, but if you want to do it @javiereguiluz feel free to do so :)

@xabbuh xabbuh added the hasPR label Nov 20, 2015

weaverryan added a commit that referenced this issue Mar 6, 2016

feature #5894 [WIP] Added an article to explain how to upgrade third-…
…party bundles to Symfony 3 (javiereguiluz)

This PR was merged into the 2.3 branch.

Discussion
----------

[WIP] Added an article to explain how to upgrade third-party bundles to Symfony 3

| Q             | A
| ------------- | ---
| Doc fix?      | no
| New docs?     | yes
| Applies to    | all
| Fixed tickets | #5879

I've just drafted the skeleton of the article to have something to discuss about the contents.

Commits
-------

cb31c16 Added a new section of tips and tricks to upgrade bundles to Symfony 3.0
3697d81 Fixed a lot of issues reported by Wouter
1e2ccd1 Completed the section "Test your Bundle in Symfony 3"
4b13fab Completed the section "Look for Deprecations and Fix Them"
0e585b4 Completed "Allow to Install Symfony 3 Components" section
4e93eb5 Added an article to explain how to upgrade third-party bundles to Symfony 3

@weaverryan weaverryan closed this Mar 6, 2016

@TomasVotruba

This comment has been minimized.

Copy link
Contributor

TomasVotruba commented Oct 24, 2017

Just wondering, is these similar sheets initiative for Symfony 4?
I would love to help with upgrading with @rectorphp

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