Skip to content

chore: Extract codegen ModuleInterfaceNotFoundParserError in a separate function#34922

Closed
gabrieldonadel wants to merge 2 commits into
facebook:mainfrom
gabrieldonadel:chore/extract-interface-not-found-error
Closed

chore: Extract codegen ModuleInterfaceNotFoundParserError in a separate function#34922
gabrieldonadel wants to merge 2 commits into
facebook:mainfrom
gabrieldonadel:chore/extract-interface-not-found-error

Conversation

@gabrieldonadel
Copy link
Copy Markdown
Collaborator

Summary

This PR extracts the codegen ModuleInterfaceNotFoundParserError exception into a separate function inside error-utils.js so that it can be used by both Flow and Typescript parsers as requested on #34872. This also adds unit tests to the new throwIfModuleInterfaceNotFound function.

Changelog

[Internal] [Changed] - Extract codegen ModuleInterfaceNotFoundParserError in a separate function that can de used by Flow and TypeScript parsers

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 Oct 10, 2022
Copy link
Copy Markdown
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.

Amazing, thank you so much.
Can you update the test file? 🙏

Comment thread packages/react-native-codegen/src/parsers/__tests__/error-utils-test.js Outdated
Comment thread packages/react-native-codegen/src/parsers/flow/modules/index.js Outdated
Comment thread packages/react-native-codegen/src/parsers/typescript/modules/index.js Outdated
@analysis-bot
Copy link
Copy Markdown

analysis-bot commented Oct 10, 2022

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,768,287 +0
android hermes armeabi-v7a 7,169,380 +0
android hermes x86 8,081,549 +0
android hermes x86_64 8,053,115 +0
android jsc arm64-v8a 9,629,465 +0
android jsc armeabi-v7a 8,393,871 +0
android jsc x86 9,578,928 +0
android jsc x86_64 10,171,967 +0

Base commit: 38fcafe
Branch: main

@analysis-bot
Copy link
Copy Markdown

analysis-bot commented Oct 10, 2022

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

Base commit: 38fcafe
Branch: main

@gabrieldonadel gabrieldonadel force-pushed the chore/extract-interface-not-found-error branch from 5d8f8ea to 04cb6b0 Compare October 11, 2022 12:50
@facebook-github-bot
Copy link
Copy Markdown
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
Copy Markdown
Collaborator

This pull request was successfully merged by @gabrieldonadel in c9338c4.

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 14, 2022
@gabrieldonadel gabrieldonadel deleted the chore/extract-interface-not-found-error branch October 14, 2022 12:02
mohitcharkha pushed a commit to mohitcharkha/react-native that referenced this pull request Oct 17, 2022
…te function (facebook#34922)

Summary:
This PR extracts the codegen `ModuleInterfaceNotFoundParserError` exception into a separate function inside `error-utils.js` so that it can be used by both Flow and Typescript parsers as requested on facebook#34872. This also adds unit tests to the new `throwIfModuleInterfaceNotFound` function.

[Internal] [Changed] - Extract codegen `ModuleInterfaceNotFoundParserError` in a separate function that can de used by Flow and TypeScript parsers

Pull Request resolved: facebook#34922

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

![image](https://user-images.githubusercontent.com/11707729/194876017-8e98e3d2-4518-4cbe-b7f0-b77a54060b1e.png)

Reviewed By: dmytrorykun

Differential Revision: D40296533

Pulled By: cipolleschi

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

5 participants