WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#13704 closed enhancement (invalid)

jQuery script size

Reported by: jestro Owned by: azaozz
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: JavaScript Keywords:
Focuses: Cc:

Description

The size of the included jQuery script has ballooned up to 74KB in the latest 3.0 RC, nearly 3 times the size of the minified jQuery 1.4.2 script (24KB). This is adds a ton of unnecessary bloat / load time when the script is enqueued by theme or plugin authors. It appears Sizzle is included inside the jQuery script. In the spirit of keeping WP lightweight, fast, and modular, Sizzle should be extracted and jquery.js should include jQuery only.

Change History (11)

comment:1 follow-up: nacin4 years ago

We've been including Sizzle since jQuery 1.3, which was WordPress 2.8.

comment:2 in reply to: ↑ 1 jestro4 years ago

Replying to nacin:

We've been including Sizzle since jQuery 1.3, which was WordPress 2.8.

Up until now the size of the script has been teetering on the edge of "OMG that's huge!". At 74KB in 3.0 it has officially entered that territory and now has the potential to really slow down WP for a lot of users.

Is there a specific reason why it can't be extracted? Maybe provide a jquery.lite.js or similar for devs that actually only want "jQuery" and nothing more?

comment:3 nacin4 years ago

The official release of jQuery includes Sizzle bundled. I don't see much of an advantage to also bundle the light version.

comment:4 follow-up: ocean904 years ago

Ehm Sizzle is in jQuery and jQuery needs it, or I'm totally wrong?

comment:5 jestro4 years ago

Unless I am confused, the official production (minified) release of jQuery does not include Sizzle and is 24KB:

http://jquery.com/
http://code.jquery.com/jquery-1.4.2.min.js

And no, I don't believe jQuery requires Sizzle.

comment:6 in reply to: ↑ 4 ; follow-up: ocean904 years ago

Replying to ocean90:

Ehm Sizzle is in jQuery and jQuery needs it, or I'm totally wrong?

No, I'm no wrong: http://docs.jquery.com/Release:jQuery_1.3#Sizzle_Selector_Engine

jestro: Read the description:

* Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2010, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.

comment:7 in reply to: ↑ 6 jestro4 years ago

ocean90: I am aware it includes Sizzle, that was the whole point of the ticket :)

comment:8 ocean904 years ago

jestro:
You said:
The official production (minified) release of jQuery does not include Sizzle and is 24KB:

That's wrong, it includes Sizzle. Your linked version is the same as we use in core, I don't know, why they say 24KB.

comment:9 follow-up: nacin4 years ago

The difference would be gzip compression. If your server properly gzips assets, you'll be serving a file about 24KB.

comment:10 nacin4 years ago

  • Milestone Unassigned deleted
  • Resolution set to invalid
  • Status changed from new to closed

Best I can tell, Sizzle is standalone in that it does not require jQuery. The reverse is untrue; Sizzle is jQuery's selector dependency.

Closing as invalid.

comment:11 in reply to: ↑ 9 jestro4 years ago

Replying to nacin:

The difference would be gzip compression. If your server properly gzips assets, you'll be serving a file about 24KB.

I stand corrected, thanks for the clarification. I did not notice the gzip compression. Sorry to muddle up the Trac with this :(

Note: See TracTickets for help on using tickets.