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

Refactor codegen: Dispatch props and events from a central place. #34975

Closed
wants to merge 18 commits into from

Conversation

ZihanChen-MSFT
Copy link
Contributor

Summary

Refer to In component, props and events pick properties from the component interface by themselves independently, I would like to reverse the direction, to have a function dispatching properties to props and events, to reduce duplicated code. in #34872

Changelog

[General] [Changed] - Refactor codegen: Dispatch props and events from a central place.

Test Plan

yarn jest react-native-codegen passed

@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 Oct 13, 2022
@analysis-bot
Copy link

analysis-bot commented Oct 13, 2022

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,753,948 -847
android hermes armeabi-v7a 7,158,215 -852
android hermes x86 8,065,748 -853
android hermes x86_64 8,036,397 -856
android jsc arm64-v8a 9,612,853 -84
android jsc armeabi-v7a 8,379,000 -72
android jsc x86 9,559,878 -69
android jsc x86_64 10,152,760 -83

Base commit: e4b5d3e
Branch: main

@analysis-bot
Copy link

analysis-bot commented Oct 13, 2022

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

Base commit: e4b5d3e
Branch: main

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.

Hi, thank for taking this.
I left a couple of comments in the PR.

Plus, are you going to make the same changes for Flow?
I think we should strive to keep the two languages aligned, so it will be easier to create a common denominator to reduce the code duplication (as we are doing for the modules)

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.

I added some more comments/refactoring to improve typings and readability.

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.

Thanks for these simplifications. There are a couple of linting problems due to unused variables, but it is otherwise good.

Do you think we can do something similar for Flow as well, to keep the two aligned?

@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
Copy link
Contributor

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

@react-native-bot
Copy link
Collaborator

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

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 Oct 20, 2022
@ZihanChen-MSFT ZihanChen-MSFT deleted the ts-rncodegen12 branch November 14, 2022 21:54
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
…cebook#34975)

Summary:
Refer to `In component, props and events pick properties from the component interface by themselves independently, I would like to reverse the direction, to have a function dispatching properties to props and events, to reduce duplicated code.
` in facebook#34872

## Changelog

[General] [Changed] - Refactor codegen: Dispatch props and events from a central place.

Pull Request resolved: facebook#34975

Test Plan: `yarn jest react-native-codegen` passed

Reviewed By: cortinico

Differential Revision: D40507917

Pulled By: cipolleschi

fbshipit-source-id: 71988877008ae11a01affd31b34bb3a3b88f96be
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. hacktoberfest-accepted Merged This PR has been merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants