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.