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

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • Appwrite - The Open Source Firebase alternative introduces iOS support
  • Scout APM - Less time debugging, more time building
  • SonarQube - Static code analysis for 29 languages.
  • cash

    An absurdly small jQuery alternative for modern browsers. (by fabiospampinato)

    Cash's maintainer here. I don't think this is true actually.

    Zepto supports some methods that Cash doesn't, but you probably shouldn't use them to begin with, like $.ajax, $.isArray, $.fn.animate etc. In 2022 either better built-in solutions exist or better specialized tiny libraries exist.

    Everything that is supported by both Zepto and Cash should either work identically or Cash's implementation should be closer to jQuery's. Just to mention one thing in this regard you can run jQuery's test suite with Cash, and Cash's test suite with jQuery, easily [0]. I've done so and looked at every single failed test manually a few times, I doubt nearly the same level of attention went into Zepto. Just to mention one difference: Cash supports jQuery-style event namespacing, Zepto just doesn't support this.

    [0]: https://github.com/fabiospampinato/cash/blob/272132a6dc1d885...

  • femtoJS

    femtoJS - Really small JavaScript (ES6) library for DOM manipulation.

  • Appwrite

    Appwrite - The Open Source Firebase alternative introduces iOS support . Appwrite is an open source backend server that helps you build native iOS applications much faster with realtime APIs for authentication, databases, files storage, cloud functions and much more!

  • umbrella

    :umbrella: Lightweight javascript library for DOM manipulation and events (by franciscop)

    const insertAfter = (col, html) => col.forEach(el => el.insertAdjacentElement('afterend', html));

    Keep going a bit like that, until you realize you are basically reinventing jQuery. Add a couple of very nice-to-haves, like chaining (instead of nesting in these examples above) and that's exactly what Umbrella JS is, very thin methods to manipulate the DOM and handle events. In fact, compare our "addClass" implementation in this comment to [Umbrella's addClass](https://github.com/franciscop/umbrella/blob/master/src/plugi...), it's almost the same size but hundred times more flexible:

    // Add class(es) to the matched nodes

  • Alpine.js

    A rugged, minimal framework for composing JavaScript behavior in your markup.

    https://alpinejs.dev/ for me to replace jquery, it uses vue syntax and _much_ simpler to use, with a strong community.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts