Skip to content

Conversation

@gabrieldonadel
Copy link
Collaborator

Summary

This PR extracts the codegen translateFunctionTypeAnnotation Flow and TypeScript functions into a single common function in the parsers-primitives.js file that can be used by both parsers as requested on #34872.

Changelog

[Internal] [Changed] - Extract codegen translateFunctionTypeAnnotation into a common function in the parsers-primitives.js file

Test Plan

Run yarn jest react-native-codegen and ensure CI is green

image

@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 Nov 3, 2022
@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 6,992,208 +0
android hermes armeabi-v7a 6,368,750 +0
android hermes x86 7,404,900 +0
android hermes x86_64 7,268,908 +0
android jsc arm64-v8a 8,856,021 +0
android jsc armeabi-v7a 7,594,539 +0
android jsc x86 8,913,766 +0
android jsc x86_64 9,397,123 +0

Base commit: 46de03a
Branch: main

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: 46de03a
Branch: main

@pull-bot
Copy link

pull-bot commented Nov 3, 2022

PR build artifact for ff7c875 is ready.
To use, download tarball from "Artifacts" tab in this CircleCI job then run yarn add <path to tarball> in your React Native project.

@facebook-github-bot
Copy link
Contributor

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

}

function getTypeAnnotationParameters(
typeAnnotation: $FlowFixMe,
Copy link
Contributor

Choose a reason for hiding this comment

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

@gabrieldonadel The amount of $FlowFixMes increased quite a bit after the refactoring, is it something that could be avoided?..

Copy link
Collaborator Author

@gabrieldonadel gabrieldonadel Nov 4, 2022

Choose a reason for hiding this comment

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

That's because FunctionTypeAnnotation is still not typed yet and as most of these functions use some property of it and I'm not sure how to type it. There are two TODOs tho, of which I'm not 100% aware of the details, TODO(T71778680) and TODO(T108222691)

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @gabrieldonadel in 62244d4.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label Nov 7, 2022
@gabrieldonadel gabrieldonadel deleted the chore/extract-translateFunctionTypeAnnotation-into-common-function branch November 7, 2022 14:43
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
…function (facebook#35182)

Summary:
This PR extracts the codegen `translateFunctionTypeAnnotation` Flow and TypeScript functions into a single common function in the `parsers-primitives.js` file that can be used by both parsers as requested on facebook#34872.

## Changelog

[Internal] [Changed] -  Extract codegen `translateFunctionTypeAnnotation` into a common function in the` parsers-primitives.js` file

Pull Request resolved: facebook#35182

Test Plan:
Run `yarn jest react-native-codegen` and ensure CI is green

![image](https://user-images.githubusercontent.com/11707729/199625849-e89b647f-63fb-40f8-b643-a59dedb4c59a.png)

Reviewed By: cortinico

Differential Revision: D41030544

Pulled By: rshest

fbshipit-source-id: bc93c21e31ed4e8c3293cafe3d808d9f36cf8ecc
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.

6 participants