jQuery supports custom builds. The latest beta version supports removing the ready event, Sizzle selector and many other features.

Core JS should be able to run on a stripped down version of jQuery to allow knowledgable developer to build fast frontends more easily. I would like to ship jQuery with the ready event removed altogether to force contrib to use Drupal.behaviors, I've seen way to many jQuery.ready() during my audits to count.

What I'm proposing:

Run core JS with this jQuery build: grunt custom:-core/ready,-sizzle,-deprecated,-effects,-event/alias,-wrap,-ajax/jsonp
Ship Drupal with that one: grunt custom:-core/ready

For info the size of unminified and minified for the different versions:

build original minified min+gz
Normal 245207 83820 29363
-core/ready 242970 83203 29159
-core/ready,-sizzle,-deprecated,-effects,
-event/alias,-wrap,-ajax/jsonp
165640 56816 20105

Comments

nod_’s picture

Issue summary: View changes
nod_’s picture

nod_’s picture

ibnkhaldun’s picture

I read your post "Reduce dependency on jQuery" and almost all the comments on. So came here. While reading I ask my self: why not an scalable version of jquery? Is it possible? as Dojo is. I think It should be a good solution to load on demand the needed subset of objects. Perhaps better than truncate nice functions we all use everywhere.

nod_’s picture

You're right, which is why I started working on this a while back (need to get back to it though): https://www.npmjs.com/package/jquarry

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

andypost’s picture

Version: 8.2.x-dev » 8.3.x-dev

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.