Hacker News new | ask | show | jobs
by methyl 3022 days ago
> With big project like Vue.js and React, it’s almost becoming a pleasure to design your interface using Javascript. (...)

> DisplayJS (...) is lightweight (100kb for the entire library)

React + React DOM is around 100kB, Vue is 86kB.

4 comments

"If you were disappointed with Vue.js, React, etc... If you want something super simple to build UI, just try DisplayJS! We hope you'll choose DisplayJS next time you do something great!"

I think it's really hard to be disappointed with Vue.js. Or will hardly find anyone that is.

(That's from DisplayJS' homepage at https://display.js.org/)

Coming from an angular world I went full spartan and just used jQuery (I tried to go native but the DOM interface is rather long winded) - it felt so good, suddenly you realise that for most things model view control is pretty simple to do with a few lines of code and you have the advantage of being able to see exactly what is happening.
jQuery's bread and butter is DOM manipulation. However, for even moderately small use cases (even an interactive form) it is useful to use React, Angular, or some data binding framework, as state changes in jQuery quickly become unmaintainable.
It _can_ become unmaintainable but it entirely depends on how you define your view state, you can still create large applications with jquery if you refrain from creating overly complex state UI (speaking from experience). One thing I find overly shunned in favour of heavy MVC is CSS, CSS is a bloody state machine, it's perfect to manage your UI, you need one DOM call to update one piece of state... define the reset in CSS and your MVC UI component suddenly seem over engineered.
There's something really upsetting to me about how DisplayJS works - coupling variable names to HTML seems like a good idea for a lot of common use cases at first, but the library's API method calls, DisplayJS.var() and .target(), have no semantic meaning to me. It seems overly simplistic. And if I have to manually call .var() in my target callback, I'm missing much of the benefits of reactivity in Vue / React.
100kb is light weight? That’s a typo, the website says 12kb min/gzipped which is still kind of large uncompressed.