The code should still work, but you may want to look for a more up-to-date tutorial. (Including scripts by plugins.)Īn important requirement might be to keep this step optional.Heads up: this post was written in 2016, and some of the tools and prices may have changed. * Or the web frontend could dynamically minify and cache and combine just the files required for a request into one file. * Alternatively, we could hook it into `trac-admin deploy` somehow. or provide setuptools commands (both use YUI compressor, which requires Java) * Another idea would be to add it to `setup.py`. The step / a related step could do JSLint checking. We could then switch our to 4 spaces indentation and add copyright and documentation comments to file headers. This would allow developing with clean, well-commented source files while improving performance. (Although I guess there are too many alternatives to try all of them.)Īs it might be a good idea to introduce a minification step that pre-processes the !JavaScript and CSS files stored in source control. The online services ( CleanCSS) and ( UglifyJS) might also be interesting. (For CleanCSS I had to add another flag: -skip-rebase.) Only Closure Compiler with Advanced optimizations achieves better rates.įor the CSS CleanCSS and YUI perform very similarly: The Closure Compiler has three optimization levels ( Whitespace only, Simple and Advanced). Are these three minifiers ( YUI Compressor, UglifyJS and Clean-CSS) the ones we want to include?įor comparison here are the results of the various Javascript transformers:.Should the Java, NodeJS and NPM package dependencies be declared in setup.py somehow?.Especially as currently requires the from _future_ import absolute_import directive to import its external dependency yuicompressor.DeployTransformer suffix a good idea? etc.) A similar problem comes up if we want to merge / concatenate files.(I can't see anything that would prevent that at the moment, although it is currently not obvious from the interface documentation if that is allowed.) These would probably want to change the extension of the destination filename.But even then it's unclear how references to the unpreprocessed files would be overridden if the optional preprocessed files are created.) (Unless the default is to interpret the unpreprocessed files in the browser. So I am not sure the (optional) deploy step is the right place for these. CSS compilation from LESS, SASS, … ( #633).Javascript compilation from Coffeescript, Typescript, Clojurescript, Dart, … ( #10735).Other vaguely similar preprocessing steps:.PNG optimization ( #11024) was mentioned, and seems like it would be no problem.Is that interface at the right abstraction level? Is it general enough to be useful for other use cases?.IStaticResourcePreprocessor, IDeploymentParticipant, …) And the front-end itself might be able to do such things and more (e.g. css, no matter what optimization we do at that level, is probably less efficient than letting directly the front-end serve them. js files would be minified before being copied in to the deploy location (in _do_deploy).įor the last step you suggested, minify and combine on the fly, I'm not sure it's worth the effort, as going through Python for serving. distwebres can't (yet?) be easy_installed.Īlso, I think the best solution would be to do this minification step at deploy time, as this will enable us to minify the resources from plugins as well. css could also be shrinked down, though the savings are less important.įor the messages/*.js, the savings are marginal, between 93% and 97% of the original.Īs for the tool, minify seems to be the most convenient, as when you easy_install it, it also downloads the YUI compressor. Good idea! I had a run of the YUI compressor and indeed, this cuts the size of our.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |