Angular 2 Universal in Twig

Angular 2 is a complete overhaul of the popular front end framework. Under the hood there are major upgrades in terms of performance as well as a more simple and elegant application structure in general. Based on Web Components, Angular 2 looks to be gaining momentum and it looks like the risks of a complete rewrite have paid off for the team.

Universal or Isomorphic JavaScript are also terms that have been hot in the last few years. They both mean the same thing - which is executing the exact same code on the server and the browser. The target is to provide the first page load to the user already rendered. This is intended to remove the flicker Angular 1.x applications when your front end application is bootstrapping.

Angular Universal is their own flavour of server side rendering of Angular applications. Angular has support for Node.js, but are also coming up with solutions for .NET, Java and PHP. The PHP flavour is being built together with the Drupal 8 development team using Twig.

Being able to render Angular 2 Universal components in Symfony means that it will be relatively easy to start using Angular Universal with Symfony CMSes in the future.