Comments (4)
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.
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.
Going to close this one out, hopefully my comment above contains enough information to answer your original question
from youmightnotneedjquery.
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)
- Modernization HOT 17
- Replace slider with radio buttons or select HOT 9
- Bugs with Brazilian/Portuguese internationalization HOT 1
- Don't change URL query params by default HOT 1
- Support adding HTML for a defer/module load example
- I18n HOT 3
- Support for refresh an element HOT 3
- Namespaced Events
- Event delegation does not match jQuery behaviour HOT 3
- The selector option of Prev does not match jQuery behaviour
- Spread operator is not needed for the iterable in for...of
- Last is having a NodeList uses array method directly
- Trigger Native needs to be looked into HOT 2
- Next is missing the feature of optional selector, which the jQuery version has HOT 1
- The `:visible` selector is not listed HOT 1
- Example with error HOT 1
- Unnecessary return of undefined in modern next and prev HOT 2
- Example for `scrollTop` not working HOT 1
- Specify append is only for text HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from youmightnotneedjquery.