Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
43
rated 0 times [  44] [ 1]  / answers: 1 / hits: 22470  / 8 Years ago, wed, march 2, 2016, 12:00:00

Excuse my ignorance but I just installed jQuery using npm and between the jQuery files there's a file called jquery.slim.js, what is slim? I know the min stands for minified but slim is new to me!.



btw I'm pretty sure slim is not like min because there's another file called jquery.slim.min.js and obviously it's lighter than the normal slim file.



Also the slim file contains the jQuery 3 beta. (That's what the comments in the code say)



Again sorry for the stupid question but I got no clue.



UPDATE



I'm using require to include the files, would the require include this file without my knowledge? or not?


More From » jquery

 Answers
19

I don't know if .slim.js is a standard name extension for javascript library, but for jQuery, it is a build without some extensions, just check the beginning of the file:




-ajax,-ajax/jsonp,-ajax/load,-ajax/parseJSON,-ajax/parseXML,-ajax/script,-ajax/var/location,-ajax/var/nonce,-ajax/var/rquery,-ajax/xhr,-manipulation/_evalUrl,-event/ajax,-effects,-effects/Tween,-effects/animatedSelector,-deprecated




Typically you have no ajax support (jQuery.ajax is not defined), no effects, and the deprecated method are removed.



Concerning requireJS, as far as I know if you require jquery, the only file included will be jquery.js, so you would have to explicitely require jquery.slim in order to get jquery.slim.js file included, which is not what you want.


[#63086] Monday, February 29, 2016, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tyreem

Total Points: 540
Total Questions: 94
Total Answers: 90

Location: Palestine
Member since Tue, Jul 20, 2021
3 Years ago
;