contact@sabrineferchichi.fr
100%
🇺🇸 EN
  • 🇺🇸 English
  • 🇫🇷 Français
SF Sabrine F. Portfolio
Contact
  • Portfolio
  • Blog
  • About
Contact
SF Sabrine F. Portfolio
  • About
  • Portfolio
  • Blog
  • Contact
Languages
🇺🇸 English 🇫🇷 Français
Accessibility
100%

Sylius V2 - Symfony 7 Compatibility

  1. Home
  2. Blog
  3. Sylius V2 - Symfony 7 Compatibility
Sylius V2 - Symfony 7 Compatibility

The release of Sylius V2 marks a major step forward for e-commerce developers. Now compatible with Symfony 7, this version offers unparalleled performance, simplified code, and innovative tools to accelerate your PHP projects.

Increased Performance thanks to Symfony 7

Compatibility with Symfony 7 allows Sylius V2 to leverage major optimizations in request handling, code execution, and memory management. These improvements make applications more responsive and scalable.

What's New in Symfony 7

Early Hints for Fast Navigation

"Early Hints" represent one of the newest and most effective techniques for improving user experience by optimizing the perceived performance of your websites and applications. Thanks to Early Hints, servers can tell browsers which essential resources (such as CSS, JavaScript, web fonts, etc.) should start loading immediately, even before the full server response is ready.

How do Early Hints work?

From a technical standpoint, Early Hints use an HTTP response with status code 103. This response contains HTTP headers specifying resources to preload. For example, a server could inform the browser to start loading certain CSS or JS files before receiving the full response:

103 Early Hints
Link: ; rel=preconnect
Link: ; rel=preload; as=style
Link: ; rel=preload; as=script

These headers allow the browser to prepare these resources even before the full page is sent. Although these resources are also sent in the full response, their rapid pre-loading significantly improves the page's perceived performance.

According to Cloudflare studies, this method can lead to performance improvements ranging from 10% to 20% depending on the type of website.

Implementing Early Hints in Symfony

Symfony 7 facilitates Early Hints integration thanks to the convenient sendEarlyHints() method, available in the AbstractController class. Here is an example of how you can use it to preload resources:

Early Hints

The sendEarlyHints() method creates and sends an HTTP response with code 103 for Early Hints, then returns the Response object that you can use to send the complete page response.

Simplified Asset Management

With Symfony 7, AssetMapper allows you to build a modern frontend by leveraging the latest web standards such as ECMAScript modules (ESM), importmaps, and resource preloading, without needing complex build tools or Node configuration. This approach significantly simplifies the integration of JavaScript and CSS files into your application, allowing you to focus more on business logic and less on configuration.

1. Install JavaScript packages in your application
composer require symfony/asset-mapper
php bin/console importmap:require js-confetti
2. Use packages immediately
// assets/app.js
import JSConfetti from 'js-confetti';

const jsConfetti = new JSConfetti();
jsConfetti.addConfetti();

As you can see, with AssetMapper, adding new JavaScript libraries becomes child's play. Simply import the library, initialize it, and use it. No complex configuration is required, and it works directly upon page reload.

Console Command Profiling

The Symfony Profiler is one of the most beloved tools among Symfony developers. It collects all information related to HTTP requests, allowing them to be easily inspected when identifying issues in an application. However, starting with Symfony 6.4 and 7.0, it becomes even more powerful by offering the ability to profile console commands as well.

Console Command Profiling with Symfony 7

Console command profiling allows developers to analyze the behavior of their custom commands, inspect their execution, and optimize their performance. Here is how you can benefit from it:

Using the --profile option

To profile a command, simply add the --profile option during execution:

php bin/console --profile app:my-command

When this option is enabled and debug mode is active in your application, Symfony collects information related to the running command. Once the command is finished (or interrupted), you can view its profile in the same Symfony Profiler used for HTTP requests.

Displaying the Profile in the Console

If you run the command in verbose mode (-v), Symfony will display a clickable link to the command profile in the console output (if your terminal supports links). In more detailed debug mode (-vvv), you can also see the time and memory consumed by the command, allowing you to optimize custom command performance.

Usage Example

Here is an example of using this feature in a terminal:

php bin/console --profile app:my-command

By adding the --profile option, Symfony will collect and display information about the command execution. After execution, you can access a detailed report directly in the Symfony Profiler to analyze your command's performance.

Command Profiler

Webhooks and RemoteEvent

Webhooks allow applications to react to external events without needing to constantly poll third-party services. Symfony 7 introduces a new Webhook component and a RemoteEvent component to easily integrate external event notifications and improve application responsiveness.

A webhook is a function that allows you to receive a real-time notification when external events occur. For example, when an update is made to a GitHub repository, a webhook can be used to immediately inform your application to process that update.

Here is an example of how you can configure a Webhook in Symfony 7:

webhook

In this example, we use a parser to analyze the request and verify that the content meets defined criteria. Then, we create an event that can be consumed by another part of the application.

Consuming a Webhook in Symfony

After defining a Webhook, you can consume it with an event handler as follows:

webhook consumption

Simplified Access Token

Symfony 7 facilitates the integration of secured APIs with access tokens. The introduction of a native authenticator for access tokens simplifies their management and use in applications.

The Clock Component

The Clock component allows abstracting time management during tests. It offers different options, such as MockClock for simulating a fake clock and MonotonicClock for more precise performance analysis.

Sylius V2, in combination with Symfony 7, represents a real turning point for developers. Not only does compatibility with Symfony 7 improve performance, but it also facilitates development with simpler and more modular code. The adoption of best practices and the integration of Symfony 7 features ensure a solid foundation for building robust and scalable applications. This update is one step further toward a more performant and maintainable ecosystem.

  • No comments
  • No likes
Prev

Sylius V2 - Symfony Workflow Alternative to Winzou State Machine

Next

Sylius V2 - A New Era of Interactivity with Symfony UX

Sabrine FERCHICHI

Sabrine FERCHICHI

Lead Developer, Sylius expert and certified Agile Scrum Developer. Specialized in designing robust e-commerce architectures, I share my technical monitoring and feedback here, primarily focused on the Sylius and Symfony ecosystem.

No comments

Leave a comment

Latest articles

Sylius V2 - Payment Simpl...

Sylius V2 - Payment Simplification and "...

25 Dec 2025

Sylius V2 - New Bootstrap...

Sylius V2 - New Bootstrap-based Admin UI...

18 Dec 2025

Sylius V2 - Template Cust...

Sylius V2 - Template Customization with ...

11 Dec 2025

Sylius V2 - Improvements ...

Sylius V2 - Improvements with PHP 8 Attr...

07 Dec 2025

Sylius V2 - Symfony Workf...

Sylius V2 - Symfony Workflow Alternative...

06 Dec 2025

Sylius V2 - Symfony 7 Com...

Sylius V2 - Symfony 7 Compatibility

05 Dec 2025

Tags

Meetup Agile API Artificial Intelligence Best Practices Code Quality Documentation E-commerce Ecosystem GDPR Git Performance Plugin Security Sylius Sylius V2 SyliusCon Symfony Testing Tools UX Web Development

Newsletter

Filters & Search

Latest articles

Sylius V2 - Payment Simpl...

Sylius V2 - Payment Simplification and "...

25 Dec 2025

Sylius V2 - New Bootstrap...

Sylius V2 - New Bootstrap-based Admin UI...

18 Dec 2025

Sylius V2 - Template Cust...

Sylius V2 - Template Customization with ...

11 Dec 2025

Sylius V2 - Improvements ...

Sylius V2 - Improvements with PHP 8 Attr...

07 Dec 2025

Sylius V2 - Symfony Workf...

Sylius V2 - Symfony Workflow Alternative...

06 Dec 2025

Sylius V2 - Symfony 7 Com...

Sylius V2 - Symfony 7 Compatibility

05 Dec 2025

Tags

Meetup Agile API Artificial Intelligence Best Practices Code Quality Documentation E-commerce Ecosystem GDPR Git Performance Plugin Security Sylius Sylius V2 SyliusCon Symfony Testing Tools UX Web Development

Newsletter

SF Sabrine F. Portfolio

Lead Developer, Sylius expert and certified Agile Scrum Developer. Specialized in designing robust e-commerce architectures, I share my technical monitoring and feedback here, primarily focused on the Sylius and Symfony ecosystem.

Useful links

  • Home
  • Portfolio
  • Blog
  • About
  • Contact
  • Sitemap

Areas of expertise

  • #Sylius E-commerce
  • #Agility & SCRUM
  • #Software Architecture

Contact

contact@sabrineferchichi.fr

© 2026 Sabrine F. — All rights reserved

Designed with by Sabrine F.