Recent weeks have been very exciting for us in terms of several projects that are being built on Shopsys Framework, both by external agencies and by our colleagues in other Shopsys teams. Thanks to some of these implementations, we are receiving very valuable feedback. We would particularly like to acknowledge the efforts of all our contributors and reporters, including @henzigo, @dzarda86, @TomasVotruba, and @ondrejmirtes! Based on their feedback and contributions, we are working to improve the framework to fit the needs of our users.
Refactoring & Code Quality
Based on input from our users, we have been refactoring the problematic parts of the framework, as well as improving the code quality itself.
- We started with simplifying the pricing that was very complex originally. This feature covered various scenarios (e.g. automatic price calculation based on pricing group coefficients) and was quite cumbersome and difficult to customize or extend. By simplifying the price calculation to make it a bit clearer and to enable easier customization, we were also able to completely remove the automatic price calculation, which led to a huge reduction in the source code — we removed over 1,000 lines!
- One of the currently implemented projects contains almost 10 domains and the developers reported some problems with data fixtures (i.e. demo data). Another important refactoring involved making the fixtures work properly with multiple domains. With these new changes, you are now able to install demo data for any number of domains you need.
- It is worth mentioning that after refactoring of the order form, all the important forms in the administration are now extensible by creating a form extension only (see how to add a new field to the Product form), without the need for overwriting their twig templates.
- We also embraced new fixers to our coding standards that look after proper usage of annotations. There were many discussions on that topic and thanks to the automation, there’s no longer any conflict about whether or not to annotate a particular method.
- We believe that the high code quality makes its usage easier, therefore we wanted to be very thorough and used some of the most current tools available to achieve the highest quality possible. One such tool is PHPStan and we are proud to collaborate with its author, Ondřej Mirtes, who helped us prepare our codebase to meet more strict rules.
Documentation & Education
Besides changes in the source code itself, we are constantly extending our knowledge base. We want to provide our users with as much information as possible about Shopsys Framework concepts, along with instructions for creating their own projects based on the framework.
- There is a new awesome FAQ section in our documentation that answers questions like “How to change a domain URL?”, “Is the application HTTPS ready?”, “How do calculated attributes work?”, and many more. If you are missing an answer to your question, do not hesitate to create an issue on our Github!
- Shopsys Framework provides many handy commands that can be used during application installation, development, deployment, etc. All of them are described in the article “Console Commands for Application Management”. The article has been linked from many others documentation pages to make it easier; this way you don’t need to implement all the processes by yourself.
- As you probably already know, from your project point of view, the administration part of Shopsys Framework is located in the vendor folder (we call this is a “glassbox” part of the framework). Therefore you can not modify the sources directly, otherwise, you would lose the advantage of upgradability. There are already some cookbooks for extending the PHP glassbox parts. In the recent release, we have added a new cookbook “Modifying a Template in Administration” with step by step instructions for how to change something in the administration page.
- In addition to writing documentation, we are organizing online workshops where we are teaching participants the basic concepts of programming on Shopsys Framework by implementing a simple modification — assigning related products to an article. You can take a look at the recording on YouTube and try it yourself!
Installation Improvements
During the last few weeks, we have simplified the installation process using a few tweaks to make the life of developers a little bit easier.
- There is no need for setting Github token during the installation anymore thanks to the composer improvements we did a few weeks ago.
- Also, you now don’t have to worry about accidentally setting a production environment during your development installation as this has been automated based on the way you install composer dependencies.
- In addition, we have created a new Symfony command “shopsys:environment:change” so now you can change the environment much more comfortably.
- Ultimately, you do not have to configure your domains during installation anymore as this step has been automated as well.
Final Thoughts
This article covers the recent two releases, beta3 and beta4, which were released within two days. After releasing beta3, our installation started to fail on account of a lack of memory available for composer. We figured out that by releasing the new tag, all our repositories have grown a little bit (and probably some of the external packages have grown as well). Therefore, composer suddenly needed more memory than the default value.
Thanks to our release process we discovered this problem right after the release, and then we came up with a fixup solution immediately and released beta4 on the very next day. We also informed our users on Slack so they are aware of the problem since all the previous versions of Shopsys Framework were affected by this issue. Moreover, we even improved our release process by adding an automated test of the release candidate installation to prevent such problems in the future.
Čtěte také