Thanks to the new capabilities of the web platform (web components, Progressive Web Apps…) and the rise of modern JS libraries (Vue, React, Angular) almost all modern Symfony applications must leverage the frontend ecosystem.
Symfony 4 embed many gems that make it easy to integrate modern JavaScript within the framework, including the first component entirely written in JS: Webpack Encore.
In Symfony 4.2, another component that is super convenient for apps containing JS code has been released: Panther, a PHP library compatible with BrowserKit, that drives real web browsers to create end-to-end (E2E) tests with ease.
During this talk, I’ll show you how to cleanly integrate modern JavaScript code with Symfony and Twig and how to test such applications using Panther.
The examples will use VueJS, because it’s probably the easiest JS framework to get started with as a PHP developer, but all the tips and tricks will be applicable with other libraries such as React or Angular.
Finally, we’ll add some real time capabilities to our app using Mercure.rocks
This is fantastic!
I’ve spent the last month or so deciding which components to use for a new project and had decided on Symfony backend API with plugins for using Schema.org etc. and Vue.jsfor the front-end PWA. Then I discovered API-Platform which puts it all together for me! And now, these slides take that even further. You’ve saved me months of work!
Quick question though – For someone with an intermediate knowledge of Symfony, would you recommend using the API-Platform full build (Docker etc.) or starting with a Symfony installation and then adding API-Platform? Or is there no difference?
Hi,
Thanks for the kind words!
Both are ok, but I would recommend to use the full “distribution”, with Docker, the Admin the SPA Generator, the cache mechanism etc… because all great features of API Platform are enable by default, and easy to use, while when using Symfony directly, you need to setup everything by yourself, and it can be tedious.
Thanks for the reply.
I’d sort of come to the same conclusion, although it means I now need to spend some time understanding docker better, since right now it’s not clear to me how for example to install Webpack Encore into this environment since it requires yarn, which doesn’t seem to be available via docker-compose, even though it’s used by the admin container.
I just need to get my head around the concept of using networked containers, which is all new to me.