Skip to content

Conversation

@Marcoo09
Copy link
Contributor

Summary

This PR is part of #34872
This PR extracts MoreThanOneModuleInterfaceParserError exception to a separate function inside an error-utils.js file

Changelog

[Internal] [Changed] - Extract MoreThanOneModuleInterfaceParserError to a seperate function inside error-utils.js

Test Plan

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

Can you rebase on top of main? The #34896 finally landed!

@analysis-bot
Copy link

analysis-bot commented Oct 10, 2022

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,777,102 +118
android hermes armeabi-v7a 7,180,438 +1,489
android hermes x86 8,091,826 +1,176
android hermes x86_64 8,062,787 +341
android jsc arm64-v8a 9,635,938 +0
android jsc armeabi-v7a 8,401,130 +0
android jsc x86 9,585,857 +0
android jsc x86_64 10,179,063 +0

Base commit: 49cb7f2
Branch: main

@Marcoo09 Marcoo09 force-pushed the chore/extract-codegen-parser-moreThanOneModule-exception branch from 7c2de98 to b7c00b1 Compare October 10, 2022 12:20
@Marcoo09
Copy link
Contributor Author

Done @cipolleschi
Let me know any feedback, thanks!

@Marcoo09
Copy link
Contributor Author

@cipolleschi I fixed some of the flow-checks errors. Now is missing the following one:
image
But I'm not able to fix because it starts to trigger the following one:
image
Should I type the parserType param as string, $FlowFixMe, 'Flow' | 'Typescript' or which is the correct way?

@cipolleschi
Copy link
Contributor

Hi @Marcoo09!
The problem is in how you are trying to export the ParserType. As the compiler tells you, Types are erased at runtime. If you want to reuse that type, you have to export it with this syntax in the errors.js

export type ParserType

and then you have to use it with the import type syntax:

import type {ParserType} from 

In this way, it should work!

@Marcoo09
Copy link
Contributor Author

Great @cipolleschi
I've just done the changes. Thanks!

@facebook-github-bot
Copy link
Contributor

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

@analysis-bot
Copy link

analysis-bot commented Oct 10, 2022

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

Base commit: 49cb7f2
Branch: main

@cipolleschi
Copy link
Contributor

@motiz88 could you please reimport this PR?

@facebook-github-bot
Copy link
Contributor

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

@cipolleschi
Copy link
Contributor

/rebase

@github-actions github-actions bot force-pushed the chore/extract-codegen-parser-moreThanOneModule-exception branch from 38869d2 to 4635134 Compare October 12, 2022 10:13
@cipolleschi
Copy link
Contributor

@Marcoo09 could you rebase and resolve the conflicts, please?

@Marcoo09
Copy link
Contributor Author

@cipolleschi sorry, just rebased

@cipolleschi
Copy link
Contributor

Sorry to ask again, could you rebase, please? 🙏

@Marcoo09 Marcoo09 force-pushed the chore/extract-codegen-parser-moreThanOneModule-exception branch from 4635134 to 9f60605 Compare October 17, 2022 16:05
@github-actions
Copy link

Warnings
⚠️

packages/react-native-codegen/src/parsers/tests/error-utils-test.js#L471 - packages/react-native-codegen/src/parsers/tests/error-utils-test.js line 471 – Describe block title is used multiple times in the same describe block. (jest/no-identical-title)

⚠️

packages/react-native-codegen/src/parsers/typescript/modules/index.js#L56 - packages/react-native-codegen/src/parsers/typescript/modules/index.js line 56 – 'MoreThanOneModuleInterfaceParserError' is assigned a value but never used. (no-unused-vars)

⚠️

packages/react-native-codegen/src/parsers/typescript/modules/index.js#L57 - packages/react-native-codegen/src/parsers/typescript/modules/index.js line 57 – 'ModuleInterfaceNotFoundParserError' is assigned a value but never used. (no-unused-vars)

Generated by 🚫 dangerJS against 9f60605

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @Marcoo09 in f628edc.

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

Summary:
This PR is part of facebook#34872
This PR extracts MoreThanOneModuleInterfaceParserError exception to a separate function inside an error-utils.js file

## Changelog

[Internal] [Changed] - Extract MoreThanOneModuleInterfaceParserError to a seperate function inside error-utils.js

Pull Request resolved: facebook#34920

Test Plan: <img width="297" alt="image" src="https://user-images.githubusercontent.com/18408823/194859284-7d3ff330-c644-472e-9ae0-3b9444bc12e8.png">

Reviewed By: cortinico

Differential Revision: D40226575

Pulled By: cipolleschi

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