Skip to content

Conversation

@tarunrajput
Copy link
Contributor

Summary

Part of Codegen Issue #34872

[Codegen 88] Move the Visitor.js file from parsers/flow/Visitor.js to parser-promitives.js. Copy the TSInterfaceDeclaration(node: $FlowFixMe) function and add it to the Visitor.js just copied. Remove the parsers/typescript/Visitor.js. Make sure we use the same Visitor in both parsers. (We will end up with a Visitor that is the union of the two, being able to handle both Flow and TS. In this specific case, this trade-off make sense as it allows us to remove one file, several duplicated lines for a small price.)

Changelog

[Internal][Changed] - Extract Visitor function to parsers primitives and remove both parsers visitor files

Test Plan

yarn jest
yarn flow
yarn lint
yarn format-check

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 13, 2023
@tarunrajput tarunrajput changed the title refactor(codegen): extract Visitor to parsers primitives [Codegen 88] extract Visitor to parsers primitives Mar 13, 2023
@analysis-bot
Copy link

analysis-bot commented Mar 13, 2023

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,517,289 +0
android hermes armeabi-v7a 7,833,334 +0
android hermes x86 8,997,657 +0
android hermes x86_64 8,852,646 +0
android jsc arm64-v8a 9,141,130 +0
android jsc armeabi-v7a 8,333,010 +0
android jsc x86 9,195,927 +0
android jsc x86_64 9,453,756 +0

Base commit: 57a2508
Branch: main

@facebook-github-bot
Copy link
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Copy link
Contributor

@cipolleschi cipolleschi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing job, as always! :D

@cipolleschi
Copy link
Contributor

@tarunrajput could I just ask you to rebase on top of main? We should have fixed the issues in CI.

@tarunrajput
Copy link
Contributor Author

/rebase

@github-actions github-actions bot force-pushed the refactor/extract-visitor branch from 24d57de to 5fc1eae Compare March 13, 2023 14:19
@facebook-github-bot
Copy link
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@tarunrajput
Copy link
Contributor Author

/rebase

@github-actions github-actions bot force-pushed the refactor/extract-visitor branch from 5fc1eae to 12f0aec Compare March 15, 2023 06:11
@facebook-github-bot
Copy link
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Mar 15, 2023
@facebook-github-bot
Copy link
Contributor

@cipolleschi merged this pull request in d9f2cbe.

OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
Summary:
Part of Codegen Issue facebook#34872
> [Codegen 88] Move the Visitor.js file from parsers/flow/Visitor.js to parser-promitives.js. Copy the TSInterfaceDeclaration(node: $FlowFixMe) function and add it to the Visitor.js just copied. Remove the parsers/typescript/Visitor.js. Make sure we use the same Visitor in both parsers. (We will end up with a Visitor that is the union of the two, being able to handle both Flow and TS. In this specific case, this trade-off make sense as it allows us to remove one file, several duplicated lines for a small price.)

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[Internal][Changed] - Extract Visitor function to parsers primitives and remove both parsers visitor files

Pull Request resolved: facebook#36459

Test Plan:
```
yarn jest
yarn flow
yarn lint
yarn format-check
```

Reviewed By: cortinico

Differential Revision: D44021825

Pulled By: cipolleschi

fbshipit-source-id: ea465404830402c44081143ee0539107dc75776c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants