Home
Do you use Bundling and/or AMD
  v3.0 Posted at 11/09/2015 9:22 AM by William Yin
​​Minification and AMD are techniques to improve javascript performance. They can both can be used with vanilla JavaScript and with Typescript

​​​AMD and RequireJs

AMD is a client-side technology​​​ that allows you to break you Js code into small inter-dependent modules. The modules (and thier dependencies) required to render a particular page are determined at runtime and subsequently downloaded by Javascript. RequireJs is a popular AMD implementation.

Pro: Only the js modules you need are downloaded
Con: Each module is downloaded in a separate http request

​Bundling and Minification

​This is a server side technique that combines and optimises client side files into single, optimised downloads.

ASP.Net contains excellent server-side bundling support as outlined here: http://www.asp.net/mvc/overview/performance/bundling-and-minification​

ASP.Net vnext & VS 2015 also provides support for using task runners like Gulp or Grunt for bundling and minification.​

Pro: Fewer Http requests and smaller files
Con: All client side modules are included in a single download​

Related rules

    Do you feel this rule needs an update?

    If you want to be notified when this rule is updated, please enter your email address:

    Comments: