diff options
author | Paul Duncan <pabs@pablotron.org> | 2022-09-11 20:50:13 -0400 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2022-09-11 20:50:13 -0400 |
commit | 1dba2e9f93939a07d86ac3c60d85b3235b483da1 (patch) | |
tree | 2437c25ff5143779409d9935e020af88554ad88f /content/posts/2022-09-11-jqueries.md | |
parent | bc8344f621094b45bbb2e9a5a35d607027511292 (diff) | |
download | pablotron.org-1dba2e9f93939a07d86ac3c60d85b3235b483da1.tar.bz2 pablotron.org-1dba2e9f93939a07d86ac3c60d85b3235b483da1.zip |
content/posts/2022-09-11-jqueries.md: add sizes table, rewordify
Diffstat (limited to 'content/posts/2022-09-11-jqueries.md')
-rw-r--r-- | content/posts/2022-09-11-jqueries.md | 76 |
1 files changed, 52 insertions, 24 deletions
diff --git a/content/posts/2022-09-11-jqueries.md b/content/posts/2022-09-11-jqueries.md index effaf55..343753a 100644 --- a/content/posts/2022-09-11-jqueries.md +++ b/content/posts/2022-09-11-jqueries.md @@ -3,41 +3,69 @@ slug: jqueries title: "jQueries" date: "2022-09-11T07:23:10-04:00" draft: true +tables: + sizes: + # table columns (required) + cols: + - id: "build" + name: "Build" + tip: "jQuery build." + - id: "minified_size" + name: "Minified" + tip: "Build size, minified, in kilobytes." + align: "right" + - id: "compressed_size" + name: "Compressed" + tip: "Build size, minified and compressed, in kilobytes." + align: "right" + + # table rows (required) + rows: + - build: "jQuery 3.6.1 Full" + minified_size: "90 kB" + compressed_size: "30 kB" + - build: "jQuery 3.6.1 Slim" + minified_size: "73 kB" + compressed_size: "25 kB" --- -Several of my coworkers do not like [jQuery][]. A lot of folks say -that the modern [DOM][] and cross-browser compatibility are now good -enough that [you might not need jQuery][]. Other common arguments -against [jQuery][] are code bloat and security. +Several of my coworkers do not like [jQuery][]. Some common arguments +against it are: + +1. Modern [DOM][] APIs and cross-browser compatibility are now good + enough that [you don't need jQuery][not needed]. +2. [jQuery][] is bloated. +3. [jQuery][] is the source of security problems. My personal opinion is a bit more nuanced. I agree that [jQuery][] -isn't *necessary* for new projects and that the modern [DOM][] is -usually sufficient. +isn't *strictly necessary* for new web applications and that the modern +[DOM][] API is usually sufficient. -That said, [if it ain't broke, don't fix it][fix]. It often takes -less effort to maintain [jQuery][] in an existing application than it -does to remove [jQuery][] and replace it with something else. +But [if it ain't broke, don't fix it][fix]. It often takes less effort +to maintain [jQuery][] in an existing application than it does to remove +[jQuery][] or replace it with something else. -Also, consistency is important. If a team of developers is working on -several applications, then consistency between code bases is often more -important than using the latest technology or the best technique. -Using consistent dependencies, idioms, and formatting reduces the -[cognitive load][] for the entire team. +Also, consistency is important. Given a team of developers working on +several applications, relying on consistent dependencies, idioms, and +formatting between disparate code bases is often more important than +using the latest technology or the best technique, because the +consistency reduces the [cognitive load][] for the entire team. -In the case where a team is creating a new application and that team -already maintains several existing [jQuery][] applications, I would -argue in favor of using [jQuery][] for the new application as long as -the version of [jQuery][] is kept up to date. +I would prefer using [jQuery][] for new applications this scenario too, +provided that [jQuery][] and other dependencies are kept up to date. Even as someone who [cares about page size][shrinkage] and [literally -measures JavaScript size by the byte][js-byte-size]), I don't -find the arguments about bloat compelling; [jQuery 3.6.1][] (the current -version as of this writing) is 90kb minified, and 30kb compressed. Slim -builds are even smaller (73kb and 25kb, respectively). That is -relatively small +measures JavaScript size by byte][js-byte-size], I don't find the +argument that [jQuery][] is bloated particularly compelling. The sizes +of [jQuery 3.6.1][] are as follows: + +{{< table "sizes" >}} + +At these sizes jQuery is relatively small compared to a single bitmap +image [jquery]: https://jquery.com/ "jQuery" -[you might not need jquery]: https://youmightnotneedjquery.com/ +[not needed]: https://youmightnotneedjquery.com/ "You might not need jQuery." [dom]: https://en.wikipedia.org/wiki/Document_Object_Model "Document Object Model" |