JakeChampion / polyfill-library

NodeJS module to create polyfill bundles tailored to individual user-agents.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RFC : Use mdn compat table data instead of custom configuration

jdeniau opened this issue · comments

What

RFC to use the up-to-date @mdn/browser-compat-data instead of local configuration (on at least use it to create such configuration)

Details

In order to fix #1158 , I submitted #1159. In order to know which version of Opera should be added, I looked on mdn to see the browser compatibility.

I looked at #1042 and #19 that explain that you relly on automated tests, but some browsers are not really tested if I understood correctly. Moreover theses issues are quite old now.

I think it could be a good idea to use the mdn compatibility table.

Regarding the Reflect API on mdn and the polyfill configuration, it seems quite easy to convert from mdn to polyfill.

Additional information

I can try to work on that if this is relevant, but I would like your insight as I do not have your understanding of the project.

Possible non-compatibility

It seems that data in mdn does not contain opera mobile or blackberry browser

Hi @jdeniau,

MDN data describes which browsers support a given feature while the configuration here describes which browsers require a polyfill to work correctly.

We do use MDN as a data source but adjust where needed.

  • broken native implementations
  • MDN is incorrect
  • MDN is incomplete
  • ...

The scope of a polyfill mostly lines up with how MDN defines a feature but not always.
If this differs we also need a different config.


It is actually easier and simpler to have a manual config that we have to change and tweak often.

Each change will be small and easily verified manually.

If we make this an automatic process we will have to pull in updated MDN data regularly and then analyse how each bump impacts the polyfill configs and re-verify these. This is more complex because we will also have to figure out why each value was changed.

@jdeniau I've added a new command npm run lint-config which is able to give feedback on configs with missing browsers like Opera.

I hope that this will make it easier to manually update configs when needed.