polyfill-io-loader icon indicating copy to clipboard operation
polyfill-io-loader copied to clipboard

Better handling polyfills without a detector

Open zsolt-dev opened this issue 2 years ago • 2 comments

Hi,

First of all, thank you for creating this loader. This library is greatly underrated since It's really the only good solution for polyfiling.

Here is one issue I have with it: When I generate the string with polyfills like this: npx create-polyfill-service-url analyse --file dist/main.js and use this string as is in your loader, it errors out since some polyfills do not have a detector code.

My proposed solution:

  1. do not error out on polyfills without a detector.
  2. if the polyfill.io is contacted with at least a single polyfill, add all the polyfills without a detector to the polyfills list string.

This solution would solve two problems:

  1. I could use the string generated with npx create-polyfill-service as is, without removing polyfills one by one.
  2. greatly improve the chances of polyfilling all polyfills in older browsers. (so even polyfills without a detector code would get polyfilled)

As I said before, this library deserves much more stars / downloads and I believe its the best solution for polyfilling. If I would create a PR for this would you be willing to merge it?

Thank you

zsolt-dev avatar Jan 15 '22 15:01 zsolt-dev