Rules

Secret ingredients to quality software

Edit
Info

Do you use Bundling and/or AMD

Last updated by William Yin on 10 Sep 2015 11:22 pm (over 5 years ago) See History

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

Brendan RichardsBrendan Richards
Duncan HunterDuncan Hunter

We open source. This page is on GitHub