Perfecto: Test Automation Across Web and Mobile



Dynamic view assemblies in Angular applications using Isomorphic Viewengine


iv is a completely new architecture to support dynamic view construction by Angular. For a certain period of time I was able to read the source code under development which was published as Mr. mhevery’s personal repository, but now it is being kept private. Actually I was enveloped in a mystery but I sneakily asked Rob Wormald about meeting iv when I came to Chrome Dev Summit the other day.

Rob says iv is Angular’s new view construction system. To build a view with the current Angular, you have to create a component and use the template of the component, but iv breaks down that wall. As an image, it exists as an intermediate layer of the instructional assembly process of DOM like current NgFactory, handwritten with human-readable and writable API, lower layer than component, higher layer than NgFactory . iv has three objectives.

  1. To be a faster and lighter view engine
  2. Be able to handwritten building of AoT compiled view and dynamic view coexisting with public & stable API
  3. Be flexible and portable API

In contrast to Angular Elements, iv is a mechanism for capturing dynamic view assemblies in Angular applications. According to Rob, that thought was close to Glimmer at Ember . A new concept that is neither a component nor a directive, iv is aimed at releasing in v6, which is the topic that I will pay attention to in 2018.

By the way, the name iv is “Isomorphic Viewengine”? When asked to Rob, it was a feeling like “maybe (lol)”. Since it is a tentative name, it will be a different name when it appears again in the table.

Angular Libraries

With Angular 4 the team has released Angular Package Format specification. It is well documented and always up to date, you can check it here.
Be aware — it is pretty detailed. Don’t drawn in information flood.

Few worth to give-a-try solutions or generators:

For the record: also worth-to-check solutions:

Of course working on project combined from yours published on npm or local repo, or only repository-internal packages comes with few problems. For example debugging or modifying multiple depends packages at once with easy sync in our project.

Of course npm link is for the rescue, but there are few hints for you:

If you want to setup private npm repository

Last topic covered during this speech — if you write a lot of repeatable Angular code it would be nice to have a generator for that.
You can write your own templates for angular/cli with schematics.
If you’re familiar with T4 templates or similar solution, you will fell like home.

Its still young project so hold your horses and your fingers crossed, little more about schematics usage you will find on angular in depth.

Link to repository.