Choices: Question around polyfills

Created on 16 Aug 2016  路  6Comments  路  Source: Choices-js/Choices

Hi!
I noticed you're currently using https://github.com/jshjohnson/Choices/blob/master/assets/scripts/src/lib/polyfills.js to handle polyfills for a few helper plugins. Wanted to get your thoughts around removing these and letting the end-user decide more on its implementation for compatibility. I wrote a little bit about the subject here which outlines using a tool like http://polyfill.io to handle these additions for you.

question

All 6 comments

I'm definitely open to this. My only reservation is that people miss a particular polyfill, get an error and assume the library has bugs!

Yeah I hear ya. Can be a tougher transition with existing repos, but something that can be approached through documentation. Obviously a bit of a buy-in to promote a service like http://polyfill.io but there certainly are some other options out there; especially if users have their own implementation.

I have updated the documentation to recommend polyfill usage where needed: https://github.com/jshjohnson/Choices#browser-compatibility

I have kept the polyfill for Array.from and window.requestAnimationFrame within the Choices bundle as they are required for the plugin to function.

Thanks for the heads up.

Cool! That's a great addition to the README. One quick note around keeping requestAnimationFrame - since the browser compat list mentions only browsers that support es5 it looks like the former has very similar support for it, so something maybe to be considered for the future. Thanks!

Good point, I had always assumed requestAnimationFrame had poor support. I'll move this out of the build in the next release. Thanks

The requestAnimationFrame polyfill has been removed as of version 1.1.7

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NetanelBasal picture NetanelBasal  路  5Comments

rstacruz picture rstacruz  路  4Comments

NetanelBasal picture NetanelBasal  路  6Comments

ckotzbauer picture ckotzbauer  路  5Comments

tekord picture tekord  路  4Comments