Skip to content
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

Merged
merged 1 commit into from Jul 7, 2019
Merged

fix: babel 7.5, fixes #1292 #1293

merged 1 commit into from Jul 7, 2019

Conversation

theKashey
Copy link
Collaborator

@codecov-io
Copy link

codecov-io commented Jul 7, 2019

Codecov Report

Merging #1293 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           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
Impacted Files Coverage Δ
src/babel.dev.js 95.69% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4112e83...4441d6d. Read the comment docs.

@pieh
Copy link

pieh commented Jul 7, 2019

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!

@qiqiboy
Copy link

qiqiboy commented Jul 7, 2019

👍 Fix #1292

Copy link

@nicolo-ribaudo nicolo-ribaudo left a 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.

@nicolo-ribaudo
Copy link

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 react-hot-loader versions.

@pieh
Copy link

pieh commented Jul 7, 2019

Huge thanks @nicolo-ribaudo and @theKashey for fast turnaround on this ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants