TYPO3 Rector on the Move

Categories: Development, Community
Six people standing in front of a whiteboard with a window to their right.
In the early days of March 2024, six dedicated developers met in Mainz, Germany, for three days of diligent work. Photo: Anja Leichsenring
TYPO3 Rector has become an indispensable tool when upgrading TYPO3 instances from one major version to another. My colleagues and I joined the TYPO3 Rector team for a code sprint that resulted in improvements to make your next TYPO3 upgrade easier than ever. And stay tuned for an exciting new solution called Fractor, coming soon.

New to TYPO3 Rector?

Haven’t tried TYPO3 Rector yet? When you have at least one TYPO3 instance with at least one custom extension to upgrade, you really should give it a spin. Using static code analysis, the tool rewrites code fragments that are known to be deprecated or removed with the valid replacement. Find out more information on the TYPO3 Rector website.

A Series of Challenges

Over time, due to the small team of maintainers, the project suffered from decreased motivation. New rules take time to write and get integrated, and the slow pay-off can be disheartening.

In addition, Rector, the base project for TYPO3 Rector, dropped support for any file types except PHP. This news came as a blow to the TYPO3 ecosystem. Up until that point, we were able to rewrite rules for Fluid files, yaml configurations and especially TypoScript. The ability to do that vanished with the latest development from Rector when they decided to refocus solely on PHP

That is sometimes the risk you take when you create a package that relies on another package. Sebastian Schreiber, the dedicated author and maintainer of TYPO3 Rector, decided to go with the flow and support PHP-only files in version 2 of his creation.

Community Coming Together

UDG are big users of TYPO3 Rector, so they were keen to see these challenges addressed. They decided to support the team and give the project a push by hosting a small code sprint in their office in Mainz.

The main aim of the sprint was to brainstorm solutions for the loss of support to non-PHP files and how to make up for it. Spoiler: We achieved something better.

So it happened that in the early days of March 2024, six dedicated developers met in Mainz, Germany, in the refurbished office of PIA | UDG for three days of diligent work. UDG not only provided the workspace and the refreshments, they also provided three of their developers. 

Joining the sprint from UDG were Aleksandra Fey, Reiner Kempkes and Anja (that’s me) — we hadn’t written any Rector rules before, but were familiar with the tool from our daily work. Sebastian Schreiber and Simon Schaufelberger, who are both active in maintaining the tool, guided us newbies and brought in the new code. And last but not least, Andreas Wolf joined us to ponder over that lost TypoScript rewrite problem. Not to forget, we had Lina Wolf joining remotely, who did her best to integrate her knowledge via screen share.

Collaborative Problem-Solving

Aleks, Lina, and Reiner (supported by Simon) took on the challenge of writing the remaining TCA rules, until there were no more to be found. Anja and Sebastian set out to tackle some of the more unusual rules—which also got merged but we didn’t manage to get through all the open issues. In total, 15 rules were added to TYPO3 Rector, which is quite an impressive number! There is lot’s of work still to do, and the TYPO3 Core team makes sure we never run out of it.

Thanks to the dedicated focus of the code sprint, six people in three days managed to write 15 new rules between them, which were immediately released as TYPO3 Rector version 2.1.0.

And Andreas? I said we wanted to brainstorm how to replace the missing file handler. At the end of the code sprint, Andreas unveiled a working prototype for a tool that blew our minds.

Meet Fractor

Fractor is a standalone tool that is not based on php-rector. It can handle whatever files you might need. The proof-of-concept can already handle FlexForm, TypoScript, and composer.json files. The tool is extensible, each of those file types is handled by its own package. The possibilities of this plugin approach are endless, and TYPO3 itself is the best example for it. In my humble opinion, Andreas has outdone himself. While no release date has been set, I hope we can expect a release rather soon.

If you are curious to see what it looks like, check out the Fractor code repository. It is too early yet to invite contributions but stay tuned.

Show Your Support

After the sprint, we look at TYPO3 Rector differently now that we have gained new insight into its inner workings. Much more than search-and-replace, TYPO3 Rector is a sophisticated upgrade tool. We hope that all TYPO3 Rector users out there benefit from the work we put into the release.

You can show your support by:

  • Using the tool and giving us feedback in the #ext-typo3-rector Slack channel.
  • Making a one-off donation or becoming an ongoing sponsor.  
  • Providing your own custom rules to the project on GitHub.

All kinds of contributions help, and your support is greatly appreciated.

Stay happy and healthy!