Live data from Hacker News

Show HN: Umbrella JS, a 2.5kb jQuery alternative

umbrellajs.com

51–60 of 79 posts

Re: Show HN: Umbrella JS, a 2.5kb jQuery alternative

#52

I submitted this 3 years back [1] when I was starting. But now I think it's finished and well polished, so I am resubmitting it. I am happy to say that I don't normally find bugs anymore and the bug reports have slowed down while adoption has skyrocketed [2] [3] It follows loosely a subset of jQuery methods, but it adds some others where relevant for common JS patterns (.handle() == .on() + e.preventDefault()) and th…

Nice that you're using npm-stat.com for checking adoption. I should use your library on the site.

Re: Show HN: Umbrella JS, a 2.5kb jQuery alternative

#53
post #7

I don't want to be "that guy", but haven't most people moved on to something like Vue instead of manipulating the DOM directly? Every developer I've worked with learned the basics of Vue quickly (less than a day) and marveled at how great it was compared to manipulating the DOM through jQuery (or something similar like Umbrella JS). But sure, there are edge cases where jQuery and similar libs still serve a purpose.

Vue and React make sense for large SPA-style applications, but I often find myself wanting to drop a few lines of JavaScript onto a page to implement something simple without pulling in a massive framework dependency that requires a webpack compile step.

> Vue and React make sense for large SPA-style applications

Agreed, but I want to point out that modern, large SPA-style app architecture and jQuery are not necessarily mutually exclusive. jQuery might not work with React and Vue, but it can work alongside other frameworks just fine (yep, without manual DOM manipulations).

jQuery offers utility beyond ensuring your code runs the same across different browsers. For instance, I've yet to see another `replaceWith` as concise as what jQuery offers or DocumentFragment generation as expressive as this: `$("hello world foo bar");` For those two examples, the alternatives listed on http://youmightnotneedjquery.com/ are either very verbose or do not mimic the full functionality offered by jQuery.

Where I work we've built an in-house JS framework inspired by React and Vue but that "plays nicely" with our jQuery legacy codebase. The framework evens uses jQuery at it's core for UI state management and DocumentFragment generation. Re-factoring our jQuery legacy code is a breeze when compared with re-writing it to conform to React or Vue standards. We write modular and consistent components with `this.props`-style state management, one-way data binding, and zero manual DOM manipulations while still using jQuery.

TLDR: jQuery offers utility beyond manual DOM manipulations and smoothing out browser differences. When used appropriately, it still has a place in modern JS component architecture.

Re: Show HN: Umbrella JS, a 2.5kb jQuery alternative

#54
post #52

I submitted this 3 years back [1] when I was starting. But now I think it's finished and well polished, so I am resubmitting it. I am happy to say that I don't normally find bugs anymore and the bug reports have slowed down while adoption has skyrocketed [2] [3] It follows loosely a subset of jQuery methods, but it adds some others where relevant for common JS patterns (.handle() == .on() + e.preventDefault()) and th…

Nice that you're using npm-stat.com for checking adoption. I should use your library on the site.

Thank for npm-stat! I use it a lot and love it, see my other repos from my website (in my profile).

Not sure how much sense it makes for Umbrella JS though, since traditionally it'd be used under a CDN but now with webpack it's treated as another dependency. Indeed, the CDN has remain constant-ish but the npm one has grown quite a bit in the last year.

Feel free to use Umbrella JS and ask me any question!

Re: Show HN: Umbrella JS, a 2.5kb jQuery alternative

#55
post #52

Earlier quoted context omitted.

Nice that you're using npm-stat.com for checking adoption. I should use your library on the site.

Thank for npm-stat! I use it a lot and love it, see my other repos from my website (in my profile). Not sure how much sense it makes for Umbrella JS though, since traditionally it'd be used under a CDN but now with webpack it's treated as another dependency. Indeed, the CDN has remain constant-ish but the npm one has grown quite a bit in the last year. Feel free to use Umbrella JS and ask me any question!

Yeah, right. I thought I still had jQuery in there and thought about replacing it. But now as I looked at the code I realized that it's already mostly using Vanilla JS.

Re: Show HN: Umbrella JS, a 2.5kb jQuery alternative

#56
post #55

Earlier quoted context omitted.

Thank for npm-stat! I use it a lot and love it, see my other repos from my website (in my profile). Not sure how much sense it makes for Umbrella JS though, since traditionally it'd be used under a CDN but now with webpack it's treated as another dependency. Indeed, the CDN has remain constant-ish but the npm one has grown quite a bit in the last year. Feel free to use Umbrella JS and ask me any question!

Yeah, right. I thought I still had jQuery in there and thought about replacing it. But now as I looked at the code I realized that it's already mostly using Vanilla JS.

Oh really? I was surprised that there was even jQuery, and after checking it does seem there's a bit of jQuery there. "$" matches 53 times here: https://github.com/pvorb/npm-stat.com/blob/develop/src/main/...

Re: Show HN: Umbrella JS, a 2.5kb jQuery alternative

#58
post #55

Earlier quoted context omitted.

Yeah, right. I thought I still had jQuery in there and thought about replacing it. But now as I looked at the code I realized that it's already mostly using Vanilla JS.

Oh really? I was surprised that there was even jQuery, and after checking it does seem there's a bit of jQuery there. "$" matches 53 times here: https://github.com/pvorb/npm-stat.com/blob/develop/src/main/...

So I was wrong again. ;-) Just checked the package.json, but it's a static JS dependency that's not transpiled using Webpack.

Re: Show HN: Umbrella JS, a 2.5kb jQuery alternative

#59

Earlier quoted context omitted.

jQuery is a library of shortcuts. Everything you can do using jQuery you can do without jQuery, but that's like saying everything you can do in Excel you can do with just a Calculator app. Yes, it is possible, but why would you want to? When you do things like drag & drop and interactive resize you have to query DOM to get position and sizes, and perform hit detection, and you have to manipulate DOM directly. jQuery…

I know exactly what jQuery is. I’ve used it happily for years on many projects. However it is completely obsolete in 2018 for anyone that does not need to support IE8.

I may be mistaken, but sounds like you are referring to browser compatibility not being a good reason to adopt jQuery anymore.

But like the parent said above, there's more to jQuery than just getting browser compatibility - it's an abstraction for UI concepts that would require writing a ton of low level JS otherwise.

Re: Show HN: Umbrella JS, a 2.5kb jQuery alternative

#60
post #10

Earlier quoted context omitted.

Not all of them. There are still plenty of sites that aren't SPAs, especially those built with CMS' like WordPress, Drupal and Joomla (or various forums, wikis, etc). In those cases, you don't want to have to redo the whole frontend in React or Vue, you just wanta simple way to manipulate DOM elements for things like a dropdown menu or modal or what not. Something like this may work fine for that purpose. There are s…

> There are still plenty of sites that aren't SPAs, especially those built with CMS' like WordPress, Drupal and Joomla (or various forums, wikis, etc) It's as if those sites don't exist for the HN crowd, even though they make up the majority of the web.

Ironically, of course, HN itself is one of them.
Post reply on HN