Skip to content
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

Ensure equivalent Flow and TypeScript turbo module definition generates the same output #34620

Closed
wants to merge 2 commits into from

Conversation

ZihanChen-MSFT
Copy link
Contributor

Summary

Pull request #34251 only partially worked because I didn't notice that there is 1 after the snapshot name. In this change I fixed the issue and find out there is one case that Flow and TypeScript parser generate different result.

It is expected since the test inputs are different. TypeScript removes one member because there is no {...X, ...} type in TypeScript. We could make the codegen support intersection type and rewrite it to X & {...}, but this will not be included here anyway.

Changelog

[General] [Changed] - codegen: ensure equivalent Flow and TypeScript TM definition generates the same output

Test Plan

yarn jest passed in packages/react-native-codegen

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Sep 7, 2022
@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.

@cipolleschi cipolleschi closed this Sep 8, 2022
@cipolleschi cipolleschi reopened this Sep 8, 2022
@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,637,462 -773
android hermes armeabi-v7a 7,049,634 -869
android hermes x86 7,939,086 -746
android hermes x86_64 7,911,078 -761
android jsc arm64-v8a 9,513,148 +912
android jsc armeabi-v7a 8,288,664 +808
android jsc x86 9,452,528 +961
android jsc x86_64 10,043,683 +1,052

Base commit: 62f83a9
Branch: main

@analysis-bot
Copy link

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

Base commit: 62f83a9
Branch: main

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @ZihanChen-MSFT in 737ce36.

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 Sep 9, 2022
@ZihanChen-MSFT ZihanChen-MSFT deleted the ts-rncodegen6 branch September 9, 2022 21:44
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
…es the same output (facebook#34620)

Summary:
Pull request facebook#34251 only partially worked because I didn't notice that there is ` 1` after the snapshot name. In this change I fixed the issue and find out there is one case that Flow and TypeScript parser generate different result.

It is expected since the test inputs are different. TypeScript removes one member because there is no `{...X, ...}` type in TypeScript. We could make the codegen support intersection type and rewrite it to `X & {...}`, but this will not be included here anyway.

## Changelog

[General] [Changed] - codegen: ensure equivalent Flow and TypeScript TM definition generates the same output

Pull Request resolved: facebook#34620

Test Plan: `yarn jest` passed in `packages/react-native-codegen`

Reviewed By: NickGerleman

Differential Revision: D39321965

Pulled By: cipolleschi

fbshipit-source-id: aec60f5c9c18323cbd833bf5705af544d7db2e73
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. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants