News about our FOSS projects

Published on

Oct 6, 2017

technical

This month, some of us have had full days dedicated to our FOSS projects, and more specifically to Snappy, Gaufrette, KnpPaginator and DoctrineBehaviors. So here's a follow-up about what we did during the past two weeks and what is left to do. All of the libraries cited above and their respective framework integrations are widely used and are, unfortunately, not (always) well maintained. But we aim to improve the current situation. First, by closing stale issues and PRs, and answering, tagging and merging the others. Second, by trying to envision what the future of those packages could be. Hint: we need you!

Snappy (and SnappyBundle)

https://twitter.com/KNPLabs/status/910790957871878149

So, yeah, finally we released the first stable version of Snappy. It's pretty much the same as the last "unstable" version. The only notable change is the LoggableGenerator decorator that has been deprecated since v1.5 of KnpSnappyBundle. It has been superseded by the setLogger() method introduced in both Pdf and Image generator in [v1] of Snappy.

As you might know, wkhtmltopdf (currently the only backend) is not always stable and is a real burden to configure and use. For example, you might see table content overlapping when your spans across multiple pages. You might also see fonts rendered in different ways from one OS (or distribution) to another. It's generally due to bad font kerning, and the workaround depends on the OS you're using: on Windows you shall try setting DPI to 200 at least, whereas on some Linux distros (Debian and CentOS at least) it might be due to missing package(s) and/or missing config file. Let's not even mention that most Linux distributions package wkhtmltopdf compiled without the version of Qt patched by the wkhtmltox team (for security reasons), thus you can't use useful features like headers, footers, headless mode and some more. But it's also the case with the "bleeding edge" version: you get better HTML5/CSS3/JS support at the price of the killing features.

Issues like those cited above are the ones that are reported to us most of the time. Unfortunately, we can't do much about those ones. For the others, even though some are due to system-dependent factors like locales, we lacked the reactivity to answer them timely. Sorry.

On the other hand, headless Chrome has become a thing. Firefox has headless mode too since v55/v56, and the --screenshot option is coming soon. The W3C WebDriver API is also becoming a thing. Let's face it: Firefox and Chrome have a lot less features compared to wkhtmltox, but they're also way easier to install and use.

The current API of Snappy is quite crappy: without proper separation of concerns it's hard to add new backends and test them properly. So rather than providing those new backends in the 0.x branch, we decided to release Snappy in its current state and start a partial rewrite of the library. We'll keep the same Generator interface so you shouldn't be so much impacted by this rewrite.

KnpPaginator

KnpPaginator is one of KNP's oldest FOSS projects since its first commit dates back to 2010. And given the number of users and contributors, it required some well-deserved attention. The first step was to take care of the numerous forgotten issues and PRs created over time, some dating back to 2011. We closed and/or classified more than 120 issues from both KnpLabs/knp-paginator and KnpLabs/knp-paginator-bundle repositories. Furthermore, in order to modernize the code base we prepared an upcoming new version with the following major changes:

  • Dropping support for PHP < 7.1
  • Removing the use of global variables (it required us to update all the tests so we also took this opportunity to update to PHPUnit 6.3)
  • Removing legacy Doctrine ORM Paginator (it's the only BC break, but chances are it will keep working without any modifications)

DoctrineBehaviors

https://twitter.com/KNPLabs/status/916271834429083648

DoctrineBehaviors is quite an old KNP project, since it started in 2012 and has more than 60 contributors. We decided to clean the repository up a bit by labeling every PR, and closing a lot of issues. We decided, as for all our other open-source projects, to remove the support for PHP < 7.0 and we released the version 1.5.0.

We are officially looking for maintainers - please contact us if you want to join the maintenance!

Rad Components

The support for PHP < 7.0 was dropped for all KNP Rad Components since PHP 5.6 is not officially supported anymore. A new version was released for each component.

What's next?

To conclude, we need to talk a bit about what we have decided recently about our FOSS projects. First, we nominated maintainers for every maintained repo so that each KNPeer doesn't have to check every repos.

Second, we decided to publish a follow-up article like this one on a regular basis; for now, every month. We'll also try to normalize our contributing rules across our repositories, so it will be easier for everyone to contribute.

Written by

Fabien Schurter
Fabien Schurter

Comments