This is my first “lockdown” week-end after a week of confinement. I’m not alone. Most of us are confined now. Most of the world is confined or will be very soon.
I won’t go outside this week-end and that’s fine.
I’m lucky. I share my life with my wife and my two sons in my apartment in Lille, France. Hopefully, we’re not infected. Not yet. We’re now following the rules very strictly. To protect us, but more importantly, to protect everyone else. Let’s not be selfish.
In January and February, the weather was bad. It rained every single day. Or it seemed so. Since the beginning of the week, sun made a big come back. The sun taunts me. If you know me a little, you know that I would really like to go outside. Buy a book in my local bookstore, buy some groceries, find some new cheese to taste, bike to the butcher, jog in the biggest public park of the city. I would love to do all of these activities today. Like every “regular” Saturday. But for the next few weeks, my world will look different. I need to adapt. And that’s fine. …
We get a lot of positive feedback on Symfony 4. You love the new directory structure. You love the simplicity of using services without configuring anything. And you love the automation that Flex provides. It makes me happy and proud.
But one issue I hear sometimes is that it is more complex to start a new project. Most projects need many Symfony features. But new projects now have bare minimum dependencies when created via
composer create-project symfony/skeleton. You need to explicitly add all the dependencies you want to depend on. Being explicit is great, but UX suffers. Ever tried to add
profiler and didn't get timing info? …
Performance is an interesting and sensitive topic. Suffice to say that most projects should not care too much; modern PHP frameworks are fast enough for most use cases and projects. And PHP 7 performance improvements help a lot as well. But people like to compare frameworks, and I guess performance is one way to do so.
What about Symfony 4? During its development cycle, we did some nice performance optimizations: mainly to improve the router and container speed. But several non-related changes in Symfony 4 also help with performance… Your mileage may vary depending on your specific project of course.
Synthetic benchmarks that were made to back pull requests that claimed to improve performance do not always convert to gain on real-world projects. Now that Symfony 4 is out, it’s time to test a full project. An “Hello World!” application benchmark is a good start as it helps understand the base performance of a framework. It helps understand the overhead added on top of PHP by your framework of choice. …
Symfony 4 is just around the corner. And Symfony Flex is one of the main selling points for the upgrade. Developers love the new philosophy. And a lot of changes happened since my last blog post. Let me recap the recent changes that you might not be aware of. Most of these changes were prompted by feedback from early adopters.
Using recipes from the contrib repository has became easier. The first time you require a package for which a contrib recipe exists, Flex now asks you the permission to execute the recipe. It also lets you switch the “accept contrib recipes” flag for the project (so it does not ask the question again). …
Update: This article has been updated to add missing steps.
After a long discussion in the community, the directory structure has been slightly changed.
etc/ was renamed to
public/. My blog posts about Symfony 4 have just been updated to reflect these changes.
If you already have a project using Symfony Flex, upgrading is as simple as:
symfony/flexto the latest version;
Originally published at fabien.potencier.org.
Time to test Symfony 4… or at least let’s test the experience of developing Symfony 4 projects with Symfony 3.3. Keep in mind that all the tools are in preview mode. Features might evolve over time. I’m waiting for your feedback! The first stable version of Symfony Flex will not be released before Symfony 4 at the end of November 2017. It gives the community plenty of time to discuss the changes I have described in this series of blog posts.
The first step is to create a project. Currently, this needs to be done via
composer create-project. …
Last week, I published the repositories for the Symfony recipes. The main repository is at https://github.com/symfony/recipes, and the contrib one at https://github.com/symfony/recipes-contrib. Both are public. Additions and feedback welcomed.
Today, I want to share with you a small recording I have just made that shows how it feels to use Symfony Flex when creating a new project. It also demonstrates how to add more dependencies and illustrate the auto-configuration part I have written about in my previous blogs posts about Symfony 4. Instead of creating a classical website, this video levers the API Platform recipe recently added to create an API in just a few commands.
Symfony Flex is not Open-Sourced yet, but I can already feel the excitement in the community. I have also received some feedback via Twitter, Slack, and email during the last few days. That makes me really happy!
Everybody knows that I like to tease. Trying to build the momentum on something you have been working on for months feels great. But the reality is a bit more complex: I am still working on the first MVP of the infrastructure needed to support Symfony Flex. …
Symfony 4’s most “innovative” feature is the way it drives the day-to-day application management. No more tedious copy/paste from README files. No more boilerplate code. Automation to the max. On a curated list of Composer packages.
Symfony 4 is powered by Symfony Flex, a deceptively simple but powerful Composer plugin. The default Symfony skeleton only lists two main dependencies:
symfony/framework-bundle. Everything else is optional.
As you can imagine, most projects need more than
FrameworkBundle. And installing and configuring all packages and bundles by hand is error-prone, tedious, and just plain boring. …
Symfony 3 came with a slightly different directory structure than Symfony 2. Symfony 4 will also come with a reworked directory structure. Mostly incremental adjustments to support new features and best practices.
The Symfony 3 directory structure introduced a more standard Unix-like directory structure, with less sub-directories. Symfony 4 keeps going in that direction.
Using well-known directory names helps. Using
var/ was a great step forward. Symfony 4 adds
etc/ in place of
app/. It was proposed for Symfony 3 but rejected for reasons that don't hold anymore.
etc/ has been changed to
config/ after a long discussion with the community. The
web/ directory has also been changed to
public/. The blog posts about Symfony 4 have been updated to reflect these changes. …