User account menu

Main navigation

Breadcrumb

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

Submitted by dryer
on Tue, 03/29/2016 - 17:36

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.

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.