Skip to content

Commit

Permalink
1. In BundleTransformer.ConfigurationIntelliSense updated definitions…
Browse files Browse the repository at this point in the history
… for configuration settings of the TypeScript translator;

2. In BundleTransformer.TypeScript:
	2.1. Added support for the TypeScript version 5.6 RTM (please note: The 5.6 RTM release is also called '5.6.2');
	2.2. In configuration settings of the TypeScript translator was added one new property - `StrictBuiltinIteratorReturn` (default `false`).
  • Loading branch information
Taritsyn committed Sep 21, 2024
1 parent e97884a commit 25c4eef
Show file tree
Hide file tree
Showing 31 changed files with 3,464 additions and 2,653 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -734,16 +734,21 @@
<xs:documentation>Flag for whether to check that the arguments for `bind`, `call`, and `apply` methods match the original function</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="strictNullChecks" type="Boolean_SchemaType" use="optional" default="false">
<xs:attribute name="strictBuiltinIteratorReturn" type="Boolean_SchemaType" use="optional" default="false">
<xs:annotation>
<xs:documentation>Flag for whether to take into account `null` and `undefined` when type checking</xs:documentation>
<xs:documentation>Flag for whether to instantiate built-in iterators with a `TReturn` type of `undefined` instead of `any`</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="strictFunctionTypes" type="Boolean_SchemaType" use="optional" default="false">
<xs:annotation>
<xs:documentation>Flag for whether to check to ensure parameters and the return values are subtype-compatible when assigning functions</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="strictNullChecks" type="Boolean_SchemaType" use="optional" default="false">
<xs:annotation>
<xs:documentation>Flag for whether to take into account `null` and `undefined` when type checking</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="strictPropertyInitialization" type="Boolean_SchemaType" use="optional" default="false">
<xs:annotation>
<xs:documentation>Flag for whether to check for class properties that are declared but not set in the constructor</xs:documentation>
Expand Down
4 changes: 2 additions & 2 deletions samples/BundleTransformer.Sample.AspNet462.Mvc4/Web.config
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@
noUnusedLocals="false" noUnusedParameters="false"
preserveConstEnums="false" removeComments="false"
skipDefaultLibCheck="false" skipLibCheck="false"
strictBindCallApply="false" strictNullChecks="false" strictFunctionTypes="false"
strictPropertyInitialization="false" stripInternal="false"
strictBindCallApply="false" strictBuiltinIteratorReturn="false" strictFunctionTypes="false"
strictNullChecks="false" strictPropertyInitialization="false" stripInternal="false"
suppressTypeCheckingErrors="false"
target="EcmaScript5" transpileOnly="false"
useDefineForClassFields="false" useUnknownInCatchVariables="false">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
<PackageIconUrl>https://raw.githubusercontent.com/Taritsyn/BundleTransformer/master/images/icons/128/BundleTransformer_TypeScript_Logo_128x128.png</PackageIconUrl>
<PackageIconFullPath>../../images/icons/128/BundleTransformer_TypeScript_Logo_128x128.png</PackageIconFullPath>
<PackageTags>$(PackageCommonTags);JavaScript;JS;Bundling;TypeScript;Translation;Translator;Compilation;Compiler</PackageTags>
<PackageReleaseNotes>1. Added support for the TypeScript version 5.5.4;
2. In configuration settings of the TypeScript translator:
2.1. Become obsolete four properties: `KeyofStringsOnly`, `NoStrictGenericChecks`, `SuppressExcessPropertyErrors` and `SuppressImplicitAnyIndexErrors`, and also the `EcmaScript3` value of the `Target` property;
2.2. Added one new property - `NoCheck` (default `false`).</PackageReleaseNotes>
<PackageReleaseNotes>1. Added support for the TypeScript version 5.6 RTM (please note: The 5.6 RTM release is also called '5.6.2');
2. In configuration settings of the TypeScript translator was added one new property - `StrictBuiltinIteratorReturn` (default `false`).</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,13 +342,14 @@ public bool StrictBindCallApply
}

/// <summary>
/// Gets or sets a flag for whether to take into account <c>null</c> and <c>undefined</c> when type checking
/// Gets or sets a flag for whether to instantiate built-in iterators with a <c>TReturn</c> type of <c>undefined</c>
/// instead of <c>any</c>
/// </summary>
[ConfigurationProperty("strictNullChecks", DefaultValue = false)]
public bool StrictNullChecks
[ConfigurationProperty("strictBuiltinIteratorReturn", DefaultValue = false)]
public bool StrictBuiltinIteratorReturn
{
get { return (bool)this["strictNullChecks"]; }
set { this["strictNullChecks"] = value; }
get { return (bool)this["strictBuiltinIteratorReturn"]; }
set { this["strictBuiltinIteratorReturn"] = value; }
}

/// <summary>
Expand All @@ -362,6 +363,16 @@ public bool StrictFunctionTypes
set { this["strictFunctionTypes"] = value; }
}

/// <summary>
/// Gets or sets a flag for whether to take into account <c>null</c> and <c>undefined</c> when type checking
/// </summary>
[ConfigurationProperty("strictNullChecks", DefaultValue = false)]
public bool StrictNullChecks
{
get { return (bool)this["strictNullChecks"]; }
set { this["strictNullChecks"] = value; }
}

/// <summary>
/// Gets or sets a flag for whether to check for class properties that are declared but not set in the
/// constructor
Expand Down
17 changes: 14 additions & 3 deletions src/BundleTransformer.TypeScript/Internal/CompilationOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,10 @@ public bool StrictBindCallApply
}

/// <summary>
/// Gets or sets a flag for whether to take into account <c>null</c> and <c>undefined</c> when type checking
/// Gets or sets a flag for whether to instantiate built-in iterators with a <c>TReturn</c> type of <c>undefined</c>
/// instead of <c>any</c>
/// </summary>
public bool StrictNullChecks
public bool StrictBuiltinIteratorReturn
{
get;
set;
Expand All @@ -328,6 +329,15 @@ public bool StrictFunctionTypes
set;
}

/// <summary>
/// Gets or sets a flag for whether to take into account <c>null</c> and <c>undefined</c> when type checking
/// </summary>
public bool StrictNullChecks
{
get;
set;
}

/// <summary>
/// Gets or sets a flag for whether to check for class properties that are declared but not set in the
/// constructor
Expand Down Expand Up @@ -461,8 +471,9 @@ public CompilationOptions()
SkipDefaultLibCheck = false;
SkipLibCheck = false;
StrictBindCallApply = false;
StrictNullChecks = false;
StrictBuiltinIteratorReturn = false;
StrictFunctionTypes = false;
StrictNullChecks = false;
StrictPropertyInitialization = false;
StripInternal = false;
#pragma warning disable CS0612
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,9 @@ private static JObject ConvertCompilationOptionsToJson(CompilationOptions option
new JProperty("skipDefaultLibCheck", options.SkipDefaultLibCheck),
new JProperty("skipLibCheck", options.SkipLibCheck),
new JProperty("strictBindCallApply", options.StrictBindCallApply),
new JProperty("strictNullChecks", options.StrictNullChecks),
new JProperty("strictBuiltinIteratorReturn", options.StrictBuiltinIteratorReturn),
new JProperty("strictFunctionTypes", options.StrictFunctionTypes),
new JProperty("strictNullChecks", options.StrictNullChecks),
new JProperty("strictPropertyInitialization", options.StrictPropertyInitialization),
new JProperty("stripInternal", options.StripInternal),
new JProperty("suppressTypeCheckingErrors", options.SuppressTypeCheckingErrors),
Expand Down
2 changes: 1 addition & 1 deletion src/BundleTransformer.TypeScript/PACKAGE-DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
BundleTransformer.TypeScript contains one translator-adapter - `TypeScriptTranslator` (supports the [TypeScript](https://www.typescriptlang.org) version 5.5.4).
BundleTransformer.TypeScript contains one translator-adapter - `TypeScriptTranslator` (supports the [TypeScript](https://www.typescriptlang.org) version 5.6 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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,22 @@ and limitations under the License.
/// Window Async Iterable APIs
/////////////////////////////

interface FileSystemDirectoryHandleAsyncIterator<T> extends AsyncIteratorObject<T, BuiltinIteratorReturn, unknown> {
[Symbol.asyncIterator](): FileSystemDirectoryHandleAsyncIterator<T>;
}

interface FileSystemDirectoryHandle {
[Symbol.asyncIterator](): AsyncIterableIterator<[string, FileSystemHandle]>;
entries(): AsyncIterableIterator<[string, FileSystemHandle]>;
keys(): AsyncIterableIterator<string>;
values(): AsyncIterableIterator<FileSystemHandle>;
[Symbol.asyncIterator](): FileSystemDirectoryHandleAsyncIterator<[string, FileSystemHandle]>;
entries(): FileSystemDirectoryHandleAsyncIterator<[string, FileSystemHandle]>;
keys(): FileSystemDirectoryHandleAsyncIterator<string>;
values(): FileSystemDirectoryHandleAsyncIterator<FileSystemHandle>;
}

interface ReadableStreamAsyncIterator<T> extends AsyncIteratorObject<T, BuiltinIteratorReturn, unknown> {
[Symbol.asyncIterator](): ReadableStreamAsyncIterator<T>;
}

interface ReadableStream<R = any> {
[Symbol.asyncIterator](options?: ReadableStreamIteratorOptions): AsyncIterableIterator<R>;
values(options?: ReadableStreamIteratorOptions): AsyncIterableIterator<R>;
[Symbol.asyncIterator](options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator<R>;
values(options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator<R>;
}
Loading

0 comments on commit 25c4eef

Please sign in to comment.