Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the differences between normal and slim package of jquery?

At CDNJS jquery.slim package is placed. It has a smaller size. What are the major differences from an original? A quick look at the code didn't bring the answer, and at the https://jquery.com I've not found any reference about slim package.

So, what are the differences between jquery.js and jquery.slim.js?

like image 200
SynCap Avatar asked Feb 16 '16 04:02

SynCap


People also ask

What is slim Javascript?

Slim is an ultra fast, native and elegant library for Web Components development.

Does jQuery Slim have ajax?

The slim jQuery version does not include the ajax function.


2 Answers

The short answer taken from the announcement of jQuery 3.0 Final Release :

Along with the regular version of jQuery that includes the ajax and effects modules, we’re releasing a “slim” version that excludes these modules. All in all, it excludes ajax, effects, and currently deprecated code.

The file size (gzipped) is about 6k smaller, 23.6k vs 30k.

like image 194
Jannie Theunissen Avatar answered Sep 30 '22 22:09

Jannie Theunissen


Looking at the code I found the following differences between jquery.js and jquery.slim.js:

In the jquery.slim.js, the following features are removed:

  1. jQuery.fn.extend
  2. jquery.fn.load
  3. jquery.each (attach a bunch of functions for handling common AJAX events)
  4. jQuery.expr.filters.animated
  5. AJAX settings (jQuery.ajaxSettings.xhr, jQuery.ajaxPrefilter, jQuery.ajaxSetup, jQuery.ajaxPrefilter, jQuery.ajaxTransport)
  6. XML parsing (jQuery.parseXML),
  7. Animation effects (jQuery.easing, jQuery.Animation, jQuery.speed)
like image 42
Bhojendra Rauniyar Avatar answered Sep 30 '22 21:09

Bhojendra Rauniyar