monkberry icon indicating copy to clipboard operation
monkberry copied to clipboard

Comparisons to other libraries

Open gr0uch opened this issue 9 years ago • 11 comments

I'm curious to hear how this is different from other libraries, such as HTMLBars.

gr0uch avatar Jul 10 '16 12:07 gr0uch

Monkberry is more like React or Angular.

antonmedv avatar Jul 10 '16 16:07 antonmedv

Another big difference is what Monkberry does not use eval or analog new Function to create template.

From HTMLBars source:

export function template(templateSpec) {
  return new Function("return " + templateSpec)();
}

antonmedv avatar Jul 10 '16 17:07 antonmedv

Size matter to:

$ jsize htmlbars
htmlbars     41.84 kB (gzip)

antonmedv avatar Jul 10 '16 17:07 antonmedv

Hmm, I'm not sure if that is the case, the runtime is quite small.

Also, the compiled template looks to implement a similar concept to what monkberry does, build dom code from a template string, especially the build function: https://github.com/emberjs/ember.js/issues/10454

gr0uch avatar Jul 13 '16 08:07 gr0uch

On the same note, how does this compare to sveltejs? Both seem to compile templates down into optimized vanillaJS and html... Is the compiled code generated by monkberry stand-alone or does it require a runtime?

uhjish avatar Jan 08 '17 22:01 uhjish

from http://monkberry.js.org/docs/installation it does require a runtime. but the runtime is 1.25k min/gz, so pretty much negligible. the size of the compiled code would be a much better comparison though.

leeoniya avatar Jan 08 '17 22:01 leeoniya

makes sense, and the --as-module compile leads me to believe that it can build self-contained ES6 modules, which could again be composed into optimized apps with a bit of tree-shaking ala rollup or webpack2... neat.

uhjish avatar Jan 09 '17 07:01 uhjish

@uhjish sveltejs is pretty awesome, but monkberry was first 😃

antonmedv avatar Jan 09 '17 08:01 antonmedv

and sveltejs got to these first:

https://github.com/monkberry/monkberry/issues/35 each-else: https://github.com/sveltejs/svelte/pull/122 https://github.com/monkberry/monkberry/issues/37 keyed updates: https://github.com/sveltejs/svelte/pull/209 https://github.com/monkberry/monkberry/issues/2 SSR: https://github.com/sveltejs/svelte/issues/196

...maybe others

at the end of the day what matters is what a lib offers today, not who was first to an MVP [1]. for what it's worth, i consider sveltejs to also be an mvp due to how many use cases seem to require some form of "well yeah" work-arounds :P

[1] https://en.wikipedia.org/wiki/Minimum_viable_product

leeoniya avatar Jan 09 '17 09:01 leeoniya

@elfet Imitation is the sincerest form of flattery; forking is a close second ;-).

uhjish avatar Jan 09 '17 10:01 uhjish

@leeoniya svelte is awesome and have much more "media" power, better marketing. :)

I have plans to add keyed updates in future, btw.

antonmedv avatar Jan 09 '17 13:01 antonmedv