Skip to content
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

Revert module.exports to export defaultl #2

Closed
cameracker opened this issue Aug 16, 2017 · 7 comments
Closed

Revert module.exports to export defaultl #2

cameracker opened this issue Aug 16, 2017 · 7 comments

Comments

@cameracker
Copy link

cameracker commented Aug 16, 2017

The change in the way the debounceRender function is exported (from export default to module.exports) has broken importing of the debounceRender, and is inconsistent with the documentation.

Now instead of import debounceRender from 'react-debounce-render';, imports must be import { debounceRender } from 'react-debounce-render';.

This isn't that big of a deal if you're only importing this once or twice, but if it is used pervasively, this creates a lot of extra work. Furthermore, because this repo is not using tags, there's not a great way to lock reliably to a particular version.

It is true that the readme said that "the extra default would be removed" but it wasn't actually necessary in the first place, and said nothing about the import changing.

My code was


export default debounceRender(MyComponent);```

and this worked great without the `default` in the example. 

Please do one of the folllowing:
1. Revert the export to use `export default` like before.
2. Update the documentation to show correct importing of the function.

@podefr
Copy link
Owner

podefr commented Aug 16, 2017

thanks for raising this issue, I'll address it shortly

@podefr
Copy link
Owner

podefr commented Aug 17, 2017

Thanks, I pushed version 3.0.0 (breaking change if pple were using the destructuring assginment in the import statement, hence the major version bump).
I also tagged the version.

Let me know if it fixes your issue, thanks again for raising it!

@podefr
Copy link
Owner

podefr commented Aug 17, 2017

@wbazant I'd really appreciate if you could quickly test version 3.0.0 and confirm that I didn't break anything by changing the export statement :) simply npm installing the latest version and confirming that the module still gets properly imported is enough. Thanks!

@wbazant
Copy link
Contributor

wbazant commented Aug 17, 2017

I looked at the change, it looks right and also the better thing to do! How exports are set up- it looks standard- if the demo now works they are good. Thanks for the fix! We'll upgrade expression-atlas-heatmap-highcharts to use 3.0.0.

@wbazant
Copy link
Contributor

wbazant commented Aug 17, 2017

Also re tags nect time if you "npm version minor" it will upgrade the package.json, add a tag etc

@cameracker
Copy link
Author

Looks good!!

@podefr
Copy link
Owner

podefr commented Aug 17, 2017

awesome, thanks guys!

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

No branches or pull requests

3 participants