Skip to content

Conversation

@youedd
Copy link
Contributor

@youedd youedd commented Oct 9, 2022

Summary

Part of #34872

This PR:

  • extracts the content of the case 'NumberTypeAnnotation' (Flow, TypeScript) into a single emitNumber function in the parsers-primitives.js file, and uses the new function in the parsers
  • unit tests emitNumber function

Changelog

[Internal] [Changed] - Extract contents of the case 'NumberTypeAnnotation' into a single emitNumber function

Test Plan

yarn jest react-native-codegen

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

analysis-bot commented Oct 9, 2022

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,747,611 +0
android hermes armeabi-v7a 7,149,395 +0
android hermes x86 8,058,588 +0
android hermes x86_64 8,029,524 +0
android jsc arm64-v8a 9,608,518 +0
android jsc armeabi-v7a 8,373,768 +0
android jsc x86 9,555,784 +0
android jsc x86_64 10,148,324 +0

Base commit: db8c11d
Branch: main

@analysis-bot
Copy link

analysis-bot commented Oct 9, 2022

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

Base commit: db8c11d
Branch: main

Copy link
Contributor

@rshest rshest left a comment

Choose a reason for hiding this comment

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

Great, thanks for this change!!! Would it be possible to rename parser-primitives-test.js into parsers-primitives-test.js, so that's it is consistent with the corresponding name of the file under test (parsers-primitives.js)? Thanks!

@youedd youedd requested a review from rshest October 9, 2022 18:33
@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.

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

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @youedd in 54fc62c.

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

Summary:
Part of facebook#34872

This PR:
- extracts the content of the case 'NumberTypeAnnotation' ([Flow](https://github.com/facebook/react-native/blob/b444f0e44e0d8670139acea5f14c2de32c5e2ddc/packages/react-native-codegen/src/parsers/flow/modules/index.js#L370-L372), [TypeScript](https://github.com/facebook/react-native/blob/00b795642a6562fb52d6df12e367b84674994623/packages/react-native-codegen/src/parsers/typescript/modules/index.js#L405-L407)) into a single emitNumber function in the parsers-primitives.js file, and uses the new function in the parsers
- unit tests emitNumber function

## Changelog

[Internal] [Changed] - Extract contents of the case 'NumberTypeAnnotation' into a single emitNumber function

Pull Request resolved: facebook#34908

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

<img width="935" alt="image" src="https://user-images.githubusercontent.com/19575877/194764122-44975a97-3acd-4f27-babe-ddcd58c3ec61.png">

Reviewed By: cipolleschi

Differential Revision: D40214542

Pulled By: cipolleschi

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