I’ve finished developing a beta version of my JavaScript loading optimizer, the jWidget SDK.
github.com/enepomnyaschih/jwsdk/wikiThe jWidget SDK is a small script builder (precompiler) of your JavaScript. This wrapper around YUICompressor, which automates the assembly of the project and gives a very flexible configuration. The tool is compatible with any server architecture, with all JavaScript frameworks. The tool is free, open source and licensed under the LGPL.
')
The tool has been successfully tested on several commercial projects with different server architecture. Including (I do not have the right to give links):
- A clean web service in Java + AJAX + JS. Application feature: all the entire content content is rendered dynamically through JavaScript, and the application is loaded almost instantly due to browser caching
- One chess client on jQuery, built into the site on the Zend Framework
- Client single application on Adobe Air
The bottom line is this: by setting up the SDK in a certain way, you get the opportunity to build your application in one of two modes: debug and release. When the application is loaded in the browser after building in debug mode, you will see in the <head> section of your HTML all the source JS files where you can set breakpoints and debug. When the application is loaded in the browser after building in release mode, you will see compressed MIN.JS files in the <head> section of your HTML, which significantly speeds up loading. In addition, the SDK prevents caching of modified source files, and also provides a special mechanism for configuring external services (like Google Analytics) and static connection of resources (TXT, JSON, HTML) to your JS code.
I can’t find significant flaws in my chosen architecture, which are present in abundance in other architectures, such as dynamic script loading, PHP connection of scripts and precompilation of the application using the Sencha SDK. The current implementation has several limitations, but they will be fixed in future versions.
Get acquainted with the jWidget SDK, find out all its features, comparative characteristics with other tools for optimizing JavaScript loading, you can see an example in the wiki project:
github.com/enepomnyaschih/jwsdk/wikiReally looking forward to your comments. Ready to improve jWidget SDK for user feedback. I highly recommend using at all without exception projects where there is JavaScript. If you have any questions - please contact via GitHub or write in the comments, I will be happy to help.
Known bugs:
- There is no multilanguage support in JSON configuration files
Expected in the following versions:
- Recompiling only modified source files
- Compression and CSS optimization
- Inline-meta tags in comments inside JS-files: <jwinclude> for connecting JS-files, <jwdebug> for outputting debug information of the application and assert in debug version of the application only