Do you use Bundling and/or AMD

Updated by Brady Stroud [SSW] 1 year ago. See history

123

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.

✅ Figure: Pro: Only the js modules you need are downloaded

❌ Figure: 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.

✅ Figure: Pro: Fewer Http requests and smaller files

❌ Figure: Con: All client side modules are included in a single download

acknowledgements
related rules