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

后端 未结 7 1183
旧巷少年郎
旧巷少年郎 2020-11-22 03:27

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

7条回答
  •  北海茫月
    2020-11-22 04:08

    At this time, the most authoritative answer appears to be in this issue, which states "it is a custom build of jQuery that excludes effects, ajax, and deprecated code." Details will be announced with jQuery 3.0.

    I suspect that the rationale for excluding these components of the jQuery library is in recognition of the increasingly common scenario of jQuery being used in conjunction with another JS framework like Angular or React. In these cases, the usage of jQuery is primarily for DOM traversal and manipulation, so leaving out those components that are either obsolete or are provided by the framework gains about a 20% reduction in file size.

提交回复
热议问题