The NX framework

Overview

Features

Image
Image
Image
Image
Image
Image

Comparison

NX provides access to the DOM and encourages you to directly modify it, if necessary. This is in contrast with the virtual DOM approach of React.

A virtual DOM abstracts away a lot of native features and introduces some new syntax. While it is possible to access real DOM elements in React, it is a lot clumsier than the direct access NX provides.

Mixing HTML and JS is also something NX avoids. It follows the old school logic/view separation approach. If you enjoy hacking around in native HTML and JavaScript, NX should feel natural to you.

Angular piled a lot unnecassary features while paving the way for the younger frameworks. NX is a fresh start, that includes only the required features and nothing else.

Angular forces a complex dependency injection system on you, while NX leaves this task to modern alternatives like Webpack. Instead of having controllers, factories, providers and services, NX simply uses middlewares for everything.

The NX state object is very similar to an Angular scope, but it provides fast, transparent data binding instead of dirty checking.

NX has many similarities with Vue, but it uses the next generation of APIs. This means less supported browsers, but less extra syntax and frustration too.

NX works with native Web Components, while Vue requires CSS selectors to bind the code and the view together.

The Vue data binding system is based on accessors, which means that expando properties, getters/setters and arrays require special treatment to work. In NX you can add properties dynamically or use native getters/setter instead of computed properties. Everything is bound correctly thanks to the ES6 Proxy based data binding engine.

While internally NX and and Polymer both use Web Components, they are very different on the surface.

Similiarly to Vue, Polymer uses a declarative syntax for component definition. Properties and methods have to be defined on a config object, that is passed to the Polymer() function. In contrast to this, NX has a very light config object and encourages you to augment your components dynamically inside the middleware functions.

Polymer has a large library of ready-made components, that NX is lacking for now. However NX comes with more functionalities in the form of core middlewares.

Performance

The Benchmark

You can see the execution time in milliseconds for each framework on the chart. Lower execution times are better. If you would like to run the benchmark locally, press the button in the top-right corner of the chart.

Image

Conclusion