Solving the modern applications dilemma with Symfony UX

It's been almost two years since Fabien and I annouced how Symfony is bridging communities together through initiatives like Symfony UX.

Since then, the work has never stopped, from unparalleled interactivity with real-time Twig updates to plug-and-play autocomplete and native browser notifications.

Ryan Weaver even created ux.symfony.com to showcase how these components can be used and what they do.

Symfony UX is steadily becoming an important part of how we can build modern applications with Symfony. I'm happy about how the community contributed to make it even better than I anticipated.

This trend is amazing. In this blog post, I would like to talk about the next steps of Symfony UX: UX React and UX Vue.

The "SPA or traditional" dilemma

Nowadays, everyone starting a Symfony application faces the same dilemma: should I start my application traditionally (using Twig, HTML and forms) or should I opt for something like a Single Page Application (for example a standalone React application talking to a Symfony API).

Single Page Applications give the possibility to create highly interactive applications but introduce complexity by duplicating multiple parts of the code on frontend and backend (routing, access control, authentication, ...).

Traditional applications are extremely quick to develop but tend to lack the UX capabilities of modern applications (drag and drop, upload progress bars, custom interactive sections, ...).

This dilemma is both engaging (it's difficult to change once decided) and has big consequences in terms of maintenance, development time, difficulties to hire, ...

There must be a better way.

Developing hybrid applications with Symfony UX

When Symfony Flex was introduced in Symfony 4.0, it came from a simple idea: install only what we strictly need at first. There will be time later to add new packages when we need them.

What if we could do the same for an application User Interface? What if we could use Twig, HTML and forms at the beginning, as it's the simplest way to develop an application, and only when we actually need high interactivity we could add React or Vue?

This is what Symfony UX now achieves.

This summer, we launched two new components: UX React (#329 by @tgalopin) and UX Vue (#426 by @@t-richard @tgalopin t-richard).

Both allow you to render a JavaScript component directly from your Twig templates, easily passing data from your backend to your frontend:

div {{ react_component('PackageSearch', {
    packages: packagesData
}) }}>
    Loading... i class="fas fa-cog fa-spin fa-3x">i>
div>

Tip

Play with this example and check out the code for React or Vue

This new Symfony UX capability is crucial: instead of developing a standalone React/Vue application from scratch, you can install - with a single command - all the tools required to start your React/Vue application whenever you want: now or in the future.

This makes it easy to create interactive JavaScript components only for specific parts of your application, while continuing to rely on Twig and HTML for the rest. You can profit from the React/Vue ecosystems without adding unecessary complexity to your application.

And if you combine then with UX Turbo to handle routing and page transitions, your application's JavaScript will be reduced to the strict minimum: building a great User Experience!

What's next?

UX React and UX Vue bring new opportunities to Symfony. They allow us to connect two ecosystems together: you can now use React and Vue packages in your application in a few minutes.

This trend makes the future bright for Symfony UX. Step by step, foundations are being layed so that we can create even more impressive packages.

What's next? Fully integrated upload system? Native CDN management? React/Vue toolkit libraries integration? There are so many ideas to implement, it's exciting!

Want to contribute? Join us on Slack in the UX channel and let's grow Symfony UX together!

            <hr style="margin-bottom: 5px" />
            <div style="font-size: 90%">
                <a href="https://symfony.com/sponsor">Sponsor</a> the Symfony project.
            </div>

https://symfony.com/blog/solving-the-modern-applications-dilemma-with-symfony-ux?utm_source=Symfony%20Blog%20Feed&utm_medium=feed

Creato 2y | 8 set 2022, 16:20:14


Accedi per aggiungere un commento

Altri post in questo gruppo

Back on the inspiring SymfonyCon Vienna 2024!

We were absolutely thrilled to gather with the incredible Symfony community for the first time in Vienna, Austria, from December 5th to 6th, surrounded by the warm and festive atmosphere of the

31 gen 2025, 12:30:18 | Symfony
SymfonyLive Paris 2025 : Reveal of workshop topics!

SymfonyLive Paris 2025, conference in French language only, will take place from March 27 to 28! The schedule is currently being revealed as we go along. More details are available here.

💻

30 gen 2025, 08:50:03 | Symfony
Get Symfony news on your favorite social network

Symfony has been active on X, Mastodon, and Bluesky for some time, but until recently, not all platforms received equal attention. Since Twitter (now X) was our first social network, all blog posts we

29 gen 2025, 14:20:10 | Symfony
SymfonyLive Berlin 2025: Demystify the magic of the Container

SymfonyLive Berlin 2025, conference held in English, will take place from April 1 to 4! The schedule is being revealed gradually. More details are available here.

As we are now unveiling th

29 gen 2025, 14:20:10 | Symfony
Twig CVE-2025-24374: Missing output escaping for the null coalesce operator

Affected versions

Twig versions >=3.16.0,<3.19.0 are affected by this security issue.

The issue has been fixed in Twig 3.19.0.

Description

When using the null coalesce operator (??), output esc

29 gen 2025, 09:40:06 | Symfony
Symfony 6.4.18 released

Symfony 6.4.18 has just been released. Here is the list of the most important changes since 6.4.17:

bug #58889 [Serializer] Handle default context in Serializer (@Valmonzo)

bug #59631 [HttpClient

29 gen 2025, 09:40:05 | Symfony
Symfony 7.1.11 released

Symfony 7.1.11 has just been released. Here is the list of the most important changes since 7.1.10:

bug #58889 [Serializer] Handle default context in Serializer (@Valmonzo)

bug #59631 [HttpClient

29 gen 2025, 09:40:05 | Symfony