nx-js/framework

Why another front-end framework?

hs3180 opened this issue ยท 9 comments

What's the difference between nx-framework and react/vue ?

Why not another front-end framework? Look at the code, see the difference for yourself.

Hi!

The main difference
I believe NX is different from all other mainstream frameworks today in these things:

  • It is truly next gen. It is aimed for upcoming browsers and using the latest APIs (Proxy, Web Components, History API, Weak Sets, Symbols, etc).
  • It doesn't try to reinvent the wheel (like angular dep. injection system) and it provides no groundbreaking ideas (like isomorphic apps). Instead it simply tries to use the best patterns and ideas from the past frameworks (be it server or client side).

In a nutshell it is a rewrite of the best old school things with the cutting edge technology to eliminate all the bad and frustrating parts from them.

Some concrete examples

  • You would like to play around with the DOM in React. You must know that it is virtual and you can only do certain things. In NX the DOM is there for you and there won't be unexpected errors.
  • You would like to set up some logic in Angular. You must know about the dep. injection system and how factories and the others are handled by angular. With NX all middleware functions are simply invoked on node attach, no fancy differences.
  • You would like to use data binding in Vue or with React and MobX. You must know that it doesn't work with expando props and getter/setters. In NX data binding just works, there are no edge cases and extra syntax.

If you have a solid JS and HTML knowledge, you should have very little to learn before mastering NX.

About comparisons in general
In my opinion official comparisons are unfair. I will provide tutorial codes of other frameworks written in NX as an objective alternative. You can find my NX TodoMVC PR here.

Most benchmarks are unfair too. If I must I will think about a reasonable alternative. (Just forked some todoMVC benchmarks and all I can say is every single one of them is biased and bull****).

If someone independent feels like it, I would be grateful for some comparisons and benchmarks from them.

Final note for everyone
I would love to turn this into a discussion. What are your opinion about NX and the current state of front-end frameworks in general?

You would like to use data binding in Vue or with React and MobX. You must know that it doesn't work with expando props and getter/setters.

@solkimicreb Can you explain more specific what do you mean? React uses VDOM, so it just takes values from render() method, so it doesn't meter if property is expando or getter/setter.

@smalluban

React uses one way data flow, so data binding solutions started to emerge. MobX is probably the most popular one right now. I meant that example for the React/MobX combo, not for React itself (from my experience React is best when paired with some extras, like Redux or MobX).

Hope this clarifies it.

szkrd commented

I think diversity is good, and it's good to see lightweight frameworks built from the ground up ๐Ÿ‘ . Jfyi Vue uses getters/setters and no virtual dom so far, though Vue2 supports both virtual and real - I myself miss the vdom at times, but both has good parts and bad parts too.

You never mentioned in your articles Knockout I think, which has strong ties to silverlight, but uses callbacks, which is the simplest (and most fool proof) method for data binding. Then of course there is dirty checking (A), es5 accessors (V), proxies (NX). I'm not really familiar w ember though :(

lafe commented

I also think that diversity and competition is good. However, I suspect that NX is a little too advanced right now, because it does not support Internet Explorer 11. This is a huge issue, because many companies are still on Windows 7/Windows 8 and will be for the near future and have IE11 as there default browser. So embracing NX will not work if you are a corporate developer in these companies or will be a no go outside of the company (depending on your website/app) because it blocks too many potential customers.

I have an eCommerce web app that I'd like to use NX with and I'm totally fine with losing potential customers since mobile usage is rivaling or surpassing desktop usage these days, and IE doesn't exist on mobile.

@lafe
Yes, naturally browser support is what concerns most people about NX. I did some research and I found that new indie frameworks generally need around 6-10 months to get mainstream and 1-2 years until big companies start using them. By that time IE will be pretty much obsolete I think. I plan to implement this in the future for a (limited) legacy browsers support btw.

szkrd commented

Imo NX should be a testbed for bleeding edge technologies. People can use Vue2, A2, Ember or whatnot for commercial projects - they have a huge userbase and tons of plugins. On the other hand IE 11 has terrible problems under the hood - Edge is pretty good, I must admit, but I still have to fix things here and there (compared to Chrome and Firefox). Safari has very weird problems and lagging support for the newest stuff out there.