-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Fix #33569 - Enable declaration emit for late-bound function members #53034
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
Fix #33569 - Enable declaration emit for late-bound function members #53034
Conversation
@typescript-bot pack this |
Heya @weswigham, I've started to run the tarball bundle task on this PR at 022a8af. You can monitor the build here. |
Heya @weswigham, I've started to run the extended test suite on this PR at 022a8af. You can monitor the build here. |
Heya @weswigham, I've started to run the diff-based user code test suite on this PR at 022a8af. You can monitor the build here. Update: The results are in! |
Heya @weswigham, I've started to run the perf test suite on this PR at 022a8af. You can monitor the build here. Update: The results are in! |
Heya @weswigham, I've started to run the parallelized Definitely Typed test suite on this PR at 022a8af. You can monitor the build here. |
Hey @weswigham, I've packed this into an installable tgz. You can install it for testing by referencing it in your
and then running There is also a playground for this build and an npm module you can use via |
@weswigham Here are the results of running the user test suite comparing Everything looks good! |
@weswigham Here they are:
CompilerComparison Report - main..53034
System
Hosts
Scenarios
TSServerComparison Report - main..53034
System
Hosts
Scenarios
StartupComparison Report - main..53034
System
Hosts
Scenarios
Developer Information: |
if (merged === exported) { | ||
// We just mutated a symbol, reset any cached links we may have already set | ||
// (Notably required to make late bound members appear) | ||
getSymbolLinks(merged).resolvedExports = undefined; |
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.
There's no precedent for doing this as far as I can tell; is it likely this information has already been read once before and so some places will have stale info?
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.
There's also no other place where we mutate the .exports
of a transient symbol like we do on the lines above, so we just kinda have to. The alternative is what the prior PR does, which is attempt to guarantee an ordering of the operations, but that creates an unsolvable circular dependency that, when caught, breaks a bunch. So this is probably as good as it gets, since whatever stale-cache-data issues this introduces (which I don't think should be too much since we do this export= cjs merge pretty early) only applies to cjs assigned export= objects with late bound members merged into them, without affecting the validity of a bunch of code that already works.
@typescript-bot run dt |
Heya @weswigham, I've started to run the parallelized Definitely Typed test suite on this PR at 022a8af. You can monitor the build here. Update: The results are in! |
Hey @weswigham, it looks like the DT test run failed. Please check the log for more details. |
This is quite a bit simpler than the older fix rather than trying to make exports and cjs merges resolve in a predictable order (and handling the circularities involved), this just resets the export member cache when a cjs merge occurs (so the final resolved exports with both cjs merge members and late bound members gets recalculated). Hopefully the simpler fix should mean there's no crash in RWC/DT this time~
Fixes #33569