-
-
Notifications
You must be signed in to change notification settings - Fork 227
Conversation
In this diff I replaced flow-copy-source with much more simple and less verbose way to distribute flow types. I suggest to reuse flow types which already exist in `src` folder by reexporting them. This also requires to publish `src`.
What's wrong with the current approach? |
It requires unnecessary tool and produces a lot of unnecessary files, which can be reused instead of duplication. |
Yes but with the current method we avoid to ship tests and other unused stuff to npm. Also, it's quite common to ship the |
Also forgot to mention. Currently flow are placed in es folder where they are absolutely useless. Developers usually import from |
If you import from |
@FezVrasta |
Ok so we can simply change flow-copy-source to copy to cjs instead of es, but I'd keep it. |
My way to distribute flow types is like bundling, only one file is placed in dist. Also I'm gonna to propose cjs and esm bundles instead of bunch of babeled files. |
I prefer the current approach, really. About bundles, I don't think there's need to generate them, anyway nobody is going to be able to use them in the browser directly. |
Take a look it's quite common. UMD bundle can be used directly. |
The problem that currently there are two ways to consume the library. With single entry point ( Also bundling is a way to optimize user bundler work. |
We can't provide an UMD bundle because some of our dependencies don't ship UMD bundles. |
UMD usually means bundled dependencies. Only react and react-dom shouldn't bundled in this project. |
In any case, that would be an additional dist target, the ones we have should stay as they are. |
I fixed the flow-copy-source command in #154. If you'd like to add an UMD build please open a new PR, thanks! |
In this diff I replaced flow-copy-source with much more simple and less
verbose way to distribute flow types.
I suggest to reuse flow types which already exist in
src
folder byreexporting them.
This also requires to publish
src
.