Skip to content

Commit d0d4937

Browse files
author
Orta
authored
Merge pull request microsoft#1108 from microsoft/a11y
Accessibility fixes
2 parents f33219a + ccc7443 commit d0d4937

21 files changed

+180
-182
lines changed

pages/release notes/TypeScript 1.1.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Performance Improvements
1+
## Performance Improvements
22

33
The 1.1 compiler is typically around 4x faster than any previous release. See [this blog post for some impressive charts.](http://blogs.msdn.com/b/typescript/archive/2014/10/06/announcing-typescript-1-1-ctp.aspx)
44

5-
# Better Module Visibility Rules
5+
## Better Module Visibility Rules
66

77
TypeScript now only strictly enforces the visibility of types in modules if the `--declaration` flag is provided. This is very useful for Angular scenarios, for example:
88

@@ -18,4 +18,4 @@ module MyControllers {
1818
/* more code */
1919
}
2020
}
21-
```
21+
```

pages/release notes/TypeScript 1.3.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Protected
1+
## Protected
22

33
The new `protected` modifier in classes works like it does in familiar languages like C++, C#, and Java. A `protected` member of a class is visible only inside subclasses of the class in which it is declared:
44

@@ -17,7 +17,7 @@ var t = new MyThing();
1717
t.doSomething(); // Error, cannot call protected member from outside class
1818
```
1919

20-
# Tuple types
20+
## Tuple types
2121

2222
Tuple types express an array where the type of certain elements is known, but need not be the same. For example, you may want to represent an array with a `string` at position 0 and a `number` at position 1:
2323

@@ -43,4 +43,4 @@ Note that in TypeScript 1.4, when accessing an element outside the set of known
4343
x[3] = 'world'; // OK
4444
console.log(x[5].toString()); // OK, 'string' and 'number' both have toString
4545
x[6] = true; // Error, boolean isn't number or string
46-
```
46+
```

pages/release notes/TypeScript 1.4.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Union types
1+
## Union types
22

33
### Overview
44

@@ -79,7 +79,7 @@ x[0] = 'world'; // OK
7979
x[0] = false; // Error, boolean is not string or number
8080
```
8181

82-
# `let` declarations
82+
## `let` declarations
8383

8484
In JavaScript, `var` declarations are "hoisted" to the top of their enclosing scope. This can result in confusing bugs:
8585

@@ -103,7 +103,7 @@ else {
103103

104104
`let` is only available when targeting ECMAScript 6 (`--target ES6`).
105105

106-
# `const` declarations
106+
## `const` declarations
107107

108108
The other new ES6 declaration type supported in TypeScript is `const`. A `const` variable may not be assigned to, and must be initialized where it is declared. This is useful for declarations where you don't want to change the value after its initialization:
109109

@@ -114,7 +114,7 @@ halfPi = 2; // Error, can't assign to a `const`
114114

115115
`const` is only available when targeting ECMAScript 6 (`--target ES6`).
116116

117-
# Template strings
117+
## Template strings
118118

119119
TypeScript now supports ES6 template strings. These are an easy way to embed arbitrary expressions in strings:
120120

@@ -130,7 +130,7 @@ var name = "TypeScript!";
130130
var greeting = "Hello, " + name + "! Your name has " + name.length + " characters";
131131
```
132132

133-
# Type Guards
133+
## Type Guards
134134

135135
A common pattern in JavaScript is to use `typeof` or `instanceof` to examine the type of an expression at runtime. TypeScript now understands these conditions and will change type inference accordingly when used in an `if` block.
136136

@@ -172,7 +172,7 @@ else {
172172
}
173173
```
174174

175-
# Type Aliases
175+
## Type Aliases
176176

177177
You can now define an *alias* for a type using the `type` keyword:
178178

@@ -185,7 +185,7 @@ type Callback = () => void;
185185

186186
Type aliases are exactly the same as their original types; they are simply alternative names.
187187

188-
# `const enum` (completely inlined enums)
188+
## `const enum` (completely inlined enums)
189189

190190
Enums are very useful, but some programs don't actually need the generated code and would benefit from simply inlining all instances of enum members with their numeric equivalents. The new `const enum` declaration works just like a regular `enum` for type safety, but erases completely at compile time.
191191

@@ -213,13 +213,13 @@ enum MyFlags {
213213
var b = MyFlags.Best; // emits var b = 7;
214214
```
215215

216-
# `-noEmitOnError` commandline option
216+
## `-noEmitOnError` commandline option
217217

218218
The default behavior for the TypeScript compiler is to still emit .js files if there were type errors (for example, an attempt to assign a `string` to a `number`). This can be undesirable on build servers or other scenarios where only output from a "clean" build is desired. The new flag `noEmitOnError` prevents the compiler from emitting .js code if there were any errors.
219219

220220
This is now the default for MSBuild projects; this allows MSBuild incremental build to work as expected, as outputs are only generated on clean builds.
221221

222-
# AMD Module names
222+
## AMD Module names
223223

224224
By default AMD modules are generated anonymous. This can lead to problems when other tools are used to process the resulting modules like a bundlers (e.g. `r.js`).
225225

pages/release notes/TypeScript 1.5.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ES6 Modules
1+
## ES6 Modules
22

33
TypeScript 1.5 supports ECMAScript 6 (ES6) modules.
44
ES6 modules are effectively TypeScript external modules with a new syntax: ES6 modules are separately loaded source files that possibly import other modules and provide a number of externally accessible exports.
@@ -78,7 +78,7 @@ import "./polyfills";
7878

7979
For more information about module, please see the [ES6 module support spec](https://github.com/Microsoft/TypeScript/issues/2242).
8080

81-
# Destructuring in declarations and assignments
81+
## Destructuring in declarations and assignments
8282

8383
TypeScript 1.5 adds support to ES6 destructuring declarations and assignments.
8484

@@ -121,7 +121,7 @@ var y = 2;
121121
[x, y] = [y, x];
122122
```
123123

124-
# `namespace` keyword
124+
## `namespace` keyword
125125

126126
TypeScript used the `module` keyword to define both "internal modules" and "external modules";
127127
this has been a bit of confusion for developers new to TypeScript.
@@ -145,7 +145,7 @@ namespace Math {
145145
}
146146
```
147147

148-
# `let` and `const` support
148+
## `let` and `const` support
149149

150150
ES6 `let` and `const` declarations are now supported when targeting ES3 and ES5.
151151

@@ -173,7 +173,7 @@ else {
173173
alert(a); // Error: a is not defined in this scope.
174174
```
175175

176-
# for..of support
176+
## for..of support
177177

178178
TypeScript 1.5 adds support to ES6 for..of loops on arrays for ES3/ES5 as well as full support for Iterator interfaces when targeting ES6.
179179

@@ -193,7 +193,7 @@ for (var _i = 0, _a = expr; _i < _a.length; _i++) {
193193
}
194194
```
195195

196-
# Decorators
196+
## Decorators
197197

198198
> TypeScript decorators are based on the [ES7 decorator proposal](https://github.com/wycats/javascript-decorators).
199199
@@ -229,7 +229,7 @@ function enumerable(value) {
229229
}
230230
```
231231

232-
# Computed properties
232+
## Computed properties
233233

234234
Initializing an object with dynamic properties can be a bit of a burden. Take the following example:
235235

@@ -258,7 +258,7 @@ function makeNode(name: string, initialNeighbor: Node): Node {
258258
}
259259
```
260260

261-
# Support for `UMD` and `System` module output
261+
## Support for `UMD` and `System` module output
262262

263263
In addition to `AMD` and `CommonJS` module loaders, TypeScript now supports emitting modules `UMD` ([Universal Module Definition](https://github.com/umdjs/umd)) and [`System`](https://github.com/systemjs/systemjs) module formats.
264264

@@ -269,7 +269,7 @@ and
269269

270270
> tsc --module system
271271
272-
# Unicode codepoint escapes in strings
272+
## Unicode codepoint escapes in strings
273273

274274
ES6 introduces escapes that allow users to represent a Unicode codepoint using just a single escape.
275275

@@ -281,7 +281,7 @@ This has the major downside that it’s difficult to discern two independent cha
281281
With ES6’s codepoint escapes, you can cleanly represent that exact character in strings and template strings with a single escape: `"\u{20bb7}"`.
282282
TypeScript will emit the string in ES3/ES5 as `"\uD842\uDFB7"`.
283283

284-
# Tagged template strings in ES3/ES5
284+
## Tagged template strings in ES3/ES5
285285

286286
In TypeScript 1.4, we added support for template strings for all targets, and tagged templates for just ES6.
287287
Thanks to some considerable work done by [@ivogabe](https://github.com/ivogabe), we bridged the gap for for tagged templates in ES3 and ES5.
@@ -308,7 +308,7 @@ function oddRawStrings(strs, n1, n2) {
308308
var _a;
309309
```
310310

311-
# AMD-dependency optional names
311+
## AMD-dependency optional names
312312

313313
`/// <amd-dependency path="x" />` informs the compiler about a non-TS module dependency that needs to be injected in the resulting module's require call;
314314
however, there was no way to consume this module in the TS code.
@@ -329,7 +329,7 @@ define(["require", "exports", "legacy/moduleA"], function (require, exports, mod
329329
});
330330
```
331331

332-
# Project support through `tsconfig.json`
332+
## Project support through `tsconfig.json`
333333

334334
Adding a `tsconfig.json` file in a directory indicates that the directory is the root of a TypeScript project.
335335
The tsconfig.json file specifies the root files and the compiler options required to compile the project. A project is compiled in one of the following ways:
@@ -351,7 +351,7 @@ The tsconfig.json file specifies the root files and the compiler options require
351351

352352
See the [tsconfig.json wiki page](https://github.com/Microsoft/TypeScript/wiki/tsconfig.json) for more details.
353353

354-
# `--rootDir` command line option
354+
## `--rootDir` command line option
355355

356356
Option `--outDir` duplicates the input hierarchy in the output.
357357
The compiler computes the root of the input files as the longest common path of all input files;
@@ -362,18 +362,18 @@ Now if a new file `FolderA\3.ts` is added to the input, the output structure wil
362362

363363
`--rootDir` specifies the input directory to be mirrored in output instead of computing it.
364364

365-
# `--noEmitHelpers` command line option
365+
## `--noEmitHelpers` command line option
366366

367367
The TypeSript compiler emits a few helpers like `__extends` when needed.
368368
The helpers are emitted in every file they are referenced in.
369369
If you want to consolidate all helpers in one place, or override the default behavior, use `--noEmitHelpers` to instructs the compiler not to emit them.
370370

371-
# `--newLine` command line option
371+
## `--newLine` command line option
372372

373373
By default the output new line character is `\r\n` on Windows based systems and `\n` on *nix based systems.
374374
`--newLine` command line flag allows overriding this behavior and specifying the new line character to be used in generated output files.
375375

376-
# `--inlineSourceMap` and `inlineSources` command line options
376+
## `--inlineSourceMap` and `inlineSources` command line options
377377

378378
`--inlineSourceMap` causes source map files to be written inline in the generated `.js` files instead of in a independent `.js.map` file.
379379
`--inlineSources` allows for additionally inlining the source `.ts` file into the `.js` file.

pages/release notes/TypeScript 1.6.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# JSX support
1+
## JSX support
22

33
JSX is an embeddable XML-like syntax.
44
It is meant to be transformed into valid JavaScript, but the semantics of that transformation are implementation-specific.
@@ -52,7 +52,7 @@ TypeScript ships with two JSX modes: `preserve` and `react`.
5252

5353
See the [[JSX]] wiki page for more information on using JSX in TypeScript.
5454

55-
# Intersection types
55+
## Intersection types
5656

5757
TypeScript 1.6 introduces intersection types, the logical complement of union types.
5858
A union type `A | B` represents an entity that is either of type `A` or type `B`, whereas an intersection type `A & B` represents an entity that is both of type `A` *and* type `B`.
@@ -105,7 +105,7 @@ abc.c = "hello";
105105

106106
See [issue #1256](https://github.com/Microsoft/TypeScript/issues/1256) for more information.
107107

108-
# Local type declarations
108+
## Local type declarations
109109

110110
Local class, interface, enum, and type alias declarations can now appear inside function declarations. Local types are block scoped, similar to variables declared with `let` and `const`. For example:
111111

@@ -165,7 +165,7 @@ function f3() {
165165
}
166166
```
167167

168-
# Class expressions
168+
## Class expressions
169169

170170
TypeScript 1.6 adds support for ES6 class expressions. In a class expression, the class name is optional and, if specified, is only in scope in the class expression itself. This is similar to the optional name of a function expression. It is not possible to refer to the class instance type of a class expression outside the class expression, but the type can of course be matched structurally. For example:
171171

@@ -180,7 +180,7 @@ var p = new Point(3, 4); // p has anonymous class type
180180
console.log(p.length());
181181
```
182182

183-
# Extending expressions
183+
## Extending expressions
184184

185185
TypeScript 1.6 adds support for classes extending arbitrary expression that computes a constructor function. This means that built-in types can now be extended in class declarations.
186186

@@ -223,7 +223,7 @@ class Test extends getGreeterBase() {
223223
}
224224
```
225225

226-
# `abstract` classes and methods
226+
## `abstract` classes and methods
227227

228228
TypeScript 1.6 adds support for `abstract` keyword for classes and their methods. An abstract class is allowed to have methods with no implementation, and cannot be constructed.
229229

@@ -253,7 +253,7 @@ y.getThing(); // OK
253253
y.getOtherThing(); // OK
254254
```
255255

256-
# Generic type aliases
256+
## Generic type aliases
257257

258258
With TypeScript 1.6, type aliases can be generic. For example:
259259

@@ -272,7 +272,7 @@ interface Tuple<A, B> {
272272
type Pair<T> = Tuple<T, T>;
273273
```
274274

275-
# Stricter object literal assignment checks
275+
## Stricter object literal assignment checks
276276

277277
TypeScript 1.6 enforces stricter object literal assignment checks for the purpose of catching excess or misspelled properties. Specifically, when a fresh object literal is assigned to a variable or passed as an argument for a non-empty target type, it is an error for the object literal to specify properties that don't exist in the target type.
278278

@@ -293,7 +293,7 @@ var x: { foo: number, [x: string]: any };
293293
x = { foo: 1, baz: 2 }; // Ok, `baz` matched by index signature
294294
```
295295

296-
# ES6 generators
296+
## ES6 generators
297297

298298
TypeScript 1.6 adds support for generators when targeting ES6.
299299

@@ -320,7 +320,7 @@ function *g() {
320320
}
321321
```
322322

323-
# Experimental support for `async` functions
323+
## Experimental support for `async` functions
324324

325325
TypeScript 1.6 introduces experimental support of `async` functions when targeting ES6.
326326
Async functions are expected to invoke an asynchronous operation and await its result without blocking normal execution of the program.
@@ -358,15 +358,15 @@ class C {
358358
}
359359
```
360360

361-
# Nightly builds
361+
## Nightly builds
362362

363363
While not strictly a language change, nightly builds are now available by installing with the following command:
364364

365365
```Shell
366366
npm install -g typescript@next
367367
```
368368

369-
# Adjustments in module resolution logic
369+
## Adjustments in module resolution logic
370370

371371
Starting from release 1.6 TypeScript compiler will use different set of rules to resolve module names when targeting 'commonjs'.
372372
These [rules](https://github.com/Microsoft/TypeScript/issues/2338) attempted to model module lookup procedure used by Node.
@@ -376,7 +376,7 @@ User however can override module resolution rules picked by the compiler by usin
376376
* 'classic' - module resolution rules used by pre 1.6 TypeScript compiler
377377
* 'node' - node-like module resolution
378378

379-
# Merging ambient class and interface declaration
379+
## Merging ambient class and interface declaration
380380

381381
The instance side of an ambient class declaration can be extended using an interface declaration The class constructor object is unmodified.
382382
For example:
@@ -396,7 +396,7 @@ function bar(foo : Foo) {
396396
}
397397
```
398398

399-
# User-defined type guard functions
399+
## User-defined type guard functions
400400

401401
TypeScript 1.6 adds a new way to narrow a variable type inside an `if` block, in addition to `typeof` and `instanceof`.
402402
A user-defined type guard functions is one with a return type annotation of the form `x is T`, where `x` is a declared parameter in the signature, and `T` is any type.
@@ -415,7 +415,7 @@ if(isCat(x)) {
415415
}
416416
```
417417

418-
# `exclude` property support in tsconfig.json
418+
## `exclude` property support in tsconfig.json
419419

420420
A tsconfig.json file that doesn't specify a files property (and therefore implicitly references all *.ts files in all subdirectories) can now contain an exclude property that specifies a list of files and/or directories to exclude from the compilation.
421421
The exclude property must be an array of strings that each specify a file or folder name relative to the location of the tsconfig.json file.
@@ -436,7 +436,7 @@ For example:
436436

437437
The `exclude` list does not support wilcards. It must simply be a list of files and/or directories.
438438

439-
# `--init` command line option
439+
## `--init` command line option
440440

441441
Run `tsc --init` in a directory to create an initial `tsconfig.json` in this directory with preset defaults.
442-
Optionally pass command line arguments along with `--init` to be stored in your initial tsconfig.json on creation.
442+
Optionally pass command line arguments along with `--init` to be stored in your initial tsconfig.json on creation.

0 commit comments

Comments
 (0)