by codedokode · 4y ago · 0 comments
Also it is difficult to find non-jQuery library of a good quality. For example, I was looking for a small library to send and receive JSON via HTTP, and ended up writing my own wrapper around XMLHttpRequest (fetch() is a poor choice, it is not supported well in older browsers and it has no advantages, and fetch() requests cannot be aborted) because there was no good library for this. Other libraries either do not support all necessary browsers or are overengineered and too large.
JQuery's own site says the library is 30 to 40 Kb, not 300 or 400. The minified JS file I downloaded of the latest version is 87 Kb, so I assume the rest would be taken care of with zip headers.
Are people routinely serving the uncompressed version of the library?
Browser caches are partitioned by origin so if a.com and b.com both use jquery from c.com then two copies of jquery will be cached one with a key of a.com/c.com and another with b.com/c.com
I thought and heard that using a JS library from CDN is beneficial when users already have that same cached JS library from visiting other sites. But you're saying that's not a thing? So what's the benefit of using a CDN for jquery then?
Does {signal} not work yet? https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API#a...
I've seen stats that indicate that 5% of the U.S. population (to say nothing of other parts of the world) are still on Android Oreo (version 8), which wouldn't surprise me since older phones are basically locked in time.
https://javascript.info/fetch-progress
> Please note: there’s currently no way for fetch to track upload progress. For that purpose, please use XMLHttpRequest, we’ll cover it later.
coming soon (2020) https://ilikekillnerds.com/2020/09/file-upload-progress-with...
If you still need to support old IE you can use a library like https://github.com/github/fetch
It is? You can use grunt to make your own version, excluding the parts you don't need.
https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API#a...