plougsgaard / react-timeout

Component wrapper for setTimeout et al that cleans up after itself.
127 stars 17 forks source link

create-react-class as PeerDependecies #20

Closed onemanstartup closed 5 years ago

onemanstartup commented 7 years ago

Or why not remove it at all?

plougsgaard commented 7 years ago

The reason to do it with create-react-class is so it works with future versions of React and remains ES5 compatible.

As such it's needed as a dependency. 😄

onemanstartup commented 7 years ago

@plougsgaard but if you are using babel then it will be ES5 compatible, and future versions of React will use only classes, this is why this functionality was extracted in another package. And if people won't use create-react-class then this package will add big unneded dependency in their project. At least you can set this as PeerDependencies and people wont' download multiple different versions of create-react-class packages.

plougsgaard commented 7 years ago

I see your argument for putting it as a peer dependency. (#21)

I think it's important to have it be as compatible as possible, which is why Babel shouldn't be a requirement.

onemanstartup commented 7 years ago

@plougsgaard I don't maintain any open source packages, but as far as I know, many people making releases and distribute already compiled code, so people don't need babel for compiling.

otakustay commented 7 years ago

+1 to @onemanstartup , the package can publish with a precompiled dist file and an optional src file, src can be written in ES6 while the dist is compiled to ES5 and main in package.json is the dist