Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Remove polyfill #17

Open
dougalg opened this issue Oct 23, 2019 · 2 comments
Open

Remove polyfill #17

dougalg opened this issue Oct 23, 2019 · 2 comments

Comments

@dougalg
Copy link

dougalg commented Oct 23, 2019

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.

@philipwalton
Copy link
Contributor

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).

@dougalg
Copy link
Author

dougalg commented Oct 30, 2019

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. 😅

I'll take a look at making a PR.

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

No branches or pull requests

2 participants