-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Can __export emitter be controlled by emitEmitHelpers compile option? #10905
Comments
This in the "too hard" bucket? :) |
|
@kitsonk Right... All the other helpers are controlled by that option, except for |
@rbuckton what's the intended behavior of the flag vs __export ? |
We could elevate it to be a real, i.e. check if there is an override, do not emit it with one thing to note this will be a breaking change for users with A PR would be appreciated. you will need to change the helper itself to not be based on closure, emit it at the top along with other helpers, and make sure it is only emitted when needed, and add a check to the make sure that external helper libraries implement it (using |
The We could consider adding an var __export = (this && this.__export) || function (exports, m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
} And change all call sites to pass in the @meenie Another option is to add a custom lab transform for the
|
@rbuckton That's what I ended up doing :). This should still be addressed, though. I assume it's affecting other people. |
@rbuckton Yes, but I was not referring to the existing // @module: amd
// @importHelpers: true
export * from "A";
export * from "B"; Output: define(["require", "exports", "tslib", "A", "B"], function (require, exports, tslib_1, A_1, B_1) {
"use strict";
tslib_1.__export(A_1, exports);
tslib_1.__export(B_1, exports);
}); See also related comments in PR 9097 |
It doesn't seem like anyone has really needed this, and AMD emit is quite rare anymore. |
I'm trying to achieve 100% code coverage and the function:
is added in every file that does something like
export * from './blah'
.Can that code be controlled by the
compilerOptions.emitEmitHelpers
flag? Then it can be added to https://github.com/ngParty/ts-helpers and code coverage can go to 100% :).I'm using https://github.com/hapijs/lab and it reports this:
![image](https://cloud.githubusercontent.com/assets/1126819/18492595/f1d5ae30-79c0-11e6-9a75-a5b4bc0ab116.png)
The text was updated successfully, but these errors were encountered: