Drupal team working on Angular 2 Universal support for Twig / PHP

Submitted by dryer on Tue, 03/29/2016 - 17:36
Angular 2 is in beta

Decoupling Drupal and working with a front end framework has been a hot topic in the Drupal Community for a while now. Dries Buytaert has discussed the prospects of different options, and has even credited the Angular 2 team for changing their licensing to be compatible with Drupal.

It looks like the relationship between Angular and Drupal is indeed warming up. In a talk on Angular 2 and the future of HTML5 apps Brad Green explains details about Angular 2 and so on. One noteworthy point is the section where they describe Angular Universal - their implementation of Isomorphic Rendering of JavaScript. It's essentially a way of rendering the first view of a front end application for immediate results.

This has been a staple in the React and Node.js world for a long time, with some ways of rendering React.js on PHP being already accessible to Drupal developers and others utilising PHP. In the talk Brad mentions that Angular Universal rendering is already working on Node and in the process of implementation for .NET, Java and...

...Twig in collaboration with the Drupal team! See snippet of video below:

This is great news as Angular 2 remains more accessible to developers than a collection of libraries. While the move to Angular 2 from Angular 1 was criticized in the past, the team seems to have made a great recovery. Angular 2 as a packaged product (a Framework) as opposed to React (a Library), which makes it much more uniform as opposed many esoteric options available for React.

The big news here is that the Angular and Drupal teams are working together to bring this to Twig and PHP - not just Drupal developers. Twig is a popular templating engine for PHP. It stems from the same people as the Symfony project is used in many different products, including the Symfony Full Stack Framework.

In the past Drupal has been criticized for being a freeloader in the PHP community as of late, but this is a great opportunity for them to create something that is usable for hundreds of thousands of non-Drupal developers. We urge the Angular and Drupal teams to work to make this a generic PHP/Twig component and not something that is tightly coupled (ha-ha) with Drupal.

All in all this is a great thing for Drupal and PHP communities!