antonmedv / monkberry

Monkberry is a JavaScript library for building web user interfaces
https://monkberry.js.org
MIT License
1.49k stars 78 forks source link

Comparisons to other libraries #18

Open gr0uch opened 8 years ago

gr0uch commented 8 years ago

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

antonmedv commented 8 years ago

Monkberry is more like React or Angular.

antonmedv commented 8 years ago

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 commented 8 years ago

Size matter to:

$ jsize htmlbars
htmlbars     41.84 kB (gzip)
gr0uch commented 8 years ago

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

uhjish commented 7 years ago

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?

leeoniya commented 7 years ago

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.

uhjish commented 7 years ago

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.

antonmedv commented 7 years ago

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

leeoniya commented 7 years ago

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

uhjish commented 7 years ago

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

antonmedv commented 7 years ago

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

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