Is it possible to use ES6 in a Chrome Extension?

Update This answer was originally written in 2015. The compatibility table link shows Chrome, FF, Edge, and Safari are more compatible than Babel now. Chrome 49+, FF 45+ may not benefit from Babel. Other browsers, may need transpiling. Original I am also currently developing a Chrome Extension in ES6. Your questions seems to be more … Read more

What is extended mode?

It looks like “extended mode” was removed from the current development version of the harmony spec on February 27, 2012, but there’s a description of what it was supposed to be in a few older ones (this one is from January 16, 2012): 10.1.2 Extended Code Extended code is any code contained in an ECMAScript … Read more

progress notifications in ECMAScript Promise

ES2015 promises will never have progression. Promises represent a singular eventual value. If you want multiple values you can look into observables – or put the progress on the promise returning function. Putting the progress on the promise returning function is pretty easy. Basically you take a callback as a parameter to the function and … Read more

What are the actual uses of ES6 Raw String Access?

The best, and very nearly only, use case for String.raw I can think of is if you’re trying to use something like Steven Levithan’s XRegExp library that accepts text with significant backslashes. Using String.raw lets you write something semantically clear rather than having to think in terms of doubling your backslashes, just like you can … Read more

es6 multiline template strings with no new lines and allow indents

Two answers for this problem, but only one may be considered optimal. Inside template literals, javascript can be used inside of expressions like ${}. Its therefore possible to have indented multiline template literals such as the following. The caveat is some valid js character or value must be present in the expression, such as an … Read more

How does this object method definition work without the “function” keyword?

How is it possible that this runs at all in any browser? Is is some sort of new ES6 functionality? Yes. … Method definitions A property of an object can also refer to a function or a getter or setter method. var o = { property: function ([parameters]) {}, get property() {}, set property(value) {}, … Read more

How to overload constructors in JavaScript ECMA6? [duplicate]

There is no in-built solution for this in JavaScript. An alternative solution can be using the arguments object (in some cases), or passing your own configuration options, similar to this: const defaults = { numberWheels: 4, color: “black”, name: “myCar” } class Car { constructor(options) { this.wheelsNum = options.numberWheels || defaults.numberWheels; this.name = options.name || … Read more

ES7 Getting result from an array of promises using await generator

As mentioned in the issue you filed, the core issue is that await* is no longer a thing and has been removed. Unfortunately, it was not properly throwing a syntax error in Babel 6 and was essentially being treated like a normal await. You’ll need to explicitly let [p1, p2] = await Promise.all([ System.import(‘./package1.js’), System.import(‘./package2.js’)]);

import class and call static method with es6 modules with babel transpiler

You have two options: Export EmberReflux like you are doing: export { EmberReflux }; and then import it like: import { EmberReflux } from ‘../utils/ember-reflux’; Use default when exporting: export default EmberReflux; and import it (like you are doing): import EmberReflux from ‘../utils/ember-reflux’; In both cases you can then use your EmberReflux like: EmberReflux.createActions();