by brylie · 7y ago · 0 comments
I like that Vue can be "dropped in" to any HTML page, like jQuery, without completely taking over the frontend development process, but it still weighs in at 30k. Also, the Vue docs are primarily oriented towards a pre-processing SPA workflow.
Are there any light-weight libraries like Vue, around 2k-5k, that enhance static HTML with declarative DOM manipulation reactive data binding?
Is there a "plain JS" approach to declarative DOM manipulation?
Think of a "modern best-practices" site that uses a big framework and some big addons and feature libraries, and ends up with like 500 KiB of JS. Some end up with megabytes! That's crazy. I think these developers don't have a sense of scale. They probably think I promote premature-optimization, that they're good engineers who follow best practices and use best-in-class tools and techniques ... but they don't have a sense of scale to see how the results are not reasonable.
30 KiB is small. 100 KiB total is probably quite OK. 500 KiB is very fat. 2 MiB is crazy town. Sense of scale :)
I can probably stick with the 20KiB Vue dependency, particularly when it doesn't require any build system or other dependencies.
I'll read more about lit-element. Thanks :-)
Why?
This function looks perfectly 100% normal to me, but that's probably I spent a whole workweek once almost entirely in ObservableHQ documents, where you'd use md`...`, html`...`, etc. all the time.
let f = (a, b) => a + b
can be considered prettier (or clearer) than let f = function (a, b) { return a + b }
or (given the differences in runtime behavior) function f (a, b) { return a + b }
It saves typing for trivial functions, sure, but it's yet another syntax for the same thing.and this https://youtu.be/AdNJ3fydeao
Disclaimer: I'm one of the maintainers.
Can Preact just be "dropped in" to an existing HTML template, like jQuery?
Basic MVC goes pretty far
Is there perhaps a library in the 2k-5k range, or somehow a way to use only specific parts of Vue (like a custom build)?