Comment made by: filipematossilva
There are ways of generating ES5 constructors that behave has ES2015 classes, complete with extension. A good example is what TypeScript does.
This original code:
`
class A {
constructor(x) {
this.x = x;
}
}
class B extends A {
constructor(foo) {
super(foo);
}
}
const b = new B("bar")
`
Is transpiled to:
`
var extends = (this && this.extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var A = /* @class / (function () {
function A(x) {
this.x = x;
}
return A;
}());
var B = /* @class / (function (_super) {
__extends(B, _super);
function B(foo) {
return _super.call(this, foo) || this;
}
return B;
}(A));
var b = new B("bar");
`
Where {{__extends}} is a helper generated by TS, and can be either inlined or imported from a helper library called {{tslib}}.
So it doesn't seem like a way to make ES2015 classes from inside CLJS is absolutely necessary.