PDA

View Full Version : What are the pros and cons of Sencha Cmd, and alternatives for its various purposes?



xjscrafter
10 Feb 2014, 12:21 PM
I've started making changes to our app structure to make full use of the Sencha Cmd minification, theming, packaging, etc. capabilities.

But my manager wants me to consider what are the pros and cons of using Sencha Cmd, and what are the alternatives.

So for minification and obfuscation, rather than use Sencha Cmd, just use YUI Compressor directly.

For theming, is there any alternative, in terms of using the ExtJS 4.2 theming model but not build the theme with Sencha Cmd?

What else does Sencha Cmd offer that is a pro? What are the cons of using Sencha Cmd? What are the alternatives to using Sencha Cmd for the various things that must be done with an ExtJS app?

Finally, can I safely assume Sencha Cmd can be integrated into our existing build processes? We use Maven to compile Java for the back-end. Can Sencha Cmd also be executed in a completely hands-off, automated manner? Does Sencha Cmd itself need to be installed, or can its files just be added to the remote git repository, to remove the need for a dedicated build machine, so anyone can just pull from git and create a build?

Thanks very much in advance!

LesJ
10 Feb 2014, 2:20 PM
The Sencha Cmd documentation is pretty good.

To me the biggest pro is that it can combine related scripts (classes) together into a single file suitable for deployment.

This would be very hard to do by hand.

burnnat
10 Feb 2014, 3:13 PM
I have a post here (http://www.sencha.com/forum/showthread.php?279768-Is-Sencha-Cmd-or-YUI-compressor-better-for-an-ExtJs4.2.2-application&p=1022636&viewfull=1#post1022636) that answers some similar questions about the advantages of Sencha Cmd over YUI Compressor alone. To quote myself, the main things Sencha Cmd does as part of the build process are:



Computes class dependencies for your application, compiles and compresses javascript.
Copies resources (images, etc.) from theme and package dependencies into build directory.
Compiles SASS files to (compressed) CSS for classes in the build.
Generates gradient and border-radius images for use in IE (or other non-CSS3 browsers).



For #1, there are plenty of javascript compression/minification tools out there, but I'm not aware of any that are integrated with the ExtJS class/dependency system like Sencha Cmd is. For #2, you could use basically any generic build tool (Ant, Maven, etc.) to accomplish this. For #3, you can execute Compass/SASS directly to build the theme, but you'd lose Sencha Cmd's ability to determine the minimal set of styles necessary for the classes used in your application (again, I don't know of any other tool that's integrated with ExtJS like this; you'd have to do this by hand if you wanted it). And for #4, I'm not aware of any other tool offering this functionality, as it's pretty tightly integrated with the ExtJS component and theme setup.

You may be able to piece together the same basic functionality with a suite of other tools, but you'd end up losing a lot of the nice features from Sencha Cmd's "knowledge" about the ExtJS framework that other tools don't have. Add to that Sencha Cmd's facilities for workspace management and packaging, and I think there's a pretty clear-cut case to choose Sencha Cmd over a hodge-podge of other utilities.

xjscrafter
10 Feb 2014, 7:01 PM
Thanks very much for your replies. This is going to help out a lot!