#112 [RFE] Optimize and minify Javascript prior to live deployment
Closed: Fixed None Opened 13 years ago by admiyo.

Currently, the index.xhtml page loads in many different javascript files. Each of these includes is a call to the server, and loading a page is starting to feel sluggish. We should take some or all of the following steps.

  1. There are known techniques for only fetching a javascript included page on demand. We can split up the site such that user.js only gets fetched from the user pages, group.js from the group pages and so on.

  2. Run all the javascript code through a minimizer. This speeds up the download process.

  3. Profile the site from the browser and make any performance optimizations suggested by it.

  4. Collect some of the Javascript into a single document. search.js and details.js should probably be refactored, combined, and moved into ipa.js

  5. Set appropriate page caching meta information so that files are not fetched multiple times per session.


I'm going to postponse this, as the Minimized version is very hard to debug, and will require separate testing. We still have a lot of work to do on getting features implemented, and retesting the minimized version after each commit will be more work than is justified. This is not a hard and fast requirement, just a nice to have, and so I'm goingto mark it as an enhancement. It was more important before we got the hashchange approach implemented.

This changeset does following things:
- integrates Dojo library into FreeIPA Web UI
- encapsulates UI parts by AMD definition so they can be used in build process and by AMD loader
- introduces Dojo builder for building Web UI and UglifyJS for minimizing JS
- contains help and build scripts for developers and a make process

Overall it makes final application smaller, faster loadable and it's a foundation for additional refactoring.

master (pushed in reversed order):
- 5d919c9 Change tests to use AMD loader
- c71937f Updated makefiles to build FreeIPA Web UI layer
- 5e90c98 Change Web UI sources to simple AMD modules
- e3ce3e4 AMD config file
- be0a120 Update JavaScript Lint configuration file
- b9ef6ab Move of core Web UI files to AMD directory
- 8f8e790 Move of Web UI non AMD dep. libs to libs subdirectory
- 65301fe Web UI Sync development utility
- 92de64e Web UI development environment directory structure and configuration
- 2173415 Minimal Dojo layer
- 339790e Config files for builder of FreeIPA UI layer
- 9d33647 Dojo Builder
- 8c59ddb Use Uglify.js for JS optimization

No visual change, no UXD input needed.

ipa-3-1:
- 95a191e Change tests to use AMD loader
- aec3546 Updated makefiles to build FreeIPA Web UI layer
- 591041d Change Web UI sources to simple AMD modules
- e472a34 AMD config file
- 193d0ac Update JavaScript Lint configuration file
- 5ae3f90 Move of core Web UI files to AMD directory
- 27d9348 Move of Web UI non AMD dep. libs to libs subdirectory
- 16f9038 Web UI Sync development utility
- 146f3a7 Web UI development environment directory structure and configuration
- 2ae4e64 Minimal Dojo layer
- 4a4cbde Config files for builder of FreeIPA UI layer
- e8db24f Dojo Builder
- d7b25b0 Use Uglify.js for JS optimization

Metadata Update from @admiyo:
- Issue assigned to pvoborni
- Issue set to the milestone: FreeIPA 3.2 - 2013/01

7 years ago

Login to comment on this ticket.

Metadata