Skip to content

Commit

Permalink
In BundleTransformer.TypeScript in configuration settings of TypeScri…
Browse files Browse the repository at this point in the history
…pt translator was added one new property - `NoStrictGenericChecks` (default `false`)
  • Loading branch information
Taritsyn committed Jun 29, 2017
1 parent 808bc33 commit da58ae9
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ BundleTransformer.TypeScript does not support external modules (CommonJS, AMD, S

As a JS engine is used the JavaScript Engine Switcher library (https://github.com/Taritsyn/JavaScriptEngineSwitcher). For correct working of this module, you need to install one of the following NuGet packages: JavaScriptEngineSwitcher.Msie, JavaScriptEngineSwitcher.V8 or JavaScriptEngineSwitcher.ChakraCore.</description>
<summary>BundleTransformer.TypeScript contains one translator-adapter - `TypeScriptTranslator` (supports the TypeScript version 2.4 RTM). This adapter makes translation of TypeScript code to JS code. Also contains the `TypeScriptAssetHandler` debugging HTTP handler, which is responsible for text output of translated TypeScript asset.</summary>
<releaseNotes>Added support of TypeScript version 2.4 RTM (please note: The 2.4 RTM release is also called '2.4.1').</releaseNotes>
<releaseNotes>1. Added support of TypeScript version 2.4 RTM (please note: The 2.4 RTM release is also called '2.4.1');
2. In configuration settings of TypeScript translator was added one new property - `NoStrictGenericChecks` (default `false`).</releaseNotes>
<copyright>Copyright (c) 2012-2017 Andrey Taritsyn - http://www.taritsyn.ru</copyright>
<language>en-US</language>
<tags>BundleTransformer System.Web.Optimization IBundleTransform ASP.NET JavaScript JS Bundling TypeScript Translation Translator Compilation Compiler</tags>
Expand Down
6 changes: 4 additions & 2 deletions NuGet/BundleTransformer.TypeScript/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@
=============
RELEASE NOTES
=============
Added support of TypeScript version 2.4 RTM (please note: The 2.4 RTM release is
also called '2.4.1').
1. Added support of TypeScript version 2.4 RTM (please note: The 2.4 RTM release
is also called '2.4.1');
2. In configuration settings of TypeScript translator was added one new
property - `NoStrictGenericChecks` (default `false`).

====================
POST-INSTALL ACTIONS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,11 @@
<xs:documentation>Flag for whether to do not resolve a script references</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="noStrictGenericChecks" type="Boolean_SchemaType" use="optional" default="false">
<xs:annotation>
<xs:documentation>Flag for whether to disable strict checking of generic signatures</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="noUnusedLocals" type="Boolean_SchemaType" use="optional" default="false">
<xs:annotation>
<xs:documentation>Flag for whether to report errors on unused locals</xs:documentation>
Expand Down
3 changes: 2 additions & 1 deletion samples/BundleTransformer.Sample.AspNet4.Mvc4/Web.config
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@
newLine="CrLf" noEmit="false" noEmitHelpers="false"
noEmitOnError="false" noErrorTruncation="false" noFallthroughCasesInSwitch="false"
noImplicitAny="false" noImplicitReturns="false" noImplicitThis="false"
noLib="false" noResolve="false" noUnusedLocals="false" noUnusedParameters="false"
noLib="false" noResolve="false" noStrictGenericChecks="false"
noUnusedLocals="false" noUnusedParameters="false"
preserveConstEnums="false" removeComments="false"
skipDefaultLibCheck="false" skipLibCheck="false"
strictNullChecks="false" stripInternal="false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,17 @@ public bool NoResolve
set { this["noResolve"] = value; }
}

/// <summary>
/// Gets or sets a flag for whether to disable strict checking of generic signatures
/// in function types
/// </summary>
[ConfigurationProperty("noStrictGenericChecks", DefaultValue = false)]
public bool NoStrictGenericChecks
{
get { return (bool)this["noStrictGenericChecks"]; }
set { this["noStrictGenericChecks"] = value; }
}

/// <summary>
/// Gets or sets a flag for whether to report errors on unused locals
/// </summary>
Expand Down
11 changes: 11 additions & 0 deletions src/BundleTransformer.TypeScript/Internal/CompilationOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,16 @@ public bool NoResolve
set;
}

/// <summary>
/// Gets or sets a flag for whether to disable strict checking of generic signatures
/// in function types
/// </summary>
public bool NoStrictGenericChecks
{
get;
set;
}

/// <summary>
/// Gets or sets a flag for whether to report errors on unused locals
/// </summary>
Expand Down Expand Up @@ -311,6 +321,7 @@ public CompilationOptions()
NoImplicitThis = false;
NoLib = false;
NoResolve = false;
NoStrictGenericChecks = false;
NoUnusedLocals = false;
NoUnusedParameters = false;
PreserveConstEnums = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ private static JObject ConvertCompilationOptionsToJson(CompilationOptions option
new JProperty("noImplicitThis", options.NoImplicitThis),
new JProperty("noLib", options.NoLib),
new JProperty("noResolve", options.NoResolve),
new JProperty("noStrictGenericChecks", options.NoStrictGenericChecks),
new JProperty("noUnusedLocals", options.NoUnusedLocals),
new JProperty("noUnusedParameters", options.NoUnusedParameters),
new JProperty("preserveConstEnums", options.PreserveConstEnums),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,16 @@ public bool NoResolve
set;
}

/// <summary>
/// Gets or sets a flag for whether to disable strict checking of generic signatures
/// in function types
/// </summary>
public bool NoStrictGenericChecks
{
get;
set;
}

/// <summary>
/// Gets or sets a flag for whether to report errors on unused locals
/// </summary>
Expand Down Expand Up @@ -373,6 +383,7 @@ public TypeScriptTranslator(Func<IJsEngine> createJsEngineInstance,
NoImplicitThis = tsConfig.NoImplicitThis;
NoLib = tsConfig.NoLib;
NoResolve = tsConfig.NoResolve;
NoStrictGenericChecks = tsConfig.NoStrictGenericChecks;
NoUnusedLocals = tsConfig.NoUnusedLocals;
NoUnusedParameters = tsConfig.NoUnusedParameters;
PreserveConstEnums = tsConfig.PreserveConstEnums;
Expand Down Expand Up @@ -523,6 +534,7 @@ private CompilationOptions CreateCompilationOptions()
NoImplicitThis = NoImplicitThis,
NoLib = NoLib,
NoResolve = NoResolve,
NoStrictGenericChecks = NoStrictGenericChecks,
NoUnusedLocals = NoUnusedLocals,
NoUnusedParameters = NoUnusedParameters,
PreserveConstEnums = PreserveConstEnums,
Expand Down

0 comments on commit da58ae9

Please sign in to comment.