Author Topic: You might not need JQuery  (Read 6279 times)

ergophobe

  • Inner Core
  • Hero Member
  • *
  • Posts: 9293
    • View Profile
You might not need JQuery
« on: November 06, 2019, 06:30:25 PM »
Library of plain vanilla recipes for things like dropdowns and lightboxes that function without external libraries

http://youmightnotneedjqueryplugins.com/

Mostly linking out to other resources, but a nice place to find what you need

littleman

  • Administrator
  • Hero Member
  • *****
  • Posts: 6552
    • View Profile
Re: You might not need JQuery
« Reply #1 on: November 06, 2019, 06:36:52 PM »
Nice find!  Lighter is usually better.

BoL

  • Inner Core
  • Hero Member
  • *
  • Posts: 1209
    • View Profile
Re: You might not need JQuery
« Reply #2 on: November 06, 2019, 06:44:41 PM »
Isn't jquery pretty old school nowadays, given vue, react and angular

Sounds like it from some angles. Had a little go of vue, the benefit I've saw is being able to supply one set of data and base all your logic from that, including reactively updating the dom based on the input data.

Not exactly a client side dev so it's hard to say.

Fair enough though, in a lot of cases you just need a couple of functions and the rest of the lib could be discarded. 'Maybe an app for that'.
« Last Edit: November 06, 2019, 07:18:49 PM by BoL »

ergophobe

  • Inner Core
  • Hero Member
  • *
  • Posts: 9293
    • View Profile
Re: You might not need JQuery
« Reply #3 on: November 06, 2019, 08:02:12 PM »
>> in a lot of cases you just need a couple of functions and the rest of the lib could be discarded

That's where I think JQuery gets used a lot now. People need one little thing, like an accordion, but all they find are plugins for JQuery, so instead of 10 lines of JS, they have 84 KB of JQuery and seven lines of Javascript.

BoL

  • Inner Core
  • Hero Member
  • *
  • Posts: 1209
    • View Profile
Re: You might not need JQuery
« Reply #4 on: November 06, 2019, 08:48:39 PM »
For sure, the art of bare minimum gets lost with a simple include. If caching on the web scale was efficient enough, less of an issue but apparently CDNs don't do a great job of resupplying these libs.

Torben

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 305
    • View Profile
Re: You might not need JQuery
« Reply #5 on: November 07, 2019, 08:53:05 AM »
>>People need one little thing, like an accordion, but all they find are plugins for JQuery, so instead of 10 lines of JS, they have 84 KB of JQuery and seven lines of Javascript.
Couldn't have said it better.

JQuery has been the golden standard for more than 10 years and even though there are still valid use cases it is mostly used by lazy developers.

The problem is that 99% of all javascript related Google queries will give you a SERP full of JQuery solutions so it's really hard to move on.

Google PageSpeed Insights might be the needed accelerator to speed up the transition to Vanilla JS because downloading and parsing a big library like JQuery will screw up your PageSpeed score.


ergophobe

  • Inner Core
  • Hero Member
  • *
  • Posts: 9293
    • View Profile
Re: You might not need JQuery
« Reply #6 on: November 07, 2019, 05:43:27 PM »
99% of all javascript related Google queries will give you a SERP full of JQuery solutions

Yes. That's why I posted that. I find that if you need a wintlodun (made up word)
"wintlodun without JQuery" -  yields nothing useful
wintlodun without JQuery - Google says "Ah, he wants pages related to wintloduns and JQuery and you get a zillion JQuery plugins
wintlodun - well that just gives you the same set of results as above
wintlodun with plan javascript - sometimes works, but often gets you pages that say things like "With a little plain Javascript, you can leverage JQuery to build wintloduns fast and easy."


Then there's the basic problem that Wordpress and Drupal both ship with JQuery, so that right there means 30% of the websites on the web are loading it by default.

This is actually different on Drupal 8 - if you want to use JQuery with your theme or plugin, you have to specifically enable it and can choose the circumstances in which it is enabled - so it is available, but not loaded, by default. If Wordpress tried to take a similar action, though, the universe would fall apart and Matt Mullenweg would be targeted for assassination by the CIA.

ergophobe

  • Inner Core
  • Hero Member
  • *
  • Posts: 9293
    • View Profile
Re: You might not need JQuery
« Reply #7 on: November 13, 2019, 01:25:23 AM »
Working on something else, I found the parent site
http://youmightnotneedjquery.com/

So the first one is for plugins - accordions, overlays, dropdowns

This one is for basic code - simple DOM manipulation, basic AJAX, show/hide elements, etc.