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
@providesModule for public use? #2648
Comments
|
Thanks guys. @samwgoldman is there anything similar which is less internal which can potentially produce this sort of functionality? |
You're welcome to use haste, but it's not a Flow thing, which is why we don't have documentation for it. Do either of the links Andres shared help? |
Yeah they do thanks, just trying to get my head around it. The confusion really comes from the open source example of "your" F8 App which uses this all over the place. There was an issue there (fbsamples/f8app#72) about this, hence me bringing this up here as I thought it was a flow thing |
@samwgoldman Just FYI we do use Haste in a couple of places with the understanding that it's on us to make it work for our use cases and that the code is the documentation. Haste is pretty useful and I think the right way to do modules within packages (interpackage imports don't change at all in the spec I have in mind) so I'd like to see it proliferate but no one's working on making that happen at the moment. |
For the ones interested in using Haste, I've written a simple webpack resolver that can use it: https://github.com/flegall/haste-map-webpack-resolver |
To have path aliasing, you can use webpack's resolve.alias. If you're using react-native and can't configure webpack, then babel's babel-plugin-module-resolver should work. If that, you'll also need to create an
|
@samwgoldman honesly I hope Facebook stops using it too, any time I (unintentionally wind up with multiple versions of a dep that uses |
Hello,
The Facebook F8 App makes quite heavy use of
@providesModule
with Flow. Now it's possible to use this ourselves if we include the module/files in the.flowconfig
and have access to "global" modules we define with@providesModule
without figuring out the relative paths.This works great, however I'm struggling to find much about it in the documentation. Are we supposed to use this in our own environment or not? If not, why not?
It makes life so much simpler, but I can't work out whether I should be doing it.
The text was updated successfully, but these errors were encountered: