-
Notifications
You must be signed in to change notification settings - Fork 25k
[Codegen 94] move extendsForProp into parsers-commons
#37052
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
Conversation
|
Hi @siddarthkay! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
a29ef09 to
e41085e
Compare
Base commit: c65ab4d |
|
@cipolleschi : This PR is ready for review. |
|
@rshest has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
cipolleschi
left a comment
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.
Hi @siddarthkay, thank you so much for taking the time to work on this!
I left some comments to improve the current implementation, following a pattern we have established in other Codegen tasks.
Let me know if it is clear and/or if you need help! :D
packages/react-native-codegen/src/parsers/typescript/components/props.js
Outdated
Show resolved
Hide resolved
packages/react-native-codegen/src/parsers/flow/components/extends.js
Outdated
Show resolved
Hide resolved
packages/react-native-codegen/src/parsers/flow/components/extends.js
Outdated
Show resolved
Hide resolved
9d48729 to
0b4455a
Compare
|
Hi @cipolleschi : I've addressed your feedback and I also took the liberty of removing Let me know :) |
|
@rshest has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
cipolleschi
left a comment
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.
Good! :D Thanks for the changes!
1af6089 to
301ac6d
Compare
ca8f170 to
40f63b1
Compare
|
Hi @cipolleschi : I've rebased my branch and resolved all conflicts, |
|
Hey @siddarthkay, sorry for back and forth, but this change severely conflicts with #36891, which has been now merged to master (it merges together Could you please rebase this PR to master and try and resolve the merge conflicts? Thanks!!! |
rshest
left a comment
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.
Please see my comment above, this requires a rebase to master and merge/resolve conflicts.
|
Hi @rshest : I think I already resolved those conflicts few hours ago, I have just now rebased to latest |
|
@rshest has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
I see Should I rerun this job on CircleCI : https://app.circleci.com/pipelines/github/facebook/react-native/22620/workflows/be7cfad0-d96d-4c5c-b552-5006294413ff/jobs/580151 ? |
|
@siddarthkay as the error says: PS. Reviewer(s) will re-rerun it if required. |
|
Hi @Pranav-yadav Thanks for explaining! |
| ): ExtendsForProp { | ||
| if (!prop.argument) { | ||
| const argument = parser.argumentForProp(prop); | ||
| if (argument) { |
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 now does exactly the opposite of what it used/supposed to do :)
It should instead be:
if (!argument) {
Otherwise this would break codegen completely, at least on our internal tests.
I am surprised, though, that CI on Github didn't catch this (the only failed test seems inside the app template and is unrelated).
I think we need a follow-up on that, CC @cipolleschi
@siddarthkay - note that I fixed this internally myself this time, to save one extra back and forth, but normally that would be your responsibility :)
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.
Thanks @rshest ! This is probably the outcome of resolving multiple rebase conflicts. Thanks for catching and fixing it ❤️
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 am surprised, though, that CI on Github didn't catch this (the only failed test seems inside the app template and is unrelated).
I think, those files don't have tests, but, other tests should have been failed; or may be the current test-suite doesn't test this specific case 🤔
Summary: [Codegen 94] This PR attempts to extracts the logic of `extendsForProp` function from the following locations : - `parsers/flow/components/extends.js` - `parsers/typescript/components/props.js` since they are the same and move the function to `parsers/parsers-commons.js` as requested on facebook#34872 ## Changelog: [Internal] [Changed] - Move `extendsForProp` to parser-commons and update usages. Pull Request resolved: facebook#37052 Test Plan: Run `yarn jest react-native-codegen` and ensure CI is green Reviewed By: cipolleschi Differential Revision: D45225880 Pulled By: rshest fbshipit-source-id: 45199089746d58d9e9494b28040b34c2a0eb31fe
Summary: [Codegen 94] This PR attempts to extracts the logic of `extendsForProp` function from the following locations : - `parsers/flow/components/extends.js` - `parsers/typescript/components/props.js` since they are the same and move the function to `parsers/parsers-commons.js` as requested on facebook#34872 ## Changelog: [Internal] [Changed] - Move `extendsForProp` to parser-commons and update usages. Pull Request resolved: facebook#37052 Test Plan: Run `yarn jest react-native-codegen` and ensure CI is green Reviewed By: cipolleschi Differential Revision: D45225880 Pulled By: rshest fbshipit-source-id: 45199089746d58d9e9494b28040b34c2a0eb31fe
Summary:
[Codegen 94] This PR attempts to extracts the logic of
extendsForPropfunction from the following locations :parsers/flow/components/extends.jsparsers/typescript/components/props.jssince they are the same and move the function to
parsers/parsers-commons.jsas requested on ☂️ Improving Codegen #34872Changelog:
[Internal] [Changed] - Move
extendsForPropto parser-commons and update usages.Test Plan:
Run
yarn jest react-native-codegenand ensure CI is green