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

Don't require global babelHelpers in ES6 build #45

Closed
Jessidhia opened this issue Sep 5, 2016 · 4 comments
Closed

Don't require global babelHelpers in ES6 build #45

Jessidhia opened this issue Sep 5, 2016 · 4 comments

Comments

@Jessidhia
Copy link

If the user of the library doesn't happen to use the babel helpers transform and the global helpers runtime, there will be a lot of ReferenceError: babelHelpers is not defined that cannot be fixed other than by providing the global helpers.

@siriwatknp
Copy link

siriwatknp commented Oct 17, 2016

I have this problem ReferenceError: babelHelpers is not defined, do you know how to solve this?
@Kovensky

clauderic pushed a commit that referenced this issue Oct 17, 2016
@clauderic
Copy link
Owner

Just published v0.0.11 to npm, which should address this. Give it a spin and let me know if you run into any issues.

@siriwatknp
Copy link

Yeah! Now it works, thanks @clauderic

@Jessidhia
Copy link
Author

Jessidhia commented Oct 24, 2016

@clauderic yeah, this works, but runtime helpers has a different, unfortunate, issue :/

If you are already using babel-polyfill, the runtime helpers will effectively include a second copy of core-js, because while the inline helpers will use globals and assume that you have polyfilled them, babel-runtime's helpers always require the ones from core-js's library mode.

As a workaround, I have a 'react-sortable-hoc': 'react-sortable-hoc/dist/commonjs' alias in the webpack config. This is a really hard problem to solve while making everyone happy; your solution is perfectly fine for people that don't want to ship a full polyfill.

The alternative is to not do the transform, and require that people provide those specific polyfills. That, AFAIK, seems to be the most common practice. There is the code size issue with all those helpers repeated everywhere, though, but it should not be too bad compared to a second copy of the same polyfill.

DimitarNestorov pushed a commit to codemotionapps/react-sortable-hoc that referenced this issue Feb 4, 2019
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