Upgrade to Symfony4 and Flex!

We'll email you with updates

This course is in the planning stages

Symfony 4! Flex! Autowiring! Buzzwords!

Symfony 4 comes with a whole new way of developing your apps: faster and more flexible than ever. But how can you upgrade a Symfony 3 app to Symfony 4? And how can you leverage Symfony Flex if you have an existing project? In this tutorial, we'll cover:

  • Upgrading to Symfony 3.4
  • Fixing deprecations & the continuous upgrade path
  • Updating to the Symfony Flex directory structure
  • Moving onto Symfony 4

There's no reason to get left behind. Let's go!


Your Guides

Ryan Weaver

Questions? Conversation?

  • 2017-12-14 Geoff Maddock

    It's all pretty new to us, since we were sort of "stuck" on a 1.4 app for many years. We didn't have a ton of development resources to do a major update until now, we only recently started learning the 3.x way of doing things. However, we're also not stuck doing things that way, as we're still early in our redesign process.

    If we did go the flex route, it didn't seem like we could combine that with multiple kernels. And if so, it wasn't clear how we'd rebuild our app within one kernel. Currently all of our apps share the model and business logic, but use different routing, templates and authorization rules. If having a smaller container per app (kernel) is less of an issue now, then I could see us trying to put it under one kernel and flex. Still need to learn more about it in detail.

  • 2017-12-14 weaverryan

    Yo Geoff Maddock!

    Wow! that's really exciting! Let's talk about the multiple kernel thing first. It's only *not* recommended because it basically adds technical complexity that very few projects really need. But, there's nothing wrong with this approach. There is only one benefit to it: performance. By separating kernels, your admin kernel only contains your admin routes/services, nothing from API, for example.

    However (and I have no hard stats to back this up). thanks to some container optimizations in Symfony 3.4, Nicolas Grekas tells me that the performance advantage of multiple kernels is now greatly reduced. Specifically, having a "smaller container" no longer makes a difference. You *will* still have some performance differences because you will have less routes, and API-related event listeners won't need to run for the admin. But the point is: the performance cost is now lower, so you need to look at the multi kernel decision carefully. The added complexity is real: your app will look and behave a bit differently than a normal Symfony app. But, it's still a valid approach.

    Another thing you guys will need to think about is whether or not you use a Flex directory structure (it works fine on 3.4). The advantages or many: it's the new way of doing things, and upgrading to 4.x will be easier later (and your project will look like the current documentation). The only disadvantage is that, since Flex is just out, there are less resources, and a few minor things may change. Basically, you're a bit more "cutting edge". Without knowing anything about your project, I would nudge you towards Flex. It will also be at least a little bit faster (since you control your dependencies more), if that's important.

    Cheers!

  • 2017-12-14 Geoff Maddock

    Our team has an existing Symfony 1.4 project that contains multiple apps (Frontend, Backend and API) within one project. We just cleared our next 6+ months to look at rebuilding in Symfony 3.x, and were initially thinking about building the project using different kernels for each app. Looking at 4.x, and flex, that doesn't seem recommended any longer we're not sure what the best structure for our project might be if we try to base the new design on 4.x. Would love to hear any thoughts on updating a project with the structure we have, whether there is a best practice or if we'll have to go against convention, or possibly re-conceptualize the structure of our project.

  • 2017-12-05 the_nuts

    Looking forward to renew my subscription as soon as it's released :)

  • 2017-11-30 weaverryan

    Hey Sebastian Majchrzak!

    Actually, you can click the "Notify me when course is available" button above and we'll email you when it's ready (hopefully very soon!). But to answer your question, once Symfony 3.4 and 4 is released (which is literally happening at this moment!) you can use either! But, you should *definitely* structure your project using flex - that is 100% for sure! I would recommend using Symfony 4, as 3.4 and 4 have the same features (so why use Symfony 3.4?). But, there is one reason that 3.4 *might* be better during the short-term: we are still waiting for community libraries and bundles to allow Symfony 4. So, if you use Symfony 4 immediately, there may be some libraries & bundles you can't use right away.

    Somewhat related: Symfony 4 is going to be AMAZING! :D

    Cheers!

  • 2017-11-30 Sebastian Majchrzak

    Hi, can you tell me when is this course ready? I want to create a new project but don't know which version I should be used 3.4 or I should wait for Symfony 4.

  • 2017-11-10 Felipy Amorim

    Awesome, waiting for this.