Lib Like JQuery Which Can Co-Mingle Vanilla Javascript?

The article “You Might Not Need jQuery” complains that jquery is an all-or-nothing tool.
“jQuery seeks to replace them all wholesale. By returning a jQuery object rather than a NodeList, built-in browser methods are essentially off limits, meaning you’re locked into the jQuery way of doing everything. it means there are two duplicate ways of doing everything. There are, however, libraries that have adopted an API that will be reassuringly familiar to jQuery addicts, but that return a NodeList rather than an object”

The article mentions some libs which don’t have that drawback:
Bliss.js
Bling.js
min.js

What other jquery-like libs can be co-mingled with vanilla javascript code?
Which are the best in 2020?

Thx!

There’s nothing wrong with just using vanilla javascript these days.

However, micro.js catalogs tons of small libraries that can be worth considering.

Can you say a bit more what you mean by “nothing wrong”?

Does vanilla js now offer all the advantages that previously could only be had with jquery?

shorthand codes like jquery? https://api.jquery.com/category/ajax/shorthand-methods/
How about the ‘each’ structure?
$.get ?
Cross-browser methods?
etc

thx

Yes.

Yes, you can use fetch to get things from a server now.

Sure, take forEach, or find, or filter, or map, or reduce

Use fetch.

The CanIUse website lets you find out if your technique will have any problems with older browsers you care about, and many of those MDN pages have polyfills at the end to provide support to older web browsers.

Sounds like jq may have some cross-browser advantages?
(note, i don’t care about any IE except the latest, if that.)
What’s an MDN page?

Then don’t bother with cross-browser stuff. That’s not likely to be a problem now.

MDN is the Mozilla Developer Network. They’ve created some very useful JavaScript language documentation, which supplies information that works with a wide range of different web browsers.

Unclear. Some people are still using older browsers out there.
(forced upgrades should be a thing by all browser companies)

That’s why you can use CanIUse to help you figure out how old the browsers are that have trouble. If you care about those browers then use a polyfill. If you don’t, then don’t.

I’ve read polyfills have drawbacks. Some devs steer clear of them. Dependency on user-agent, unstable/bugs, reliance on 3rd party server…

Then you are fully okay to stay with jQuery.

Thx, as mentioned, i’m seeking alternative to jquery, which offer it’s advantages without the drawbacks. If you care to suggest some specific tools that you have used, great!

There are no libraries similar to jquery that have its advantages without drawbacks.

Ouch. Ok.
Umbrella says: “It is strongly influenced by jQuery with many similar methods.However there are some extra features like .handle() and some methods like .append() are more flexible.”
If offers each and cross-browser stuff. I don’t know whether it returns a nodelist. I assume there are other limitations compared to jq.

So, you don’t think umbrella may fulfill my request?
thx

You’ll find that it’s fallback is that it’s missing several features that are in jQuery.
But give it a go - you might not need, or even care about the differences.

Can you mention the glaring ones that you see?
thx

Sure - selectors.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.