-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to specify the external __extends
function
#2009
Comments
I build
Then I found out, that this pull request was not merged to the
I use a single exports when creating a view models in Durandal. Here we need a more comprehensive solution of problem (similar to what I suggested). By the way, I noticed that even if the |
Ah, sorry about that, I also didn't notice we never merged that. There're apparently some additional cases that aren't handled by that PR yet. I logged #2022 for the ES6 part. |
Hi, the documentation says that "noEmitHelpers" flag is supported now, but using it with 1.5.0-Beta does not do anything? Is there any particular release I should be using? Thanks. |
This was added after 1.5-beta, so it should be in the next release 1.5.2 |
Thanks for the info! Any estimate on when it will be? |
we usually like to stabilize a release for a few weeks before it is released. We are not adding any more features just big fixes at the point. So hopefully soon. |
noEmitHelpers is working well for me, but I was curious if there was a pre-created Helpers File that would be easy for me to simply include in my project? |
@mikemorton there is not one, but here is what i would put: var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
}
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promise, generator) {
return new Promise(function (resolve, reject) {
generator = generator.call(thisArg, _arguments);
function cast(value) { return value instanceof Promise && value.constructor === Promise ? value : new Promise(function (resolve) { resolve(value); }); }
function onfulfill(value) { try { step("next", value); } catch (e) { reject(e); } }
function onreject(value) { try { step("throw", value); } catch (e) { reject(e); } }
function step(verb, value) {
var result = generator[verb](value);
result.done ? resolve(result.value) : cast(result.value).then(onfulfill, onreject);
}
step("next", void 0);
});
}; |
this is handled with the |
Currently when implementing of class inheritance in the output JS-file automatically added the following code:
And calls of the following kind:
In the presence of large amount of TS-files in the project, this leads to a significant increase size of concatenated file (especially when using AMD-modules).
It would be nice to add a new compiler option (it can be called
externalExtendsFunction
), which would be allow to specify the name of analog__extends
function from external script. For example, if we set to theexternalExtendsFunction
option a value equal toutil.extends
, then the__extends
function code will not be generated in the JS-file and its calls will be as follows:The text was updated successfully, but these errors were encountered: