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!

The mobile explosion has exacerbated these issues. Users on mobile devices, especially ones on rural networks, have much higher latency and much lower download speeds than more traditional desktop computers.

10.1. The problem with third-party CDNs

10.2. Downloading jQuery UI from Download Builder

10.3. Managing JavaScript dependencies with AMD

10.4. Building your application’s assets with the optimizer

10.5. Supporting AMD in custom widgets

10.6. Summary

sitemap