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

Which polyfills were used? #473

Closed
shepmaster opened this issue Jan 8, 2019 · 6 comments
Closed

Which polyfills were used? #473

shepmaster opened this issue Jan 8, 2019 · 6 comments

Comments

@shepmaster
Copy link

The changelog states:

you will need to include your own polyfills in order to support older browsers.

Is there a way we can know what polyfills are needed in order to provide them?

@clauderic
Copy link
Owner

react-sortable-hoc used to include babel-polyfill in the UMD bundle.

Whether or not you need polyfills depends on the browsers you intend on supporting. See #450

@shepmaster
Copy link
Author

Thank you!

@shepmaster
Copy link
Author

@clauderic actually, I've narrowed down my issue to the bump from 1.0 to 1.1. Since the polyfills were removed in 1.0, it seems possible that I may be seeing an error unrelated to polyfills. The code does include babel-polyfill, which is why I was hoping that there might have been some other polyfill that we were missing.

Additionally, I don't think we were using the UMD bundle, as we import things like:

import { SortableContainer, SortableElement, SortableHandle } from 'react-sortable-hoc';

Unfortunately, it's not easy to diagnose the error as it only occurs in PhantomJS (a headless browser) and there are no console messages generated.

I see in #474 that some processing is missing, perhaps this is related?

@clauderic
Copy link
Owner

Hey @shepmaster, try using [email protected] and let me know if you run into any issues

@shepmaster
Copy link
Author

Yes, a quick test seems to indicate this addresses the issue. I see that 1.4.0 depends on "@babel/runtime" "^7.2.0" — is that what the problem was?

@clauderic
Copy link
Owner

Not exactly. @babel/runtime is an optimisation to make sure the libraries you use share the same babel runtime helpers instead of individually including them in their bundles (the end result is a smaller bundle size if you have multiple libraries that depend on @babel/runtime, or the same as if the helpers were inlined in the bundle if you're only using one library that depends on it).

I recently switched to use microbundle for generating the bundles, which promised to be a zero config bundler. It uses Buble instead of Babel for transpiling (there's a PR under review to switch to Babel in the future), and for some reason the CommonJS and UMD bundles it generated had a number of issues, so I'm reverting that decision and have instead gone back to manually generating the bundles using Babel and Rollup (see #477)

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

2 participants