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
Handle exported functions in ExportDeclarations for CJS/AMD/UMD emit #58489
base: main
Are you sure you want to change the base?
Conversation
exports.default = foo; | ||
exports.bar = foo; | ||
exports.default = foo; | ||
exports.bar = foo; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This duplication doesn't feel too great. I probably missed something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed this via a Set.
exports.a = a; | ||
exports.b = b; | ||
exports.c = c; | ||
exports.d = d; | ||
exports.e = e; | ||
exports.f = f; | ||
exports.g = g; | ||
exports.h = hh; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example of this working, in the test case:
/**
* @param {{x: string}} a
* @param {{y: typeof b}} b
*/
function hh(a, b) {
return a.x && b.y();
}
export { hh as h };
@typescript-bot perf test this faster |
@jakebailey Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
Fixes #58473
Not 100% certain on this but the baselines look right. Feel free to make your own better fix for this, though; this was just my naive attempt.