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: babel 7.5, fixes #1292 #1293
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1293 +/- ##
=======================================
Coverage 79.01% 79.01%
=======================================
Files 39 39
Lines 1625 1625
Branches 416 416
=======================================
Hits 1284 1284
Misses 277 277
Partials 64 64
Continue to review full report at Codecov.
|
I have absolutely no context on change, but will just share how this change impacts reproduction I use: Here's input file: https://github.com/gatsbyjs/gatsby/blob/master/examples/using-typescript/src/layouts/index.tsx And here's how applying change from this PR makes impact on output: https://www.diffchecker.com/wya2XyXe And it fixes this particular test case at least. Thanks for quick PR during the weekend! |
👍 Fix #1292 |
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.
(Babel team member here)
This PR is correct.
I'm sorry if v7.5 of @babel/plugin-transform-typescript
broke compatibility with this plugin, but the only way of implementing many features in Babel is by assuming that the scope information is correct. I think that this missing registerDeclaration
plugin never caused issues because the only transformation that ever happened to that const _default
declaration was to transform it to var
, and that plugin had been designed not to fail in case of missing bindings in the scope.
I'm working on a fix on Babel side not to rely on scope information. I think that this PR should be merged anyway isnce it does the correct thing, but at least we won't break compatibility with older |
Huge thanks @nicolo-ribaudo and @theKashey for fast turnaround on this ❤️ |
Related:
I actually have to idea what this "fix" is fixing, but...