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

react-native loaded into test runner #4534

Open
Brianzchen opened this issue Oct 12, 2023 · 2 comments
Open

react-native loaded into test runner #4534

Brianzchen opened this issue Oct 12, 2023 · 2 comments
Labels
cli Related to CLI tool enhancement An addition to an existing component

Comments

@Brianzchen
Copy link
Member

CLI Version

4.x.x

What problem do you want to solve?

As shown here #4533 (comment)

There are cases where definitions want to use the types directly from react native just like we would with react. But since react-native is not part of the core lib this can't be possible

Your take on the correct solution?

I think with a definitions config.json we can add a new property for third party libraries to install that are typed for the definition to depend upon during testing.

We won't use this config during the install phase as we'll assume this is already catered for in a libraries package.json dependencies field.

Anything else?

Alternatively for react-native we could just load it into the test function regardless but I think that's not the right approach and would misleading

Do you want to submit a pull request to implement this change?

Yes

@Brianzchen Brianzchen added enhancement An addition to an existing component cli Related to CLI tool labels Oct 12, 2023
@pascalduez
Copy link
Member

pascalduez commented Oct 13, 2023

Correct me if I'm wrong, but wasn't this the goal of the v4 / main branch?
To be able to declare dependencies and have them loaded in tests.

Also related or not https://flow.org/en/docs/react/multiplatform (experimental though).

Edit: okay got it, installing "real" dependencies, not just libdefs 😅

@Brianzchen
Copy link
Member Author

okay got it, installing "real" dependencies, not just libdefs 😅

Yeah basically this. For most libraries core packages that have plugins/extensions aren't flow-typed in the first place so depending on their libdefs works well.

Right now I can only think of react-native being a use case. React itself also would be a usecase if it weren't bundled in the flow standard library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Related to CLI tool enhancement An addition to an existing component
Projects
None yet
Development

No branches or pull requests

2 participants