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
Fixed a regression for multiple __self & __source props with classic runtime #12475
Conversation
22d3387
to
f0c4432
Compare
|
||
for (const attr of attribs) { | ||
const name = | ||
t.isJSXAttribute(attr) && | ||
t.isJSXIdentifier(attr.name) && | ||
attr.name.name; | ||
|
||
if (name === "__source" || name === "__self") { |
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 is part of the code that will be removed in Babel 8 anyway, so I didn't have to provide any extra TODO comments or anything here
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.
I'm not sure I follow: why would this be removed? I think we'll keep the classic runtime, and just make the automatic one the default.
@Andarist explained me on Slack that this is for the !useSpread
case, that we are removing.
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.
Yeah - this is just in the compat path that handles useSpread
and useBuiltIns
options. It's OK to still throw this error when one uses automatic runtime.
packages/babel-helper-builder-react-jsx-experimental/src/index.js
Outdated
Show resolved
Hide resolved
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/34618/ |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit fce9a05:
|
f0c4432
to
93ca1be
Compare
93ca1be
to
da01efe
Compare
@@ -1,4 +1,5 @@ | |||
{ | |||
"skip": true, |
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.
If this doesn't work (I have never seen this used before), you'll need to rename the folder to .classic-runtime-with-source-self-plugins-windows
(with .
) instead.
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.
Actually, instead of disabling this test we could remove ...props
from the fixture input, and make it only throw in Babel 8?
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.
It didn't was worth trying!
2ff309a
to
3b0d4c1
Compare
The CI is failing but it doesn't seem to be related 🤔 |
Yeah, also other PRs are failing with a 500 error today. |
This most likely fixes the regression reported here: #12253 (comment) . The old dev transforms did not have a problem with inserting those props multiple times - there is no detection for this in example here:
babel/packages/babel-plugin-transform-react-jsx-self/src/index.js
Line 27 in 4f3fcf1