idlize icon indicating copy to clipboard operation
idlize copied to clipboard

Remove polyfill

Open dougalg opened this issue 5 years ago • 2 comments

Is it possible to remove the polyfill from default inclusion? Given the use of mjs it seems to assume some sort of bundling is happening anyway, so it seems reasonable to let users polyfill requestIdleCallback themselves as they see fit.

If you'd like, I am happy to make a PR with the removal and docs.

dougalg avatar Oct 23 '19 08:10 dougalg

I think that's a fair request. It probably makes the most sense to have a separate package that's just the requestIdleCallback and cancelIdleCallback polyfills, and then this package would have usage instructions indicating that users who want to support older browsers would need to include a polyfill (and suggest that separate package).

At the moment I suppose you could get this behavior using a bundler by aliasing the idle-callback-polyfills.mjs file to something of your choosing, but I agree it shouldn't necessarily require a bundler to make this happen.

Given the use of mjs it seems to assume some sort of bundling is happening anyway

Hmmm, not entirely sure what you mean by that. I was using .mjs just to signify that the source code was in ES module format (rather than CommonJS).

philipwalton avatar Oct 25 '19 20:10 philipwalton

Ah yeah, good point, sorry. Was just assuming that most mjs users would be using a bundler, but of course that's not a given. :sweat_smile:

I'll take a look at making a PR.

dougalg avatar Oct 30 '19 04:10 dougalg