Skip to content

Conversation

@AntoineDoubovetzky
Copy link

Summary

This PR is a task from #34872:

Extract the content of the case 'Promise' (Flow, TypeScript) into a single emitPromise function in the parsers-primitives.js file. Use the new function in the parsers.

Note that this PR should be merged after #34933

Changelog

[Internal] [Changed] - Extract contents of the case 'Promise' into a single emitPromise function inside parsers-primitives

Test Plan

I tested using jest and flow commands.

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

analysis-bot commented Oct 10, 2022

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

Base commit: f8996f1
Branch: main

@analysis-bot
Copy link

analysis-bot commented Oct 10, 2022

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,768,182 -30
android hermes armeabi-v7a 7,169,296 -39
android hermes x86 8,081,411 -42
android hermes x86_64 8,053,024 -35
android jsc arm64-v8a 9,629,382 -26
android jsc armeabi-v7a 8,393,808 -24
android jsc x86 9,578,801 -13
android jsc x86_64 10,171,894 -20

Base commit: 2f58e52
Branch: main

@rshest
Copy link
Contributor

rshest commented Oct 11, 2022

This PR is a bit confusing, tbh... the title says one thing, but the code does at least two other things?.. :)

@AntoineDoubovetzky
Copy link
Author

AntoineDoubovetzky commented Oct 11, 2022

@rshest This PR depends on #34933 that extracts assertGenericTypeAnnotationHasExactlyOneTypeParameter and that's why #34933 should be merged first and then we should rebase this PR.
About the title there was indeed a copy/paste error, I corrected.

@AntoineDoubovetzky AntoineDoubovetzky changed the title [Codegen] extract emitDouble from parsers modules to shared parsers-primitives [Codegen] extract emitPromise from parsers modules to shared parsers-primitives Oct 11, 2022
@AntoineDoubovetzky AntoineDoubovetzky force-pushed the refactor/extract-emitPromise-function branch from 6e2869c to 0ead64d Compare October 11, 2022 07:40
@rshest
Copy link
Contributor

rshest commented Oct 11, 2022

@AntoineDoubovetzky Ah, this makes sense, thanks for correcting the title!

@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.

@AntoineDoubovetzky AntoineDoubovetzky force-pushed the refactor/extract-emitPromise-function branch from 0ead64d to 1ce4c90 Compare October 11, 2022 10:40
@AntoineDoubovetzky
Copy link
Author

I rebased after adding a commit to #34933

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @AntoineDoubovetzky in 966f3cd.

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 11, 2022
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
…facebook#34935)

Summary:
This PR is a task from facebook#34872:
> Extract the content of the case 'Promise' ([Flow](https://github.com/facebook/react-native/blob/b444f0e44e0d8670139acea5f14c2de32c5e2ddc/packages/react-native-codegen/src/parsers/flow/modules/index.js#L90-L97), [TypeScript](https://github.com/facebook/react-native/blob/00b795642a6562fb52d6df12e367b84674994623/packages/react-native-codegen/src/parsers/typescript/modules/index.js#L197-L205)) into a single emitPromise function in the parsers-primitives.js file. Use the new function in the parsers.

Note that this PR should be merged after facebook#34933

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[Internal] [Changed] - Extract contents of the case 'Promise' into a single emitPromise function inside parsers-primitives

Pull Request resolved: facebook#34935

Test Plan: I tested using jest and flow commands.

Reviewed By: cipolleschi

Differential Revision: D40257033

Pulled By: cipolleschi

fbshipit-source-id: 0246f43c6b688629e2de1259e7f535c2cf6dd0a4
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