
Rax –  A universal React-compatible render engine - zthomas
https://github.com/alibaba/rax
======
baybal2
Funny story behind the line of Chinese React clones: the original goal of
development was to make react work with ie6-9 (pirated winxp still is the
"Default OS" here), but it came out that most of Chinese React forks are even
less ie friendly than the original.

------
swrobel
Interesting that they don't compare it to preact:
[https://github.com/developit/preact](https://github.com/developit/preact)

~~~
rtpg
reading that, it seems pretty good. Are there performance costs to its diffing
against the "real" DOM?

3kb for "React" is pretttttty tempting

~~~
Etheryte
Forget about file size, 40kb vs 8kb doesn't really matter in the modern era.
If anything, using an obscure library may cost you more because it's less
likely to be a CDN cache hit for the user.

~~~
simonw
Start testing on a mid range Android device on 3G and tell me you still
believe that.

On mobile it's not just the file transfer that takes time: it's the JavaScript
parsing and execution (on a single core) that hurts too. iPhones are massively
faster than Android (especially cheaper Androids) at this, so many developers
don't realize how much performance cost there is for a growing majority of
their users.

Given how many different versions there are of popular libraries I'm
personally skeptical that CDNs give you much of a chance if the asset being
preloaded from another site. I'd love to see real numbers on this though.

~~~
Kiro
I build games where the player is supposed to play for hours. Am I wrong
thinking that file size matters less for me? It adds 1% to the loading screen.

~~~
rtpg
Yeah for games it's not much of an issue.

It becomes more of an issue if you are doing a "business" app, where there's a
lot of moving between pages and a lot of eventual page refreshes.

------
greenspot
Is it faster than Inferno[1]?

[1] Inferno seems to be the fastest React drop-in replacement at 9kb size at
the moment: [http://stefankrause.net/js-frameworks-
benchmark4/webdriver-t...](http://stefankrause.net/js-frameworks-
benchmark4/webdriver-ts/table.html) \- full post to the comparison table
before:
[http://www.stefankrause.net/wp/?p=316](http://www.stefankrause.net/wp/?p=316)

~~~
leeoniya
Inferno is definitely fast, but these benchmarks are highly misleading.

We're working on improving them so they better reflect the difference in keyed
vs non-keyed implementations [1][2]. When ready, Round 5 should be a much more
realistic apples-to-apples comparison.

[1] [https://rawgit.com/krausest/js-framework-
benchmark/master/we...](https://rawgit.com/krausest/js-framework-
benchmark/master/webdriver-ts/table.html)

[2] [https://github.com/krausest/js-framework-
benchmark/issues/10...](https://github.com/krausest/js-framework-
benchmark/issues/104)

~~~
greenspot
Thanks, I was just wondering why the OP didn't compare Rax to Inferno.

~~~
leeoniya
Inferno is gonna be _really_ tough to beat, at least for non-keyed
implementations. We don't have a keyed implementation from them, so it's hard
to say exactly how they do there, but i dont doubt that it'll be at or near
the top. For now kivi is likely the fastest possible but the way you have to
write your code with kivi is rather unpleasent. However, the whole point of
kivi was to push the perf boundaries, not to be useable directly.

At the end of the day, there are numerous <= 15KB libs that come within 3%-15%
of Inferno, so the perf and size difference is really becoming secondary to
lib ergonomics and features.

If you wanna read a lot more of our convo, head over to:
[https://www.reddit.com/r/javascript/comments/5m2u0s/infernoj...](https://www.reddit.com/r/javascript/comments/5m2u0s/infernojs_10_release/)

------
janvidar
Am I the only one finding it weird that they call it a render engine?

~~~
kowdermeister
No, and it's really confusing what it really does. The one example is a hello
world text. I didn't bother downloading the rest.

------
jiyinyiyong
Well, I see it only a smaller project created by people in the Weex community
who prefer React syntax. They did not even talk much about it on Weex Conf.
[https://atf.alibaba.com/weex](https://atf.alibaba.com/weex)

------
wmertens
their repo is full of slightly adapted other packages. If they are 100% React
compat, why would they need rax-redux? :-S

~~~
secoif
On the surface, the rax-redux implementation appears to be a lot simpler. For
example, react-redux's connect spans all these files
[https://github.com/reactjs/react-
redux/tree/75658dab18f7fe3e...](https://github.com/reactjs/react-
redux/tree/75658dab18f7fe3e62ea0c3d97fcf513bf176e10/src/connect) and includes
"connectAdvanced": [https://github.com/reactjs/react-
redux/blob/75658dab18f7fe3e...](https://github.com/reactjs/react-
redux/blob/75658dab18f7fe3e62ea0c3d97fcf513bf176e10/src/components/connectAdvanced.js)

While the rax-redux equivalent seems to be contained in a single file:

[https://github.com/alibaba/rax/blob/07e20908e4e17b182873db09...](https://github.com/alibaba/rax/blob/07e20908e4e17b182873db0997729cb6c03ab690/packages/rax-
redux/src/components/connect.js)

The simpler implementation might indicate that the rax developers are trimming
overcomplicated bloat, or culling features that don't align with specific
needs of Alibaba. Or maybe they're just removing code they don't yet
understand the necessity for. It's not immediately clear what tradeoffs each
are making, but having rax audit what's _really_ necessary could be a good
thing for everyone.

~~~
acemarke
Looks like the Rax version is based on React-Redux 4.x, which was was
primarily a single file and kept most of the logic in a React component.
React-Redux v5 is a complete internal rewrite that pushes the logic out into
memoized selector functions.

In fact, it appears to be 98%-ish the same as React-Redux v4.4.6. They've
added semicolons, swapped out the React imports for Rax imports, and shuffled
the order of some of the methods, but the code is effectively identical.

------
kozak
Good to see compatible implementations. Over time, we'll have something React-
like as part of the web standards.

~~~
sapeien
>something React-like as part of the web standards.

Hell no. High-level APIs should remain in user space, they are too often
optimized for short term thinking, prone to breakage, and inefficient.

Most of the current DOM specification has been around since 1998-2000, and the
spec hasn't made a single breaking change. Standards committees have an
obligation to not break the foundations of the web, framework authors can do
whatever.

~~~
place1
Fair enough and very true! I suppose web-components are 'react like' in a way
though so maybe it's already happening.

------
andrewvijay
Looks okay but what does it offer more than other react clones

------
xuan
Does it support stateless function component?

------
ceejay
Noticed they added Facebook to the LICENSE. Facebook was notorious at one
point for some unpopular language in their open source licenses. Does their
inclusion in the LICENSE file mean a developer needs to be aware of how
Facebook is currently (or in future) licensing React, as well as how Rax is
licensed?

