TypeScript 2.0 and The Future of Declaration Files msdn (June, 2016)
Paraphrased from How to Import Intellisense files into vsCode (Visual Studio Code):
- The tsd.d.ts file (which is created and updated after running tsd ‘installs’ at the command line) contains references to all of your .tsd files.
- So, to access all of your project’s tsd files in any of the project’s .ts files, all you need to do is reference the following path at the top of the .ts file
/// <reference path="typings/tsd.d.ts" />
- TypeScript Deep Dive recommended by Yakov Fain, march, 2016
- Handbook and wiki
- wintellect.com – typescript links
- Writing angular2 in typescript by Victor Savkin
- Announcing TypeScript 1.5 Jonathan Turner [MS] 7/20/2015
- Using TypeScript in Visual Studio Code – Jonathan Turner [MS] 4/30/2015
- tsd commands
- DefinitelyTyped repo
- Dan Wahlin – Getting Started with TypeScript – Classes, Types and Interfaces 3/8/2015
- Dan Wahlin – Extending Classes and Interfaces using TypeScript 4/10/2015
- Dan Wahlin – The Role of Interfaces in TypeScript 4/10/2015
- John Pappa – TypeScript Grammar – Part 2 1/1/2013Simplifying SPAs with ASP.NET MVC Partial Views (& TypeScript)
- Jonathan Turner – Using TypeScript in Visual Studio Code 4/30/2015 – Good comments in this blog post.
From the traceur wiki:
Per answer to my stackoverflow question (9.1.2015), Traceur is still needed by angular2 – even if one uses TypeScript to create ES5 code.
“Whenever you transpile ES6+ code that uses ES6 modules to ES5, you have to decide for a module system that works in ES5. That can be CommonJS, AMD, SystemJS, UMD. …Even if TypeScript is going to be a superset of ES6 and implement ES6 modules, as soon as you transpile your code, you need to use a module system that the browser understands today. …Unfortunately, there’s no spec that defines how modules are loaded anymore. So yes, you’d still need to use something like SystemJS to load modules in ES5.”
let, const, and var
…I want to identify what some folks are considering the new standard for declaring variables in ES6. The basic idea here is that let should, in time, replace var as the default declaration keyword. In fact, according to some, var should simply not be used at all in new code. The const keyword should be used for any variable where the reference should never be changed, and let for anything else. …const follows the same new scoping rules as
- var creates a variable scoped within its nearest parent function.
- let scopes the variable to the nearest block, this includes for loops, if statements, and others.
- const represents a constant reference to a value (the same is true in most languages, in fact). In other words, the pointer that the variable name is using cannot change in memory, but the thing the variable points to might change.
The book Exploring es6 has a chapter on modules
One can see immediately that
let may be theoretically unnecessary, but in practice make the functions we write simpler, and therefore easier to read and write.
const does not make functions simpler than
let, but does provide a kind of annotation that saves us some effort when examining a function. It is not nearly as useful as immutable data, because the problem it solves is easy, not hard.
Microsoft has a tsconfig.json wiki From the wiki:
- The presence of a
tsconfig.jsonfile in a directory indicates that the directory is the root of a TypeScript project.
- If no “files” property is present in the tsconfig.json file, the compiler defaults to including all fiels in the containing directory and sub-directories. When a “files” property is specified, only those files are included.
tsconfig.jsonfile specifies the root files and the compiler options required to compile the project. Note that if/when input files are specified on the command line,
tsconfig.jsonfiles are ignored.
to my 5 Minute QuickStart app’s tsconfig.json file and seeing it work correctly, I closed the folder. The next day I reopened it in VS Code and the the transpiler ignored the experimentalDecorators key/value pair – the MyAppComponent class had a red squiggly under it.
I removed and then re-added “experimentalDecorators”: true, back to the “compilerOptions” array of key/value pairs and the transpiler seemed to see it again as the build worked after that.
From the Microsoft wiki:
- If no “files” property is present in a tsconfig.json, the compiler defaults to including all files in the containing directory and subdirectories.
- When a “files” property is specified, only those files are included.