
Show HN: Monkberry – a JavaScript library for building web user interfaces - medv
http://monkberry.js.org
======
3D4y0
OT: Can somebody please tell em, to stop the excessive use of css
animations(the moving star field background). It pegs one of my cores, and
raises my laptops temperature to the point where i can feel it. Worse still,
it really adds nothing to the ability to peruse information, if anything I
find it distracting! </rant>

~~~
lucideer
Given this is a website by someone purporting to be providing a "blazingly
fast" JS UI lib, comments on UI perf. seem pretty on-topic.

Given the general lack of info on the site about why one should choose this
library over others (beyond reiterating that it's "blazingly fast"), a
showcase of one's claims of speed should be a pretty important aspect of the
site.

This is not to criticise the library itself, but these kinds of first
impressions are significant.

------
lhorie
Damn, so much negativity. This library actually looks well designed (and I'm
saying this as a virtual dom library author)

~~~
hitr
Actually a clean library .Github has more details on why it is faster than
React >Monkberry is 10 times faster, sometimes 100 times faster. It's because
Monkberry will do only necessary dom updates, and does it in a completely
different way than React does. Monkberry compiles template to plain JavaScript
to gain an advantage by using v8 hidden classes and reduce call stack. There
is no virtual dom (in general, an react app have to keep 3 virtual doms), for
example next template will be generated to JavaScript code which will do only
necessary dom updates on state changes.

and also some benchmarks comparing against it.
[http://monkberry.js.org/benchmark/](http://monkberry.js.org/benchmark/)

I always enjoy reading why someone developed new library or tool because they
wanted to improve something about a library they were using.It may not be a
big thing but it surely gives one or two flaws about your favorite library you
are so fond of .

~~~
lhorie
I asked the author if he could put together a dbmon so we could compare apples
to apples. Unfortunately, React is not a good representative of modern virtual
dom overhead/performance. On dbmon, React is somewhere between one and two
order of magnitudes slower than many virtual dom libraries (e.g. mithril
rewrite, inferno, kivi), with render times in the 60-100ms range (vs 2-10ms
range for the other libs), and proportionally similar results in vdom
benchmark.

As far as I could see, Monkberry doesn't implement the search space reduction
algorithm that the libraries above do, and uses only mapped reordering, so I'm
curious if its compilation+mapped reordering combo can outperform search space
reduction w/ a virtual dom overhead.

Anyways, regardless of how well it does against vdom libs that do take
advantage of hidden classes etc, I really like the execution of this project.

------
supernintendo
Just some advice, that star animation slows the page to an incredibly sluggish
state (latest Chrome on late 2013 retina MacBook Pro). Removing the `stars`
and `js-stars` classes from the main div speeds the page up significantly and
conveys the "blazingly fast" point more effectively.

------
shash7
Ah so its a templating engine.

~~~
maxpert
I think it's kinda MVC not full but good for micro projects where you want a
clean code but not a bloated framework :D

------
Kred
This first thing I thought to compare this to was VueJS. It seems like the
next step up if you were to need a bit more from your framework. Or is this an
unfair comparison?

------
voiper1
I'm using riotjs ([http://www.riotjs.com](http://www.riotjs.com)) which is
closer to this than React, but it's "standard" HTML templates with controllers
_with_ the template so all relevant code is together. (When I see react's
complete divergence from HTML I get really worried...)

It's about 9kb gzipped, so it's 9x bigger, but does much more than Monkberry.

------
datashaman
This looks like it belongs on [http://microjs.com](http://microjs.com).
Instructions in the footer.

------
ruler88
what problem does this library solve that reactjs does not solve?

~~~
ch4s3
Being 1kb. Not to be pedantic, but 147kb is a lot on a crappy connection, so
if you have users in rural places with slow internet or tiny data caps, a
small library like this may be useful.

~~~
drusepth
Wouldn't you just use a CDN that your visitor's browser would pull a cached
copy from if you were worried about large assets? They're only downloaded
once*, might as well re-use the one downloaded the last time you visited a
site with React. Or do I not understand how browser caching works?

~~~
jacobr
This is nice in theory, but... A user visits site A. To get a cached version
of React the following need to be true:

1\. A user has to have visited a site, site B, with React recently. 2\. The
site with React needs to be using a publicly available CDN. 3\. Site A and
Site B must use the same CDN. 4\. The versions of React must match exactly.
There are already about a dozen alpha/patch/rc versions of the React 15.x.x
series alone.

In practice, this does not happen very often:
[https://www.stevesouders.com/blog/2013/03/18/http-archive-
jq...](https://www.stevesouders.com/blog/2013/03/18/http-archive-jquery/)

------
gldev
The site presenting it has issues but the library itself seems pretty decent.
Keep it up man.

------
atmin
I did something quite similar couple years ago [jtmpl.com].

Main difference is Monkberry uses Jinja-inspired templating language and jtmpl
uses Mustache (with slightly changed semantics, so, for example, a partial can
be dynamically requested via XHR). jtmpl is a bit bigger and provides a bit
more features.

------
gnuchu
In the example

<button type="submit">Add #{{ todos.length }}</button>

should probably be

<button type="submit">Add #{{ todos.length + 1 }}</button>

:-)

------
smegel
Those checkboxes respond with noticeable delay. I hope that is more to do with
the website than the library.

------
Rapzid
Love Phuket. This looks pretty cool too :)

------
geekodour
What it can do that VanillaJs can't?

~~~
bpicolo
Good abstractions help people build better software, faster. This is
universally true, not just in the world of JS.

