Chapter 10. Preparing your application for production
This chapter covers
- Managing dependencies with AMD
- Building your files for production
- Adding AMD support to jQuery UI extensions
So far, we’ve discussed all the components (widgets, effects, utilities, and more) that make up the jQuery UI library. Although these components offer a lot of functionality, there are a few problems associated with having this many components. The biggest problem is, because jQuery UI is a client-side library, the browser must download all the JavaScript code to implement this functionality over the network—which increases the amount of time it takes your application to load.
To make things worse, because JavaScript is an interpreted language, the browser also has to convert the text contents of these JavaScript files to executable byte code—which leads to a longer wait for your users. Load times are important. Studies have shown that over 25% of people abandon a website if it takes over 4 seconds to load. An amazon.com spokesman famously stated that a one-second delay on its load times represents a loss of over $1.5 billion a year!