Forest header image

Symfony Finland
Random things on PHP, Symfony and web development

Symfony Flex adoption picks up prior to release of 4.0 in November 2017

With Symfony 4.0 a new standard structure for building applications is being adopted. This is known as Symfony Flex and will be the preferred way of creating applications. Symfony 4.0 is scheduled for release in November 2017, but many projects have already started adopting the new structure.

The Symfony Standard Edition has been the default structure for applications built with Symfony Components. Also known as "Symfony Full Stack", the directory and application structure has been in use since the release of Symfony 2.0 back in 2011. Centered around the concept of reusable extensions, known as Bundles, the Standard Edition has proven to be a stable foundation for application developers.

The trend from Monoliths to Microservices

In six years a lot of things have changed in the web development world, with the rise of front end driven applications, containerised microservices and more. The core team has done a good job keeping Symfony relevant, with continuous improvements to the core technologies as well as non-PHP additions like Symfony Encore for easing building front end applications written in JavaScript.

One thing that has not changed for some time is the Standard Edition itself. It has been critiqued for being enterprisey and heavy on configuration. While Symfony SE continues to provide a solid structure for complex applications, many developers nowadays were drawn to the simplicify of PHP microframeworks like Silex, Slim and Lumen or alternative platforms like Node.js or Go.

The trend was noticed by the team and in December 2016 at the SymfonyCon Berlin Symfony Flex was announced. As more details folded throughout 2017, the approach for Flex is a barebones setup where developers add the dependencies required for their apps. This provides a more appealing approach for microservices, while being able to scale to complex applications like Enterprise Grade CMS, PIM or eCommerce.

Projects already embracing Symfony Flex

Now with the release of Symfony 4.0 and Flex a month away, many projects are already adopting the Flex project structure. Let's take a look at a few prominent projects doing so.

  • API Platform: This project aims to accelerate API Development by providing a full stack from a CRUD admin to automatic documentation generation and more. In the most recent version the project has adopted Symfony Flex and a standard Docker configuration. Project on GitHub: api-platform
  • GraphQL Bundle: This project provides a bridge for integrating the Onyx GraphQL library to generate GraphQL APIs (a REST alternative) to Symfony projects. Since version 0.9 the team has decided to focus on Symfony Flex. Project on GitHub: GraphQLBundle
  • Prooph Project: Prooph is a collection of general purpose CQRS and Event Sourcing components for PHP. This alternative approach to CRUD storage of application can be useful in domains like financial applications, etc. Prooph provides a demo application for Symfony, which has now been migrated to the Flex structure. Project on GitHub: proophessor-do-symfony
  • PhpStorm Symfony Plugin: Not a Symfony-application per se, this project provides tooling for working with Symfony projects with the popular PhpStorm IDE. With over 2.3 Million downloads, this is an important tool for developers. In the recent months the Symfony Plugin has been gradually adding support for Flex applications. Project on GitHub: idea-php-symfony2-plugin

Conclusion

The early availability of Symfony Flex since April 2017 (with 3.3 components) has allowed developers to get a hands on feel for the new default structure well before hand. This has lead to things like the dropping of Makefiles, opting for the Console component as a dependency. More importantly, this is now manifesting with adoption picking up even before Beta releases of Symfony 4.0 (and 3.4) were available.

Early adoption also goes to show that the revamp of the project structure is a welcome change by developers. While the Symfony Standard Edition structure remains a solid choice for many applications for years to come, new projects will undoubtedly be picking up Symfony Flex

Initially the move to Flex might seem like a radical change. But because the underlying components and the bundle structure continue to be used, the migration path to Symfony Flex is not a giant undertaking. All in all Flex is an important part to moving Symfony forward. To get started, learn how to Use Symfony Flex to Manage Symfony Applications.

Learn more about Symfony Flex:


Written by Jani Tarvainen on Tuesday October 31, 2017
Permalink -

« Running Symfony without a web server on Docker using PHP-PM - Attaching React.js to a template rendered on the server with Twig »