Twig is in Core! - But there is lots to do left
TL;DR: After an extensive 5-day sprint during DrupalCon, Twig finally has landed in Drupal 8 Core and http://drupal.org/node/1987510 has been committed by the one and only alexpott in the single issues and then pushed as a whole. We still want to get lots done as part of https://drupal.org/node/1757550.
After Dries' post about "Reducing risk in the Drupal 8 release shedule." there was a concern in the Twig community how we can effectlively get the Twig initiative done. Single incremental patches were not possible anymore. So should we revert to the "Blocks" initiative approach and create one really really big mega patch that is hard to review and difficult to patch? Or working again in a sandbox, which in the past had given us too less core coverage and such led to inefficient review.
Focusing
The first thing we did was to focus again on what we need to achieve to be in core and no longer pose a release risk. While our goal is to convert every single theme_ function to a template - or if that is not possible, make it at least possible to implement a template for them (like field.html.twig or views-view-field.html.twig are working already now), it was very inefficient for getting Twig done. This would have meant getting 97 issues RTBC, verified and merged into one big patch, which was a major undertaking, we have been working on for months.
However to pass the "risk-reduction" we only would need to make sure that "every commit puts us closer to release". So we changed strategy and focused only on the tpl.php conversions as Drupal 8 cannot ship with two theme engines. After a 5-day long sprint and lots of profiling (with XHProf-Kit) we finally made it in and are secured in core.
Thank you to all the contributors that helped make this possible!
Next Steps?
We (Jenlampton, John Albin and me) also had an enthusiastic session about Twig, where we outlined some of the next steps. In the twig initiative we kinda all have our personal wishlists and we also have our big meta issue with lots of things to help with.
There is still time to code freeze date, so lets sing the twig song: "One-Seventy-Five-Seventy-Five-Five-Zero - Come review a patch, be a Drupal 8 Hero!". In this case writing patches is also appreciated.
Our wish- and worklists:
- jenlampton wants to "kill" the process layer and implement a nice and easy to understand new theme system architecture designed during DrupalCon portland.
- joelpittet works to remove the process layer by wrapping drupal_get_{css,js,html_head} as render arrays that are rendered lazily and is also hoping to
- c4rl really wants to revolutionize the Render API and a first step is to remove all theme() calls from core, but use drupal_render instead.
- thedavidmeister is almost everywhere to be found, but is also helping with Render API refactoring and wishing that there was a clearer distinction between #type and #theme.
- geoffreyr is working on making it easier for contrib to add Twig extensions (Symphony style service definition!) and is also giving us the very nice trans extension from Twig, but using internally t() and format_plural.
- 100s of contributors are still working to convert all theme_ functions in core to Twig.
- And I myself wish that the Twig initiative is a great success in not only adding Twig to core, but make the life of themers overall easier. In addition I work on enabling autoescacpe for Drupal Core.
If you want to have a great theme system, join us now in our efforts to make the theme system of Drupal 8 consistent, easy to use and flexible!
You can join us in IRC on FreeNode in #drupal-twig channel or jump right into the issue queue!
Thanks a lot!
Tags: twigdrupal planetdrupal