Replacing jQuery (110kb) With UmbrellaJS (8kb)
51–55 of 55 posts
Re: Replacing jQuery (110kb) With UmbrellaJS (8kb)
#52Earlier 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.
Re: Replacing jQuery (110kb) With UmbrellaJS (8kb)
#53Earlier 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.
> How should one do the same with vanilla JS?
And you said:
> With the code here
Re: Replacing jQuery (110kb) With UmbrellaJS (8kb)
#54Earlier 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
Re: Replacing jQuery (110kb) With UmbrellaJS (8kb)
#55Earlier 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.
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.