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

[cli] Third party libraries can be configured into config.json #4535

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Brianzchen
Copy link
Member

Closes #4534

Working list

  • Added docs
  • Change deps to defDeps to distinguish between the two kinds

@joshuanapoli
Copy link
Contributor

@Brianzchen

How does react-native ship flow definitions?

The source files in the shipped package are all flow-typed. As far as I understand, the package.json refers to these flow-typed files. As configured by package.json, the flow-typed files will be loaded at "run time" by import/requre. There are no pure JavaScript files in the package. Also, configured by package.json, Typescript .d.ts files are loaded from the types directory.

Each of the main sources have a flow comment:

/**
 [...]
 * @format
 * @flow strict-local
 */

Evidently, the metro bundler strips the flow types.

I hope that this information is correct. It seems surprising to me.

@Brianzchen
Copy link
Member Author

Thanks @joshuanapoli for that context. I've tried to make this work but while doing so made a shocking discovery...
Screenshot 2023-10-18 081544

Seeking more input from the flow team but at the moment limited by core flow itself.

Interestingly importing at the top level of a library definition file doesn't give an unresolved error but instead is more of a lint rule saying it's not good practice and still errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants