📜 ⬆️ ⬇️

Bundle Transformer 1.6.5 released

Logos of Bundle Transformer libraries, to which changes were added in version 1.6.5
The main innovation in the new version of Bundle Transformer is support for the TypeScript language. In addition, changes were made to the product core and to the following modules: BundleTransformer.MicrosoftAjax, BundleTransformer.Yui and BundleTransformer.Csso.

Consider the main innovations of this version:

Core


BundleTransformer.Core now has the opportunity to stop using pre-minimized files (for example, files with *.min.css and *.min.js ) and minimize the code using only the means of the selected minimizer. For enabling / disabling the use of pre-minimized files, the usePreMinifiedFiles attributes of the css and js configuration elements are responsible. The following example shows code that disables the use of pre-minimized files.

 <?xml version="1.0" encoding="utf-8"?> <configuration> ... <bundleTransformer xmlns="http://tempuri.org/BundleTransformer.Configuration.xsd"> <core> <css usePreMinifiedFiles="false"> ... </css> <js usePreMinifiedFiles="false"> ... </js> ... </core> ... </bundleTransformer> ... </configuration> 

By default, the usePreMinifiedFiles attributes are usePreMinifiedFiles to true .
')
This feature is useful for those developers who want to apply minimization algorithms with the highest degree of compression to the entire CSS and / or JS code of their web application. But it should be remembered that some JS-libraries will not be able to compress without errors. In addition, the amount of compressible code will increase, which will increase the duration of minimization on the fly.

Translators


Bundle Transformer: TypeScript


The BundleTransformer.TypeScript module contains a TypeScriptTranslator adapter-translator that translates TypeScript code into JavaScript. If you have not heard anything about TypeScript, I recommend you read the following articles: “TypeScript: a language for developing large JavaScript applications” by Anatoly Alizar and “TypeScript for ASP.NET MVC 4 web applications” by Andrey Veselov.

Compilation parameters of TypeScript code can be configured using the typeScript configuration section in the Web.config file:

 <?xml version="1.0" encoding="utf-8"?> <configuration> ... <bundleTransformer xmlns="http://tempuri.org/BundleTransformer.Configuration.xsd"> <typeScript useNativeMinification="false" useDefaultLib="true" propagateConstants="false" errorOnWith="true" inferPropertiesFromThisAssignment="false" codeGenTarget="EcmaScript3"> <style bitwise="false" blockInCompoundStatement="false" eqEqEq="false" forIn="false" emptyBlocks="true" newMustBeUsed="false" requireSemicolons="false" assignmentInConditions="false" eqNull="false" evalOk="true" innerScopeDeclarationsEscape="true" functionsInLoops="true" reDeclareLocal="true" literalSubscript="true" implicitAny="false" /> </typeScript> ... </bundleTransformer> ... </configuration> 

The names and possible values ​​of more properties coincide with the configuration properties of the source compiler, so I will consider properties whose purpose may not be obvious:

To compile a TS file code that uses types declared in other files, you need to add links to these files in the code. Links to files are added using documenting <reference> tags (for more information about this tag, you can read the article “Facilitating work with JS- and CSS-code in Visual Studio” ).

 /// <reference path="jquery.d.ts" /> /// <reference path="TranslatorBadge.ts" /> /// <summary> /// Creates colored badge for translator /// </summary> ;class ColoredTranslatorBadge extends TranslatorBadge { public getTextColor(): string { /// <summary> /// Gets a text color of badge /// </summary> /// <returns type="String"> /// Text color of badge /// </returns> return this.$linkElem.css("color"); } public setTextColor(color: string): void { /// <summary> /// Sets a text color of badge /// </summary> /// <param name="color" type="String"> /// Text color of badge /// </param> this.$linkElem.css("color", color); } public getBorderColor(): string { /// <summary> /// Gets a border color of badge /// </summary> /// <returns type="String"> /// Border color of badge /// </returns> return this.$badgeElem.css("border-color"); } public setBorderColor(color: string) { /// <summary> /// Sets a border color of badge /// </summary> /// <param name="color" type="String"> /// Border color of badge /// </param> this.$badgeElem.css("border-color", color); } } 

In the code above, the <reference> document tags add links to the jquery.d.ts and TranslatorBadge.ts files.

Minimizers


Bundle Transformer: Microsoft Ajax


In the BundleTransformer.MicrosoftAjax module, the Microsoft Ajax Minifier library has been updated to version 4.69.

Bundle Transformer: YUI


BundleTransformer.Yui has updated the YUI Compressor for .Net library to version 2.1.0.0.

Bundle Transformer: CSSO


In BundleTransformer.Csso ( x86 , x64 ), the CSSO minimizer code was updated to version 1.3.4.

Source: https://habr.com/ru/post/154629/


All Articles