Git Product home page Git Product logo

Comments (4)

Abbondanzo avatar Abbondanzo commented on August 20, 2024 3

The goal of replacing or removing jQuery isn't always to make your code more or less readable, it's to remove the bloat of an entire library for the sake of the one or two functions you may need. jQuery is several hundreds of kilobytes that has to ship alongside your library or application. And you can imagine that if every library author included their own version of it, you'd see the size of your consuming library or application balloon even larger.

Let's take a look at the latest version of jQuery that is posted, 3.7.0, and the examples that you have posted here.

jQuery Fade Contains Hidden/Visible Total Raw
30.88kb (min, gzip)/87462 bytes (min) 221 bytes (raw) 93 bytes (raw) 208 bytes (raw) 522 bytes

Our pure implementations for these 3 features makes up just 0.6% of the total size of jQuery. That's a massive win for reducing the size of the code we need to send over the wire.

With all of this in mind, if you find your code easier to maintain with jQuery, then you should absolutely use it! This project isn't meant to dig at the versatility of jQuery--it's extremely well designed and powers a massive amount of the Internet. It's perfectly reasonable to reach for a concise, clear code base at the expense of 10s of kilobytes unless you're trying to shave milliseconds off your load times. Should you opt to include it via CDN, chances are that a good number of your users will probably have it cached anyhow. Modern browsers provide a great number of alternatives, but not all of them are as clear and concise.

Instead, this project is meant to give you an alternative. It's important to be a good custodian to your fellow developers and to your users, to strive to provide a library that uses a minimal footprint and is considerate to poor network connections.

from youmightnotneedjquery.

nickmccurdy avatar nickmccurdy commented on August 20, 2024 2

Many modern web features have been influenced by jQuery, but they can't have exactly the same syntax as that would break websites that already use jQuery.

from youmightnotneedjquery.

Abbondanzo avatar Abbondanzo commented on August 20, 2024 2

Going to close this one out, hopefully my comment above contains enough information to answer your original question

from youmightnotneedjquery.

mariocosmi avatar mariocosmi commented on August 20, 2024 1

As jQuery was already a standard many years ago, why people invented 'modern javascript' instead of making jQuery native in the browser?

from youmightnotneedjquery.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.