Rename typeParameters to typeArguments for call expression alike#17020
Rename typeParameters to typeArguments for call expression alike#17020JLHwung merged 5 commits intobabel:mainfrom
typeParameters to typeArguments for call expression alike#17020Conversation
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/58486 |
| validate: assertNodeType("TemplateLiteral"), | ||
| }, | ||
| typeParameters: { | ||
| [process.env.BABEL_8_BREAKING ? "typeArguments" : "typeParameters"]: { |
There was a problem hiding this comment.
Although this change also affect the flow AST, it does not have practical impact for flow codemod, because Flow does not support type arguments in TaggedTemplateExpression yet, e.g. foo<bar>`q`.
| }, | ||
| attributes: validateArrayOfType("JSXAttribute", "JSXSpreadAttribute"), | ||
| typeParameters: { | ||
| [process.env.BABEL_8_BREAKING ? "typeArguments" : "typeParameters"]: { |
There was a problem hiding this comment.
This change also aligns to the Flow AST (playground link).
There was a problem hiding this comment.
Here we changed the JSX Flow AST but none of Flow tests are broken. I suspect we don't have test coverage here or we actually do not support transform-flow with syntax-jsx. I will investigate this issue later.
There was a problem hiding this comment.
I assume that nobody noticed because the JSX transform is going to drop the types anyway when converting.
There was a problem hiding this comment.
Alright, so the flow AST change here actually breaks nobody because Babel parser does not support <Foo<T>></Foo> yet when both Flow and JSX plugins are enabled: (REPL), this is a bug and I'd better fix it in another PR.
|
The test262 failure is very confusing. From the REPL build of this PR, the transpiled output of https://github.com/tc39/test262/blob/main/test/language/expressions/assignment/S11.13.1_A7_T4.js is not changed when compared with the I suspect it is an old V8 optimizer bug and I will rebase the working branch just to trigger the full test262 tests again. |
d08a88b to
c2731bb
Compare
|
It seems like re-running worker |
For CallExpression, JSXOpeningElement, NewExpression, OptionalCallExpression and TSInstantiationExpression
Co-authored-by: Nicolò Ribaudo <[email protected]>
ec291e8 to
9c0c0b1
Compare
|
Added the docs for this change, please also take a look. If the docs looks good, this PR can be merged. |
In this PR we rename for
typeParameterstotypeArgumentsfor the following call expression alike expressions: CallExpression, JSXOpeningElement, NewExpression, OptionalCallExpression and TSInstantiationExpression.