Live data from Hacker News

Show HN: CalDOM: An agnostic, reactive and minimalist JavaScript UI library

caldom.org

41–50 of 60 posts

Re: Show HN: CalDOM: An agnostic, reactive and minimalist JavaScript UI library

#41
Since I've started using Svelte (HTML-oriented, rather than JS-oriented), every other framework feels like such a mess.

I highly recommend React/Vue folks to check it out, it's literally 2x'd my productivity and completely obliterated the mental RAM i had to keep in order to "think in react"

Re: Show HN: CalDOM: An agnostic, reactive and minimalist JavaScript UI library

#43

The aesthetics of a programming language or framework are pretty important IMO, that's one of the reasons Python is my favorit language. This has a lot more punctuation, weird characters (underscore, seriously?), parenthesis and brackets than I ever willing to write or look at. In other words; it's very ugly.

I understand. Thank you for the feedback.

If you don't like the underscore, there's an official way to alias it: https://caldom.org/docs/#_cal_dom_alias

I actually forgot to mention this in the documentation, your feedback prompted me to do so.

Rest is just the nature of JavaScript my friend. I hear you on Python.

Re: Show HN: CalDOM: An agnostic, reactive and minimalist JavaScript UI library

#44

The aesthetics of a programming language or framework are pretty important IMO, that's one of the reasons Python is my favorit language. This has a lot more punctuation, weird characters (underscore, seriously?), parenthesis and brackets than I ever willing to write or look at. In other words; it's very ugly.

I also don't like underscores much, but this is JS, so shouldn't `window.identifierOfYourChoice = _` alias it without much ado?

I understand.

I picked it mainly for 3 reasons. In my opinion,

1. _ kind of hide itself & give more prominence to the rest of the code (logic) 2. If we pick a long name like CalDOM, it becomes a PITA when it repeats so many times. 3. Not to be conflicted with jQuery by using $

To avoid conflicts, CalDOM provides an official workaround to define the alias before loading: https://caldom.org/docs/#_cal_dom_alias

Re: Show HN: CalDOM: An agnostic, reactive and minimalist JavaScript UI library

#45
post #24

Introducing CalDOM, an agnostic, reactive & minimalist (3kb) JavaScript UI library with direct access to native DOM. Instead of pulling you into a library-specific magical world, CalDOM let you fully access the DOM directly while keeping the reactivity. A 2-in-1 virtual-DOM & no-virtual-DOM approach if you will. So you could take full advantage of native APIs & mix it with other libraries to gain superior performance…

I was prepared to say "meh, whatever another JS lib" but this actually looks interesting! Nice work from what I see so far.

Thank you very much!

Actually, I was very nervous about "meh, whatever another JS lib" response.

I'm relatively new to HN. This community is awesome!

Re: Show HN: CalDOM: An agnostic, reactive and minimalist JavaScript UI library

#46
post #42

What does "agnostic" really mean here? Or, how is something like React not "agnostic"?

It's 100% interoperable with Native DOM API.

Basically, CalDOM's reactivity system does not care how the Element is created as long as it's a Native DOM Element/Node.

It could be _("+div") or document.createElement("DIV") or even jQuery("")

See example: https://caldom.org/#reactive-native-node

Also, a CalDOM instance is just a wrapper around Native DOM Element(s).

_("div").elem === document.querySelectorAll("div")[0]

This interoperability allows for powerful integrations & to update the DOM directly by avoiding expensive virtual-DOM diffing.

In React's world, everything is micro-managed(there're pros & cons), accessing DOM directly can be chaotic & usually not recommended.

Re: Show HN: CalDOM: An agnostic, reactive and minimalist JavaScript UI library

#47

I honestly don’t know where this will lead. Probably all of this is just for nothing. The world has enough UI libraries already. Duh!. I decided to make my own mini jQuery years ago because I wanted a lightweight library. Also, I wanted to stay close to the native DOM API & vanilla JavaScript. Looking back, it paid really well. Then React & Vue JS happened. In my opinion, the reactive UI approach bought a huge produc…

Some good points, especially about framework abstractions sometimes turning certain otherwise trivial things into hilariously overcomplicated piles of "why". Good luck with your lib.

Thank you! :)

Re: Show HN: CalDOM: An agnostic, reactive and minimalist JavaScript UI library

#48

Earlier quoted context omitted.

You either * write stateful UIs (native, jQuery) * have a Virtual DOM (React, Vue) * use a template language that is JIT or AOT compiled (Angular, Svelte) Those are your choices.

If only there was a reactive handlebar

Ember

Re: Show HN: CalDOM: An agnostic, reactive and minimalist JavaScript UI library

#49

Earlier quoted context omitted.

Some library like this is going to blow up in popularity eventually. Virtual DOMs are often unnessary abstractions, Svelt introduces it's own whole compilation step, and libs like Vue, Ember, and Angular are just too big. There is clearly a need for a lightweight (on the order of 3kb seems good) "framework" that embraces everything the modern browser lets you do as natively as possible, basically the new jQuery, or m…

You either * write stateful UIs (native, jQuery) * have a Virtual DOM (React, Vue) * use a template language that is JIT or AOT compiled (Angular, Svelte) Those are your choices.

I swear React has rotted the brains of a generation of web developers. We've been keeping state out of the DOM with POJsOs before there even were popular frameworks.

Re: Show HN: CalDOM: An agnostic, reactive and minimalist JavaScript UI library

#50
post #28

That reminds me, few weeks ago, I read that Preact (a 3kb React alternative) could soon become faster than Vanilla JS. Source: https://twitter.com/_developit/status/1412451442946981890

Preact is awesome and the tooling around it is really refreshing. I'd choose it over react for almost all use cases.
Post reply on HN