Skip to content
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.

Direct imports don't include flow types #655

Closed
benadamstyles opened this issue Apr 25, 2018 · 4 comments
Closed

Direct imports don't include flow types #655

benadamstyles opened this issue Apr 25, 2018 · 4 comments

Comments

@benadamstyles
Copy link

Refers to this PR: #649

If we do import pure from 'recompose/pure', no flow types are included. Would it be possible to place the flow types alongside each helper file, rather than in one index.js.flow file?

@istarkov
Copy link
Contributor

We want to deprecate direct imports, as recompose fully supports tree shaking. And imports directly from recompose can even reduce your bundle size

@benadamstyles
Copy link
Author

And imports directly from recompose can even reduce your bundle size

Oh really? Can you explain why?

@TrySound
Copy link
Contributor

@Leeds-eBooks Currently we allow both ways to use recompose with named exports and with path imports. main entry point is referenced to cjs bundle, module to esm one. Using path import forces us to choose explicitly which format we would like to use. This may lead to the duplicating problem when one project uses both ways.

To fix this we specify bundles in main and module fields. Then bundler will choose what is may consume without additional configuration and inconsistencies.

So for now we recommend to use named exports for better readability, consistency and small size.

Treeshakability can be tracked here in .size-snapshot.json file.

@benadamstyles
Copy link
Author

Ok thanks, I'll close this.

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

No branches or pull requests

3 participants