Live data from Hacker News

Replacing jQuery (110kb) With UmbrellaJS (8kb)

bennadel.com

51–55 of 55 posts

Re: Replacing jQuery (110kb) With UmbrellaJS (8kb)

#52

Earlier quoted context omitted.

With the code here https://news.ycombinator.com/item?id=29979680 it would be on("click", ".button", callback). It doesn't take much to replace most uses of jQuery.

Except that's broken beyond belief. Neither event delegation nor event namespacing are implemented in that snippet.

Weird definition of broken: not having features nobody asked for.

Re: Replacing jQuery (110kb) With UmbrellaJS (8kb)

#53

Earlier quoted context omitted.

Except that's broken beyond belief. Neither event delegation nor event namespacing are implemented in that snippet.

Weird definition of broken: not having features nobody asked for.

Hello, I explicitly asked for it:

> How should one do the same with vanilla JS?

And you said:

> With the code here

Re: Replacing jQuery (110kb) With UmbrellaJS (8kb)

#54

Earlier quoted context omitted.

Weird definition of broken: not having features nobody asked for.

Hello, I explicitly asked for it: > How should one do the same with vanilla JS? And you said: > With the code here

I used jQuery back in the day and I never used namespaces, so I had no idea what ns.click meant. I don't really see why it's a desirable feature now. It just seems like a weird artifact of the fact that jQuery predates CustomEvents. I mean, I guess if there were no CustomEvents, it would be useful, but they exist now, so just use them.

Re: Replacing jQuery (110kb) With UmbrellaJS (8kb)

#55

Earlier quoted context omitted.

Hello, I explicitly asked for it: > How should one do the same with vanilla JS? And you said: > With the code here

I used jQuery back in the day and I never used namespaces, so I had no idea what ns.click meant. I don't really see why it's a desirable feature now. It just seems like a weird artifact of the fact that jQuery predates CustomEvents. I mean, I guess if there were no CustomEvents, it would be useful, but they exist now, so just use them.

For the record the code you linked to doesn't implement event delegation either, which is something pretty useful that even more modern libraries like React use under the hood.

Here's [0] an article about the usefulness of namespaces, it has use cases beyond custom events, which have been implemented a real long time ago.

[0]: https://css-tricks.com/namespaced-events-jquery/

Post reply on HN