mo / abortcontroller-polyfill

Polyfill for the AbortController DOM API and abortable fetch (stub that calls catch, doesn't actually abort request).
MIT License
328 stars 26 forks source link

update dependencies, babel preset-env set to IE10 #34

Closed caub closed 5 years ago

caub commented 5 years ago

cf https://github.com/Financial-Times/polyfill-library/pull/59

I'm not sure this commit makes a real difference, the dist/ù files are exactly the same size with or without the "ie": "10" option in .babelrc, but let's try to polyfills.io

caub commented 5 years ago

I think we could remove and gitignore package-lock.json, it's not very useful for libraries like here

caub commented 5 years ago

I updated with "ie": "8" as target and "plugins": ["@babel/plugin-transform-member-expression-literals"] but when running the build, the dist/ files are not modified, so nothing changed

mo commented 5 years ago

I tried to run abortcontroller-polyfill on IE8 and found that the function document.createEvent() doesn't exist, so I added a new path that calls into document.createEventObject() instead when document.createEvent() is missing.

After I did this, abortcontroller-polyfill worked on IE8 when I used it together with the "fetch-ie8" npm package. Here is the example: https://github.com/mo/abortcontroller-polyfill-examples/tree/master/plain-javascript-fetch-ie8

github-fetch only supports IE 10+ though and while "unfetch" claims IE8 support in their README I could not get it to work using the latest version.

Also I could not get CORS requests to work on "fetch-ie8", and there is an open issue about unfetch with CORS on IE 8.

mo commented 5 years ago

@caub I've cleaned up the abortcontroller-polyfill test suite a bit now on master and upgraded it to webdriverio 5.x etc..

mo commented 5 years ago

I've merged this PR now and released it as 1.2.8