[Codegen]: Extract getConfigType function to parsers/utils.js#35035
[Codegen]: Extract getConfigType function to parsers/utils.js#35035dhruvtailor7 wants to merge 3 commits into
getConfigType function to parsers/utils.js#35035Conversation
cipolleschi
left a comment
There was a problem hiding this comment.
Thank you a lot for doing this! 👏
I left a small nit/question, but it looks good to me!
|
|
||
| visit(ast, { | ||
| CallExpression(node) { | ||
| function Visitor(infoMap: {isComponent: boolean, isModule: boolean}) { |
There was a problem hiding this comment.
nit: the V is capital on purpose because this is a type? Or can we have it lowercase like all the other functions?
There was a problem hiding this comment.
Yes, I kept capital on purpose. Should i change it lowercase?
|
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Base commit: ff398e4 |
Base commit: ff398e4 |
|
PR build artifact for 336265b is ready. |
|
PR build artifact for 336265b is ready. |
cortinico
left a comment
There was a problem hiding this comment.
LGTM just left a minor comment
|
PR build artifact for 2f76ad4 is ready. |
|
PR build artifact for 2f76ad4 is ready. |
|
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary
This PR is part of #34872.
This PR contains two changes, extracting the visitor object and then factoring out the
getConfigType()function to theparsers/utils.jsfile. Then we can reuse the same function in both flow and typescript by passing the extracted visitor object.Changelog
[Internal] [Changed] - Extract visitor object in the same file and factor out
getConfigType()toparsers/utils.js.Test Plan
Output of
yarn jest react-native-codegenensures all passed test cases