Shopware 6 and the plugin migration

I am near the end of converting my Shopware 5 plugins to the new version 6 codebase and after digging through the new systems, now seems like a good time to reflect on the transition.

In Shopware 5 the move to Symfony got more apparent with every update and in version 6 it really is the underlying framework. The basic plugin requirements, such as the folder structure and the configuration files, are close to what it was in version 5. But  these can be extended easily thanks to Symfony, whereas architectural topics, for example dependency injection, did not change at all.

Shopware as a whole is now split into mostly decoupled units: the core for business logic, the administration as an interface for store owners and the storefront for the shop’s, well, storefront. These are bundled together to form the ‘Shopware platform’. This separation did not really impact my plugins, but of course, when your plugin affects the administration, it has to be used in a project.

Twig is now used as the main template engine, Sass as the CSS preprocessor and Bootstrap as the framework. JQuery is also provided, I guess old habits die hard. Modifying Shopware 5 plugins for this stack was rather straightforward. Having strong frameworks to work with made the process really smooth, but for my taste, the standard theme for Shopware 6 is a bit bleak.

Much more work had to be done in the administration. Shopware now uses Vue.js, which is neat, and thanks to the new DAL system the communication with the core is easy. But ExtJs and Vue modules, like the admin area as a whole, are not similar at all. Copy pasting code from a version 5 plugin for example was not possible, but ExtJs modules were always a bit unwieldy, so change is welcome.

The core also received an extensive overhaul. The biggest changes concerning my own plugins were made within the database layer. Doctrine as the main tool for database access is replaced by Shopwares own database abstraction layer system, called DAL. At first, it was quite laborious to create tables, since each has a definition, an entity, an entityCollection and a migration to create the actual table. But I soon discovered that this standardization is actually pretty useful. I can easily extend other entities, events are more predictable and the interaction with the data and the associations is unified. 

Overall, nearly every part of the system changed to some degree and with this all my plugins needed adjustment. But since Symfony is still the overarching framework and the move to industry standard techs made the changes feel sensible, wrapping one’s head around new topics, like Vue, is more rewarding then some arcane framework or custom solutions.