jquense / uncontrollable

Wrap a controlled react component, to allow specific prop/handler pairs to be uncontrolled
MIT License
200 stars 35 forks source link

feat: add esm support #34

Closed TrySound closed 5 years ago

TrySound commented 5 years ago

In this diff I added esm support with the help of cherry-pick package and added babel helpers.

TrySound commented 5 years ago

Hi @jquense. Pinging you in case you missed this :)

jquense commented 5 years ago

If the tree shaking works i'd be fine with a single main export version and forgo the cherry-pick tooling since it's really just two public imports here the HOC and hook.

TrySound commented 5 years ago

Cool. Yeah, treeshaking will work with only functions.

TrySound commented 5 years ago

Your babel config produces this things which should be development only image

jquense commented 5 years ago

I'll take a look, i think it's jsut a configuration issue. need to update the preset

TrySound commented 5 years ago

@jquense Got it. Your config requires NODE_ENV=production everywhere.

TrySound commented 5 years ago

@jquense Could you publish new version?

TrySound commented 5 years ago

Friendly ping @jquense :)

TrySound commented 5 years ago

@jquense Ooops. It should be major release. We did breaking change. import uncontrollable from 'uncontrollable' -> import { uncontrollable } from 'uncontrollable' import useUncontrolled from 'uncontrollable/hooks' -> import { useUncontrolled } from 'uncontrollable'

jquense commented 5 years ago

I (hopefully) tweaked build output to avoid the breaking change. you can still cherry-pick useUncontrolled from uncontrolled/hook it just won't work correctly in the esm case, which should be ok since we didn't have esm support before?

I'm not suggesting folks should cherry pick, but I think as back compat thing it is ok

TrySound commented 5 years ago

Ah, cool. Didn't notice :)

TrySound commented 5 years ago

@jquense Though you didn't provide default export for uncontrollable. So this is still breaking change.

TrySound commented 5 years ago

First bug report https://github.com/intljusticemission/react-big-calendar/issues/1358

TrySound commented 5 years ago

I suggest to rerelease v6.1.0 and release master as v7

chengjia0807 commented 5 years ago

same issue here

TrySound commented 5 years ago

@chengjia0807 Try uncontrollable 6.2.2

jquense commented 5 years ago

sorry folks, should be good now.